From 94c6e008adcbb26e1b6c8a142f5e3d13ebfa5ad0 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Tue, 16 Oct 2007 17:20:12 +0000 Subject: [PATCH] Update oper status from userhost reply. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4622 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/irc-nicklist.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c index b60056a8..7d97196f 100644 --- a/src/irc/core/irc-nicklist.c +++ b/src/irc/core/irc-nicklist.c @@ -409,6 +409,7 @@ static void event_nick(IRC_SERVER_REC *server, const char *data, static void event_userhost(SERVER_REC *server, const char *data) { char *params, *hosts, **phosts, **pos, *ptr; + int oper; g_return_if_fail(data != NULL); @@ -418,10 +419,15 @@ static void event_userhost(SERVER_REC *server, const char *data) phosts = g_strsplit(hosts, " ", -1); for (pos = phosts; *pos != NULL; pos++) { ptr = strchr(*pos, '='); - if (ptr == NULL) continue; + if (ptr == NULL || ptr == *pos) continue; + if (ptr[-1] == '*') { + ptr[-1] = '\0'; + oper = 1; + } else + oper = 0; *ptr++ = '\0'; - nicklist_update_flags(server, *pos, *ptr == '-', -1); + nicklist_update_flags(server, *pos, *ptr == '-', oper); } g_strfreev(phosts); g_free(params);