From 0af4f792803654519392ce35ad5c8a30966f0a66 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 27 Aug 2006 02:34:25 +0000 Subject: Fix mode granting in FJOIN git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5031 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 01ff49b87..3ad091b71 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -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); -- cgit v1.2.3