it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
int verified)
{
CHANNEL_REC *chanrec;
- NICK_REC *nickrec = NULL; /* we cheat here a little to keep the limit of
+ NICK_REC *nickrec = NULL; /* we cheat here a little to keep the limit of
6 parameters to a signal handler ... */
const char *nickmode, *printnick;
int for_me, print_channel, level;
char *color, *freemsg = NULL;
+ HILIGHT_REC *hilight;
/* NOTE: this may return NULL if some channel is just closed with
/WINDOW CLOSE and server still sends the few last messages */
for_me = !settings_get_bool("hilight_nick_matches") ? FALSE :
nick_match_msg(chanrec, msg, server->nick);
- color = for_me ? NULL :
- hilight_match_nick(server, target, nick, address, MSGLEVEL_PUBLIC,
- msg);
+ hilight = for_me ? NULL :
+ hilight_match_nick(server, target, nick, address, MSGLEVEL_PUBLIC, msg);
+ color = (hilight == NULL) ? NULL : hilight_get_color(hilight);
print_channel = chanrec == NULL ||
!window_item_is_active((WI_ITEM_REC *) chanrec);
print_channel = TRUE;
level = MSGLEVEL_PUBLIC;
- if (for_me || color != NULL)
+ if (for_me)
level |= MSGLEVEL_HILIGHT;
if (settings_get_bool("emphasis"))
if (printnick == NULL)
printnick = nick;
- if (!print_channel) {
- /* message to active channel in window */
- if (color != NULL) {
- /* highlighted nick */
- printformat_module("fe-common/silc", server, target,
- level, VERIFIED_MSG(verified, SILCTXT_PUBMSG_HILIGHT),
- color, printnick, msg, nickmode);
- } else {
- printformat_module("fe-common/silc", server, target, level,
- for_me ? VERIFIED_MSG(verified, SILCTXT_PUBMSG_ME) :
- VERIFIED_MSG(verified,SILCTXT_PUBMSG),
- printnick, msg, nickmode);
- }
- } else {
- /* message to not existing/active channel */
- if (color != NULL) {
- /* highlighted nick */
- printformat_module("fe-common/silc", server, target, level,
+ if (color != NULL) {
+ /* highlighted nick */
+ TEXT_DEST_REC dest;
+ format_create_dest(&dest, server, target, level, NULL);
+ hilight_update_text_dest(&dest,hilight);
+ if (!print_channel) /* message to active channel in windpw */
+ printformat_module_dest("fe-common/silc", &dest,
+ VERIFIED_MSG(verified, SILCTXT_PUBMSG_HILIGHT),
+ color, printnick, msg, nickmode);
+ else /* message to not existing/active channel */
+ printformat_module_dest("fe-common/silc", &dest,
VERIFIED_MSG(verified, SILCTXT_PUBMSG_HILIGHT_CHANNEL),
color, printnick, target, msg, nickmode);
- } else {
+
+ } else {
+ if (!print_channel)
+ printformat_module("fe-common/silc", server, target, level,
+ for_me ? VERIFIED_MSG(verified, SILCTXT_PUBMSG_ME) :
+ VERIFIED_MSG(verified,SILCTXT_PUBMSG),
+ printnick, msg, nickmode);
+ else
printformat_module("fe-common/silc", server, target, level,
for_me ? VERIFIED_MSG(verified, SILCTXT_PUBMSG_ME_CHANNEL) :
VERIFIED_MSG(verified, SILCTXT_PUBMSG_CHANNEL),
printnick, target, msg, nickmode);
- }
}
g_free_not_null(freemsg);
g_free_not_null(freemsg);
}
-static void sig_message_own_action_all(SERVER_REC *server,
+static void sig_message_own_action_all(SERVER_REC *server,
const char *msg, const char *target,
bool is_channel, bool is_signed)
{
printformat(server, target,
MSGLEVEL_ACTIONS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT |
(is_channel ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS),
- item != NULL ?
+ item != NULL ?
(is_signed ? SILCTXT_OWN_ACTION_SIGNED : SILCTXT_OWN_ACTION) :
(is_signed ? SILCTXT_OWN_ACTION_TARGET_SIGNED :
SILCTXT_OWN_ACTION_TARGET),
msg = freemsg = expand_emphasis(item, msg);
if (is_channel) {
- /* channel action */
+ /* channel action */
if (window_item_is_active(item)) {
/* message to active channel in window */
printformat(server, target, level,
- VERIFIED_MSG2(verified, SILCTXT_ACTION_PUBLIC),
+ VERIFIED_MSG2(verified, SILCTXT_ACTION_PUBLIC),
nick, target, msg);
} else {
/* message to not existing/active channel */
sig_message_action_all(server, msg, nick, address, target, FALSE, verified);
}
-static void sig_message_own_notice_all(SERVER_REC *server,
+static void sig_message_own_notice_all(SERVER_REC *server,
const char *msg, const char *target,
bool is_signed)
{
return;
if (is_channel) {
- /* channel notice */
+ /* channel notice */
printformat(server, target, MSGLEVEL_NOTICES,
- VERIFIED_MSG2(verified, SILCTXT_NOTICE_PUBLIC),
+ VERIFIED_MSG2(verified, SILCTXT_NOTICE_PUBLIC),
nick, target, msg);
} else {
/* private notice */