diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-23 21:34:04 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-23 21:34:04 +0000 |
commit | ea3ba4bfd1b072b4f14fb588286eedd0ea8c1d22 (patch) | |
tree | 6f31e715d182c4045f61fd69658c5ca092ae264a /src/modules | |
parent | 9f9e49509ea6d4c4ab0b70e15356d50e1376fdba (diff) |
Multi-prefix FJOIN, and allowing module-defined prefixes across the network
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5002 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree.cpp | 60 |
1 files changed, 11 insertions, 49 deletions
diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 4f3645026..1485c709a 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -1392,24 +1392,17 @@ class TreeSocket : public InspSocket * (is this even possible?) */ if (usr && *usr) { - char permissions = *usr; - switch (permissions) + char* permissions = usr; + while (*permissions != ',') { - case '@': - usr++; - mode_users[modectr++] = usr; - strlcat(modestring,"o",MAXBUF); - break; - case '%': - usr++; - mode_users[modectr++] = usr; - strlcat(modestring,"h",MAXBUF); - break; - case '+': - usr++; + ModeHandler* mh = ServerInstance->Modes->FindPrefix(*permissions); + if (mh) + { mode_users[modectr++] = usr; - strlcat(modestring,"v",MAXBUF); - break; + charlcat(modestring,mh->GetModeChar(),MAXBUF); + } + usr++; + permissions++; } who = this->Instance->FindNick(usr); if (who) @@ -1603,18 +1596,8 @@ class TreeSocket : public InspSocket for (CUList::iterator i = ulist->begin(); i != ulist->end(); i++) { - int x = c->GetStatusFlags(i->second); - if ((x & UCMODE_HOP) && (x & UCMODE_OP)) - { - specific_halfop.push_back(i->second); - } - if (((x & UCMODE_HOP) || (x & UCMODE_OP)) && (x & UCMODE_VOICE)) - { - specific_voice.push_back(i->second); - } - // The first parameter gets a : before it - size_t ptrlen = snprintf(ptr, MAXBUF, " %s%s%s", !numusers ? ":" : "", c->GetPrefixChar(i->second), i->second->nick); + size_t ptrlen = snprintf(ptr, MAXBUF, " %s%s,%s", !numusers ? ":" : "", c->GetAllPrefixChars(i->second), i->second->nick); curlen += ptrlen; ptr += ptrlen; @@ -1628,32 +1611,11 @@ class TreeSocket : public InspSocket ptr = list + dlen; ptrlen = 0; numusers = 0; - for (unsigned int y = 0; y < specific_voice.size(); y++) - { - modes.append("v"); - params.append(specific_voice[y]->nick).append(" "); - } - for (unsigned int y = 0; y < specific_halfop.size(); y++) - { - modes.append("h"); - params.append(specific_halfop[y]->nick).append(" "); - } } } + if (numusers) - { this->WriteLine(list); - for (unsigned int y = 0; y < specific_voice.size(); y++) - { - modes.append("v"); - params.append(specific_voice[y]->nick).append(" "); - } - for (unsigned int y = 0; y < specific_halfop.size(); y++) - { - modes.append("h"); - params.append(specific_halfop[y]->nick).append(" "); - } - } for (BanList::iterator b = c->bans.begin(); b != c->bans.end(); b++) { |