diff options
author | Valentin Batz <senneth@irssi.org> | 2005-02-03 15:51:03 +0000 |
---|---|---|
committer | vb <vb@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2005-02-03 15:51:03 +0000 |
commit | cc10292c216bae22298c205d14a3817381e71e2b (patch) | |
tree | 4ee121338725423d535f8ddade35f2fbaebdf384 | |
parent | b5f93b6164da0b18090e3cee01a3ac31eb96709b (diff) | |
download | irssi-cc10292c216bae22298c205d14a3817381e71e2b.zip |
Update our own nickrec->gone flag on /away <reason> or on /away
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3704 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/irc/core/irc-nicklist.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c index c09673a6..ddf62e5b 100644 --- a/src/irc/core/irc-nicklist.c +++ b/src/irc/core/irc-nicklist.c @@ -277,6 +277,30 @@ static void event_whois_away(SERVER_REC *server, const char *data) g_free(params); } +static void event_own_away(SERVER_REC *server, const char *data) +{ + char *params, *nick; + + g_return_if_fail(data != NULL); + + /* set user's gone flag.. */ + params = event_get_params(data, 2, &nick, NULL); + nicklist_update_flags(server, nick, TRUE, -1); + g_free(params); +} + +static void event_own_unaway(SERVER_REC *server, const char *data) +{ + char *params, *nick; + + g_return_if_fail(data != NULL); + + /* set user's gone flag.. */ + params = event_get_params(data, 2, &nick, NULL); + nicklist_update_flags(server, nick, FALSE, -1); + g_free(params); +} + static void event_whois_ircop(SERVER_REC *server, const char *data) { char *params, *nick, *awaymsg; @@ -428,6 +452,8 @@ void irc_nicklist_init(void) signal_add_first("event 311", (SIGNAL_FUNC) event_whois); signal_add_first("whois away", (SIGNAL_FUNC) event_whois_away); signal_add_first("whois oper", (SIGNAL_FUNC) event_whois_ircop); + signal_add_first("event 306", (SIGNAL_FUNC) event_own_away); + signal_add_first("event 305", (SIGNAL_FUNC) event_own_unaway); signal_add_first("event 353", (SIGNAL_FUNC) event_names_list); signal_add_first("event 366", (SIGNAL_FUNC) event_end_of_names); signal_add_first("event 432", (SIGNAL_FUNC) event_nick_in_use); @@ -448,6 +474,8 @@ void irc_nicklist_deinit(void) signal_remove("event 311", (SIGNAL_FUNC) event_whois); signal_remove("whois away", (SIGNAL_FUNC) event_whois_away); signal_remove("whois oper", (SIGNAL_FUNC) event_whois_ircop); + signal_remove("event 306", (SIGNAL_FUNC) event_own_away); + signal_remove("event 305", (SIGNAL_FUNC) event_own_unaway); signal_remove("event 353", (SIGNAL_FUNC) event_names_list); signal_remove("event 366", (SIGNAL_FUNC) event_end_of_names); signal_remove("event 432", (SIGNAL_FUNC) event_nick_in_use); |