]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix mode granting in FJOIN
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 27 Aug 2006 02:34:25 +0000 (02:34 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 27 Aug 2006 02:34:25 +0000 (02:34 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5031 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_spanningtree.cpp

index 01ff49b87e3acfca680d6c022f38b958fed83097..3ad091b71a6fa6e2f7da4c5a0f2ee23c72aa36c2 100644 (file)
@@ -1395,12 +1395,13 @@ class TreeSocket : public InspSocket
                        if (usr && *usr)
                        {
                                char* permissions = usr;
+                               int ntimes = 0;
                                while ((*permissions) && (*permissions != ','))
                                {
                                        ModeHandler* mh = ServerInstance->Modes->FindPrefix(*permissions);
                                        if (mh)
                                        {
-                                               mode_users[modectr++] = usr;
+                                               ntimes++;
                                                charlcat(modestring,mh->GetModeChar(),MAXBUF);
                                        }
                                        else
@@ -1412,7 +1413,13 @@ class TreeSocket : public InspSocket
                                        usr++;
                                        permissions++;
                                }
-                               who = this->Instance->FindNick(++usr);
+                               usr++;
+
+                               /* Did they get any modes? How many times? */
+                               for (int k = 0; k < ntimes; k++)
+                                       mode_users[modectr++] = usr;
+
+                               who = this->Instance->FindNick(usr);
                                if (who)
                                {
                                        chanrec::JoinUser(this->Instance, who, channel.c_str(), true, key);