X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=apps%2Firssi%2Fsrc%2Ffe-common%2Fcore%2Ffe-messages.c;h=31bbbfad056125c3ccee7b1dd7844af09ecbd423;hp=4b4e4db4f758776a561bdc1cd9324b8354f604b8;hb=382d15d447b7a95390decfa783836ae4fe255b3d;hpb=d47a87b03b846e2333ef57b2c0d81f1644992964 diff --git a/apps/irssi/src/fe-common/core/fe-messages.c b/apps/irssi/src/fe-common/core/fe-messages.c index 4b4e4db4..31bbbfad 100644 --- a/apps/irssi/src/fe-common/core/fe-messages.c +++ b/apps/irssi/src/fe-common/core/fe-messages.c @@ -39,7 +39,7 @@ #define ishighalnum(c) ((unsigned char) (c) >= 128 || i_isalnum(c)) -static GHashTable *printnicks; +GHashTable *printnicks; /* convert _underlined_ and *bold* words (and phrases) to use real underlining or bolding */ @@ -152,7 +152,8 @@ static void sig_message_public(SERVER_REC *server, const char *msg, if (nickrec == NULL && chanrec != NULL) nickrec = nicklist_find(chanrec, nick); - for_me = nick_match_msg(chanrec, msg, server->nick); + 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); @@ -226,14 +227,19 @@ static void sig_message_private(SERVER_REC *server, const char *msg, g_free_not_null(freemsg); } -static void print_own_channel_message(SERVER_REC *server, CHANNEL_REC *channel, - const char *target, const char *msg) +static void sig_message_own_public(SERVER_REC *server, const char *msg, + const char *target) { WINDOW_REC *window; + CHANNEL_REC *channel; const char *nickmode; char *freemsg = NULL; int print_channel; + channel = channel_find(server, target); + if (channel != NULL) + target = channel->visible_name; + nickmode = channel_get_nickmode(channel, server->nick); window = channel == NULL ? NULL : @@ -260,18 +266,6 @@ static void print_own_channel_message(SERVER_REC *server, CHANNEL_REC *channel, g_free_not_null(freemsg); } -static void sig_message_own_public(SERVER_REC *server, const char *msg, - const char *target) -{ - CHANNEL_REC *channel; - - g_return_if_fail(server != NULL); - g_return_if_fail(msg != NULL); - - channel = channel_find(server, target); - print_own_channel_message(server, channel, target, msg); -} - static void sig_message_own_private(SERVER_REC *server, const char *msg, const char *target, const char *origtarget) { @@ -346,7 +340,7 @@ static void sig_message_quit(SERVER_REC *server, const char *nick, if (!nicklist_find(rec, nick)) continue; - if (ignore_check(server, nick, address, rec->name, + if (ignore_check(server, nick, address, rec->visible_name, reason, MSGLEVEL_QUITS)) { count++; continue; @@ -354,17 +348,18 @@ static void sig_message_quit(SERVER_REC *server, const char *nick, if (print_channel == NULL || active_win->active == (WI_ITEM_REC *) rec) - print_channel = rec->name; + print_channel = rec->visible_name; if (once) - g_string_sprintfa(chans, "%s,", rec->name); + g_string_sprintfa(chans, "%s,", rec->visible_name); else { window = window_item_window((WI_ITEM_REC *) rec); if (g_slist_find(windows, window) == NULL) { windows = g_slist_append(windows, window); - printformat(server, rec->name, MSGLEVEL_QUITS, + printformat(server, rec->visible_name, + MSGLEVEL_QUITS, TXT_QUIT, nick, address, reason, - rec->name); + rec->visible_name); } } count++; @@ -396,7 +391,7 @@ static void sig_message_kick(SERVER_REC *server, const char *channel, const char *address, const char *reason) { printformat(server, channel, MSGLEVEL_KICKS, - TXT_KICK, nick, channel, kicker, reason); + TXT_KICK, nick, channel, kicker, reason, address); } static void print_nick_change_channel(SERVER_REC *server, const char *channel, @@ -415,7 +410,7 @@ static void print_nick_change_channel(SERVER_REC *server, const char *channel, printformat(server, channel, level, ownnick ? TXT_YOUR_NICK_CHANGED : TXT_NICK_CHANGED, - oldnick, newnick, channel); + oldnick, newnick, channel, address); } static void print_nick_change(SERVER_REC *server, const char *newnick, @@ -440,8 +435,8 @@ static void print_nick_change(SERVER_REC *server, const char *newnick, continue; windows = g_slist_append(windows, window); - print_nick_change_channel(server, channel->name, newnick, - oldnick, address, ownnick); + print_nick_change_channel(server, channel->visible_name, + newnick, oldnick, address, ownnick); msgprint = TRUE; } @@ -449,7 +444,8 @@ static void print_nick_change(SERVER_REC *server, const char *newnick, if (!msgprint && ownnick) { printformat(server, NULL, MSGLEVEL_NICKS, - TXT_YOUR_NICK_CHANGED, oldnick, newnick, ""); + TXT_YOUR_NICK_CHANGED, oldnick, newnick, "", + address); } } @@ -466,7 +462,8 @@ static void sig_message_own_nick(SERVER_REC *server, const char *newnick, print_nick_change(server, newnick, oldnick, address, TRUE); else { printformat(server, NULL, MSGLEVEL_NICKS, - TXT_YOUR_NICK_CHANGED, oldnick, newnick, ""); + TXT_YOUR_NICK_CHANGED, oldnick, newnick, "", + address); } } @@ -477,7 +474,7 @@ static void sig_message_invite(SERVER_REC *server, const char *channel, str = show_lowascii(channel); printformat(server, NULL, MSGLEVEL_INVITES, - TXT_INVITE, nick, str); + TXT_INVITE, nick, str, address); g_free(str); } @@ -487,7 +484,7 @@ static void sig_message_topic(SERVER_REC *server, const char *channel, { printformat(server, channel, MSGLEVEL_TOPICS, *topic != '\0' ? TXT_NEW_TOPIC : TXT_TOPIC_UNSET, - nick, channel, topic); + nick, channel, topic, address); } static int printnick_exists(NICK_REC *first, NICK_REC *ignore, @@ -622,6 +619,7 @@ void fe_messages_init(void) printnicks = g_hash_table_new((GHashFunc) g_direct_hash, (GCompareFunc) g_direct_equal); + settings_add_bool("lookandfeel", "hilight_nick_matches", TRUE); settings_add_bool("lookandfeel", "emphasis", TRUE); settings_add_bool("lookandfeel", "emphasis_replace", FALSE); settings_add_bool("lookandfeel", "emphasis_multiword", FALSE);