diff options
author | Timo Sirainen <cras@irssi.org> | 2000-09-30 22:49:48 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-09-30 22:49:48 +0000 |
commit | 2b8580c8a73ecdb2846b745c32b0ba51be4458e3 (patch) | |
tree | 04a68511ca0e66618883afb9e8ff83ca4425f972 /src/irc/core/irc-nicklist.c | |
parent | 965def294b3787052a9285ef22d6b01cd41a2ebe (diff) | |
download | irssi-2b8580c8a73ecdb2846b745c32b0ba51be4458e3.zip |
multiprotocol updates. SILC prints channel and private messages now
using the same message formats as IRC.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@699 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/core/irc-nicklist.c')
-rw-r--r-- | src/irc/core/irc-nicklist.c | 55 |
1 files changed, 13 insertions, 42 deletions
diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c index 3b3dcd8a..420b3834 100644 --- a/src/irc/core/irc-nicklist.c +++ b/src/irc/core/irc-nicklist.c @@ -34,9 +34,6 @@ (a) == '[' || (a) == ']' || (a) == '{' || (a) == '}' || \ (a) == '|' || (a) == '\\' || (a) == '^') -#define isalnumhigh(a) \ - (isalnum(a) || (unsigned char) (a) >= 128) - /* Remove all "extra" characters from `nick'. Like _nick_ -> nick */ char *irc_nick_strip(const char *nick) { @@ -56,45 +53,6 @@ char *irc_nick_strip(const char *nick) return stripped; } -/* Check is `msg' is meant for `nick'. */ -int irc_nick_match(const char *nick, const char *msg) -{ - int len; - - g_return_val_if_fail(nick != NULL, FALSE); - g_return_val_if_fail(msg != NULL, FALSE); - - /* first check for identical match */ - len = strlen(nick); - if (g_strncasecmp(msg, nick, len) == 0 && !isalnumhigh((int) msg[len])) - return TRUE; - - /* check if it matches for alphanumeric parts of nick */ - while (*nick != '\0' && *msg != '\0') { - if (*nick == *msg) { - /* total match */ - msg++; - } else if (isalnum(*msg) && !isalnum(*nick)) { - /* some strange char in your nick, pass it */ - } else - break; - - nick++; - } - - if (isalnumhigh(*msg)) { - /* message continues with another alphanumeric character, - it isn't for us. */ - return FALSE; - } - - /* remove all the non-alphanumeric characters at the end of - the nick and check if message matched that far. */ - while (*nick != '\0' && !isalnum(*nick)) nick++; - - return *nick == '\0'; -} - static void event_names_list(const char *data, SERVER_REC *server) { CHANNEL_REC *chanrec; @@ -378,6 +336,17 @@ static void sig_usermode(SERVER_REC *server) nicklist_update_flags(server, server->nick, server->usermode_away, -1); } +static const char *get_nick_flags(void) +{ + return "@+%"; +} + +static void sig_connected(IRC_SERVER_REC *server) +{ + if (IS_IRC_SERVER(server)) + server->get_nick_flags = (void *) get_nick_flags; +} + void irc_nicklist_init(void) { signal_add("event nick", (SIGNAL_FUNC) event_nick); @@ -395,6 +364,7 @@ void irc_nicklist_init(void) signal_add("event 302", (SIGNAL_FUNC) event_userhost); signal_add("userhost event", (SIGNAL_FUNC) event_userhost); signal_add("user mode changed", (SIGNAL_FUNC) sig_usermode); + signal_add("server connected", (SIGNAL_FUNC) sig_connected); } void irc_nicklist_deinit(void) @@ -414,4 +384,5 @@ void irc_nicklist_deinit(void) signal_remove("event 302", (SIGNAL_FUNC) event_userhost); signal_remove("userhost event", (SIGNAL_FUNC) event_userhost); signal_remove("user mode changed", (SIGNAL_FUNC) sig_usermode); + signal_remove("server connected", (SIGNAL_FUNC) sig_connected); } |