Reversed channel order in remote whois so it matches ircu's order.
[srvx.git] / src / proto-p10.c
index 802351049d314e928644fc2a2645a727aad16ac9..8a5a76de57033f3545c60032dc1fc71ffa588a8c 100644 (file)
@@ -918,9 +918,9 @@ static CMD_FUNC(cmd_whois)
         mlen = strlen(self->name) + strlen(from->nick) + 12 + strlen(who->nick);
         len = 0;
         *buf = '\0';
-        for (i = 0; i < who->channels.used; i++)
+        for (i = who->channels.used; i > 0; )
         {
-            mn = who->channels.list[i];
+            mn = who->channels.list[--i];
 
             if (!IsOper(from) && (mn->channel->modes & (MODE_PRIVATE | MODE_SECRET)) && !GetUserMode(mn->channel, from))
                 continue;