summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp61
-rw-r--r--src/mode.cpp2
-rw-r--r--src/modules.cpp12
-rw-r--r--src/modules/m_auditorium.cpp80
-rw-r--r--src/modules/m_chancreate.cpp12
-rw-r--r--src/modules/m_delayjoin.cpp61
-rw-r--r--src/modules/m_delaymsg.cpp10
-rw-r--r--src/modules/m_invisible.cpp79
-rw-r--r--src/modules/m_joinflood.cpp6
-rw-r--r--src/modules/m_kicknorejoin.cpp10
-rw-r--r--src/modules/m_namesx.cpp4
-rw-r--r--src/modules/m_nopartmsg.cpp6
-rw-r--r--src/modules/m_operprefix.cpp13
-rw-r--r--src/modules/m_override.cpp8
-rw-r--r--src/modules/m_servprotect.cpp20
-rw-r--r--src/modules/m_spanningtree/main.cpp26
-rw-r--r--src/modules/m_spanningtree/main.h70
-rw-r--r--src/modules/m_uhnames.cpp6
18 files changed, 211 insertions, 275 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 2a0079bc1..37edcebfb 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -340,9 +340,8 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool
Channel* Channel::ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const std::string &privs, bool bursting, bool created)
{
std::string nick = user->nick;
- bool silent = false;
- Ptr->AddUser(user);
+ Membership* memb = Ptr->AddUser(user);
user->chans.insert(Ptr);
for (std::string::const_iterator x = privs.begin(); x != privs.end(); x++)
@@ -357,10 +356,10 @@ Channel* Channel::ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const
}
}
- FOREACH_MOD_I(Instance,I_OnUserJoin,OnUserJoin(user, Ptr, bursting, silent, created));
+ CUList except_list;
+ FOREACH_MOD_I(Instance,I_OnUserJoin,OnUserJoin(memb, bursting, created, except_list));
- if (!silent)
- Ptr->WriteChannel(user,"JOIN :%s",Ptr->name.c_str());
+ Ptr->WriteAllExcept(user, false, 0, except_list, "JOIN :%s", Ptr->name.c_str());
/* Theyre not the first ones in here, make sure everyone else sees the modes we gave the user */
std::string ms = Instance->Modes->ModeString(user, Ptr);
@@ -377,7 +376,7 @@ Channel* Channel::ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const
}
Ptr->UserList(user);
}
- FOREACH_MOD_I(Instance,I_OnPostJoin,OnPostJoin(user, Ptr));
+ FOREACH_MOD_I(Instance,I_OnPostJoin,OnPostJoin(memb));
return Ptr;
}
@@ -462,20 +461,19 @@ ModResult Channel::GetExtBanStatus(User *user, char type)
*/
long Channel::PartUser(User *user, std::string &reason)
{
- bool silent = false;
-
if (!user)
return this->GetUserCounter();
- UCListIter i = user->chans.find(this);
- if (i != user->chans.end())
+ Membership* memb = GetUser(user);
+
+ if (memb)
{
- FOREACH_MOD(I_OnUserPart,OnUserPart(user, this, reason, silent));
+ CUList except_list;
+ FOREACH_MOD(I_OnUserPart,OnUserPart(memb, reason, except_list));
- if (!silent)
- this->WriteChannel(user, "PART %s%s%s", this->name.c_str(), reason.empty() ? "" : " :", reason.c_str());
+ WriteAllExcept(user, false, 0, except_list, "PART %s%s%s", this->name.c_str(), reason.empty() ? "" : " :", reason.c_str());
- user->chans.erase(i);
+ user->chans.erase(this);
this->RemoveAllPrefixes(user);
}
@@ -509,14 +507,13 @@ long Channel::ServerKickUser(User* user, const char* reason, const char* servern
long Channel::KickUser(User *src, User *user, const char* reason)
{
- bool silent = false;
-
if (!src || !user || !reason)
return this->GetUserCounter();
+ Membership* memb = GetUser(user);
if (IS_LOCAL(src))
{
- if (!this->HasUser(user))
+ if (!memb)
{
src->WriteNumeric(ERR_USERNOTINCHANNEL, "%s %s %s :They are not on that channel",src->nick.c_str(), user->nick.c_str(), this->name.c_str());
return this->GetUserCounter();
@@ -531,7 +528,7 @@ long Channel::KickUser(User *src, User *user, const char* reason)
if (ServerInstance->ULine(src->server))
res = MOD_RES_ALLOW;
if (res == MOD_RES_PASSTHRU)
- FIRST_MOD_RESULT(ServerInstance, OnUserPreKick, res, (src,user,this,reason));
+ FIRST_MOD_RESULT(ServerInstance, OnUserPreKick, res, (src,memb,reason));
if (res == MOD_RES_PASSTHRU)
FIRST_MOD_RESULT(ServerInstance, OnAccessCheck, res, (src,user,this,AC_KICK));
@@ -550,16 +547,14 @@ long Channel::KickUser(User *src, User *user, const char* reason)
}
}
- FOREACH_MOD(I_OnUserKick,OnUserKick(src, user, this, reason, silent));
-
- UCListIter i = user->chans.find(this);
- if (i != user->chans.end())
+ if (memb)
{
- /* zap it from the channel list of the user */
- if (!silent)
- this->WriteChannel(src, "KICK %s %s :%s", this->name.c_str(), user->nick.c_str(), reason);
+ CUList except_list;
+ FOREACH_MOD(I_OnUserKick,OnUserKick(src, memb, reason, except_list));
+
+ WriteAllExcept(src, false, 0, except_list, "KICK %s %s :%s", name.c_str(), user->nick.c_str(), reason);
- user->chans.erase(i);
+ user->chans.erase(this);
this->RemoveAllPrefixes(user);
}
@@ -839,7 +834,7 @@ void Channel::UserList(User *user)
if (call_modules != MOD_RES_DENY)
{
- FOREACH_MOD(I_OnNamesListItem, OnNamesListItem(user, i->first, this, prefixlist, nick));
+ FOREACH_MOD(I_OnNamesListItem, OnNamesListItem(user, i->second, prefixlist, nick));
/* Nick was nuked, a module wants us to skip it */
if (nick.empty())
@@ -931,6 +926,18 @@ const char* Channel::GetPrefixChar(User *user)
return pf;
}
+unsigned int Membership::getRank()
+{
+ char mchar = modes.c_str()[0];
+ unsigned int rv = 0;
+ if (mchar)
+ {
+ ModeHandler* mh = chan->ServerInstance->Modes->FindMode(mchar, MODETYPE_CHANNEL);
+ if (mh)
+ rv = mh->GetPrefixRank();
+ }
+ return rv;
+}
const char* Channel::GetAllPrefixChars(User* user)
{
diff --git a/src/mode.cpp b/src/mode.cpp
index 703aa691c..c760df3f5 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -880,7 +880,7 @@ std::string ModeParser::BuildPrefixes()
}
}
- for(std::map<int,std::pair<char,char> >::iterator n = prefixes.begin(); n != prefixes.end(); n++)
+ for(std::map<int,std::pair<char,char> >::reverse_iterator n = prefixes.rbegin(); n != prefixes.rend(); n++)
{
mletters = mletters + n->second.first;
mprefixes = mprefixes + n->second.second;
diff --git a/src/modules.cpp b/src/modules.cpp
index 2d02bdf6d..4a8a13a48 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -111,9 +111,9 @@ ModResult Module::OnSendSnotice(char &snomask, std::string &type, const std::str
void Module::OnUserConnect(User*) { }
void Module::OnUserQuit(User*, const std::string&, const std::string&) { }
void Module::OnUserDisconnect(User*) { }
-void Module::OnUserJoin(User*, Channel*, bool, bool&, bool) { }
-void Module::OnPostJoin(User*, Channel*) { }
-void Module::OnUserPart(User*, Channel*, std::string&, bool&) { }
+void Module::OnUserJoin(Membership*, bool, bool, CUList&) { }
+void Module::OnPostJoin(Membership*) { }
+void Module::OnUserPart(Membership*, std::string&, CUList&) { }
void Module::OnPreRehash(User*, const std::string&) { }
void Module::OnModuleRehash(User*, const std::string&) { }
void Module::OnRehash(User*) { }
@@ -139,8 +139,8 @@ ModResult Module::OnPreCommand(std::string&, std::vector<std::string>&, User *,
void Module::OnPostCommand(const std::string&, const std::vector<std::string>&, User *, CmdResult, const std::string&) { }
ModResult Module::OnCheckReady(User*) { return MOD_RES_PASSTHRU; }
ModResult Module::OnUserRegister(User*) { return MOD_RES_PASSTHRU; }
-ModResult Module::OnUserPreKick(User*, User*, Channel*, const std::string&) { return MOD_RES_PASSTHRU; }
-void Module::OnUserKick(User*, User*, Channel*, const std::string&, bool&) { }
+ModResult Module::OnUserPreKick(User*, Membership*, const std::string&) { return MOD_RES_PASSTHRU; }
+void Module::OnUserKick(User*, Membership*, const std::string&, CUList&) { }
ModResult Module::OnRawMode(User*, Channel*, const char, const std::string &, bool, int) { return MOD_RES_PASSTHRU; }
ModResult Module::OnCheckInvite(User*, Channel*) { return MOD_RES_PASSTHRU; }
ModResult Module::OnCheckKey(User*, Channel*, const std::string&) { return MOD_RES_PASSTHRU; }
@@ -195,7 +195,7 @@ void Module::OnGarbageCollect() { }
void Module::OnBufferFlushed(User*) { }
void Module::OnText(User*, void*, int, const std::string&, char, CUList&) { }
void Module::OnRunTestSuite() { }
-void Module::OnNamesListItem(User*, User*, Channel*, std::string&, std::string&) { }
+void Module::OnNamesListItem(User*, Membership*, std::string&, std::string&) { }
ModResult Module::OnNumeric(User*, unsigned int, const std::string&) { return MOD_RES_PASSTHRU; }
void Module::OnHookIO(EventHandler*, ListenSocketBase*) { }
ModResult Module::OnHostCycle(User*) { return MOD_RES_PASSTHRU; }
diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp
index eb23f7dc8..35903a921 100644
--- a/src/modules/m_auditorium.cpp
+++ b/src/modules/m_auditorium.cpp
@@ -54,26 +54,26 @@ class ModuleAuditorium : public Module
}
- virtual ~ModuleAuditorium()
+ ~ModuleAuditorium()
{
ServerInstance->Modes->DelMode(&aum);
}
- virtual void OnRehash(User* user)
+ void OnRehash(User* user)
{
ConfigReader conf(ServerInstance);
ShowOps = conf.ReadFlag("auditorium", "showops", 0);
OperOverride = conf.ReadFlag("auditorium", "operoverride", 0);
}
- virtual Version GetVersion()
+ Version GetVersion()
{
return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
}
- virtual void OnNamesListItem(User* issuer, User* user, Channel* channel, std::string &prefixes, std::string &nick)
+ void OnNamesListItem(User* issuer, Membership* memb, std::string &prefixes, std::string &nick)
{
- if (!channel->IsModeSet('u'))
+ if (!memb->chan->IsModeSet('u'))
return;
/* Some module hid this from being displayed, dont bother */
@@ -84,14 +84,14 @@ class ModuleAuditorium : public Module
if (OperOverride && issuer->HasPrivPermission("channels/auspex"))
return;
- if (ShowOps && (issuer != user) && (channel->GetPrefixValue(user) < OP_VALUE))
+ if (ShowOps && (issuer != memb->user) && (memb->getRank() < OP_VALUE))
{
/* Showops is set, hide all non-ops from the user, except themselves */
nick.clear();
return;
}
- if (!ShowOps && (issuer != user))
+ if (!ShowOps && (issuer != memb->user))
{
/* ShowOps is not set, hide everyone except the user whos requesting NAMES */
nick.clear();
@@ -99,64 +99,40 @@ class ModuleAuditorium : public Module
}
}
- void WriteOverride(User* source, Channel* channel, const std::string &text)
+ void BuildExcept(Membership* memb, CUList& excepts)
{
- if (!OperOverride)
+ if (!memb->chan->IsModeSet('u'))
+ return;
+ if (ShowOps && memb->getRank() >= OP_VALUE)
return;
- const UserMembList *ulist = channel->GetUsers();
- for (UserMembCIter i = ulist->begin(); i != ulist->end(); i++)
+ const UserMembList* users = memb->chan->GetUsers();
+ for(UserMembCIter i = users->begin(); i != users->end(); i++)
{
- if (i->first->HasPrivPermission("channels/auspex") && source != i->first)
- if (!ShowOps || (ShowOps && channel->GetPrefixValue(i->first) < OP_VALUE))
- i->first->WriteFrom(source, "%s",text.c_str());
+ if (i->first == memb->user || !IS_LOCAL(i->first))
+ continue;
+ if (ShowOps && i->second->getRank() >= OP_VALUE)
+ continue;
+ if (OperOverride && i->first->HasPrivPermission("channels/auspex"))
+ continue;
+ // This is a different user in the channel, local, and not op/oper
+ // so, hide the join from them
+ excepts.insert(i->first);
}
}
-
- virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created)
+ void OnUserJoin(Membership* memb, bool sync, bool created, CUList& excepts)
{
- if (channel->IsModeSet('u'))
- {
- silent = true;
- /* Because we silenced the event, make sure it reaches the user whos joining (but only them of course) */
- user->WriteFrom(user, "JOIN %s", channel->name.c_str());
- if (ShowOps)
- channel->WriteAllExceptSender(user, false, channel->GetPrefixValue(user) >= OP_VALUE ? 0 : '@', "JOIN %s", channel->name.c_str());
- WriteOverride(user, channel, "JOIN "+channel->name);
- }
+ BuildExcept(memb, excepts);
}
- void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent)
+ void OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts)
{
- if (channel->IsModeSet('u'))
- {
- silent = true;
- /* Because we silenced the event, make sure it reaches the user whos leaving (but only them of course) */
- user->WriteFrom(user, "PART %s%s%s", channel->name.c_str(),
- partmessage.empty() ? "" : " :",
- partmessage.empty() ? "" : partmessage.c_str());
- if (ShowOps)
- {
- channel->WriteAllExceptSender(user, false, channel->GetPrefixValue(user) >= OP_VALUE ? 0 : '@', "PART %s%s%s", channel->name.c_str(), partmessage.empty() ? "" : " :",
- partmessage.empty() ? "" : partmessage.c_str());
- }
- WriteOverride(user, channel, "PART " + channel->name + (partmessage.empty() ? "" : (" :" + partmessage)));
- }
+ BuildExcept(memb, excepts);
}
- void OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent)
+ void OnUserKick(User* source, Membership* memb, const std::string &reason, CUList& excepts)
{
- if (chan->IsModeSet('u'))
- {
- silent = true;
- /* Send silenced event only to the user being kicked and the user doing the kick */
- source->WriteFrom(source, "KICK %s %s :%s", chan->name.c_str(), user->nick.c_str(), reason.c_str());
- if (ShowOps)
- chan->WriteAllExceptSender(source, false, chan->GetPrefixValue(user) >= OP_VALUE ? 0 : '@', "KICK %s %s %s", chan->name.c_str(), user->nick.c_str(), reason.c_str());
- if ((!ShowOps) || (chan->GetPrefixValue(user) < OP_VALUE)) /* make sure the target gets the event */
- user->WriteFrom(source, "KICK %s %s :%s", chan->name.c_str(), user->nick.c_str(), reason.c_str());
- WriteOverride(source, chan, "KICK " + chan->name + " " + user->nick + " :" + reason);
- }
+ BuildExcept(memb, excepts);
}
ModResult OnHostCycle(User* user)
diff --git a/src/modules/m_chancreate.cpp b/src/modules/m_chancreate.cpp
index c37ffd690..8acddcbf4 100644
--- a/src/modules/m_chancreate.cpp
+++ b/src/modules/m_chancreate.cpp
@@ -28,26 +28,24 @@ class ModuleChanCreate : public Module
ServerInstance->Modules->Attach(eventlist, this, 1);
}
- virtual ~ModuleChanCreate()
+ ~ModuleChanCreate()
{
ServerInstance->SNO->DisableSnomask('j');
ServerInstance->SNO->DisableSnomask('J');
}
- virtual Version GetVersion()
+ Version GetVersion()
{
return Version("$Id$",VF_VENDOR,API_VERSION);
}
- virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created)
+ void OnUserJoin(Membership* memb, bool sync, bool created, CUList& except)
{
if (created)
{
- if (IS_LOCAL(user))
- ServerInstance->SNO->WriteToSnoMask('j', "Channel %s created by %s!%s@%s", channel->name.c_str(), user->nick.c_str(), user->ident.c_str(), user->host.c_str());
- else
- ServerInstance->SNO->WriteToSnoMask('J', "Channel %s created by %s!%s@%s", channel->name.c_str(), user->nick.c_str(), user->ident.c_str(), user->host.c_str());
+ ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(memb->user) ? 'j' : 'J', "Channel %s created by %s!%s@%s",
+ memb->chan->name.c_str(), memb->user->nick.c_str(), memb->user->ident.c_str(), memb->user->host.c_str());
}
}
};
diff --git a/src/modules/m_delayjoin.cpp b/src/modules/m_delayjoin.cpp
index c894db124..f182e18d0 100644
--- a/src/modules/m_delayjoin.cpp
+++ b/src/modules/m_delayjoin.cpp
@@ -38,15 +38,14 @@ class ModuleDelayJoin : public Module
}
~ModuleDelayJoin();
Version GetVersion();
- void OnNamesListItem(User* issuer, User* user, Channel* channel, std::string &prefixes, std::string &nick);
- void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created);
+ void OnNamesListItem(User* issuer, Membership*, std::string &prefixes, std::string &nick);
+ void OnUserJoin(Membership*, bool, bool, CUList&);
void CleanUser(User* user);
ModResult OnHostCycle(User* user);
- void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent);
- void OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent);
+ void OnUserPart(Membership*, std::string &partmessage, CUList&);
+ void OnUserKick(User* source, Membership*, const std::string &reason, CUList&);
void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message);
void OnText(User* user, void* dest, int target_type, const std::string &text, char status, CUList &exempt_list);
- void WriteCommonFrom(User *user, Channel* channel, const char* text, ...) CUSTOM_PRINTF(4, 5);
};
/* $ModDesc: Allows for delay-join channels (+D) where users dont appear to join until they speak */
@@ -81,57 +80,47 @@ Version ModuleDelayJoin::GetVersion()
return Version("$Id$", VF_COMMON | VF_VENDOR);
}
-void ModuleDelayJoin::OnNamesListItem(User* issuer, User* user, Channel* channel, std::string &prefixes, std::string &nick)
+void ModuleDelayJoin::OnNamesListItem(User* issuer, Membership* memb, std::string &prefixes, std::string &nick)
{
- if (!channel->IsModeSet('D'))
- return;
-
- if (nick.empty())
- return;
-
/* don't prevent the user from seeing themself */
- if (issuer == user)
+ if (issuer == memb->user)
return;
- Membership* memb = channel->GetUser(user);
/* If the user is hidden by delayed join, hide them from the NAMES list */
- if (memb && unjoined.get(memb))
+ if (unjoined.get(memb))
nick.clear();
}
-void ModuleDelayJoin::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created)
+static void populate(CUList& except, Membership* memb)
{
- if (channel->IsModeSet('D'))
+ const UserMembList* users = memb->chan->GetUsers();
+ for(UserMembCIter i = users->begin(); i != users->end(); i++)
{
- silent = true;
- /* Because we silenced the event, make sure it reaches the user whos joining (but only them of course) */
- user->WriteFrom(user, "JOIN %s", channel->name.c_str());
-
- Membership* memb = channel->GetUser(user);
+ if (i->first == memb->user || !IS_LOCAL(i->first))
+ continue;
+ except.insert(i->first);
+ }
+}
+void ModuleDelayJoin::OnUserJoin(Membership* memb, bool sync, bool created, CUList& except)
+{
+ if (memb->chan->IsModeSet('D'))
+ {
unjoined.set(memb, 1);
+ populate(except, memb);
}
}
-void ModuleDelayJoin::OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent)
+void ModuleDelayJoin::OnUserPart(Membership* memb, std::string &partmessage, CUList& except)
{
- Membership* memb = channel->GetUser(user);
if (unjoined.set(memb, 0))
- {
- silent = true;
- /* Because we silenced the event, make sure it reaches the user whos leaving (but only them of course) */
- user->WriteFrom(user, "PART %s%s%s", channel->name.c_str(), partmessage.empty() ? "" : " :", partmessage.empty() ? "" : partmessage.c_str());
- }
+ populate(except, memb);
}
-void ModuleDelayJoin::OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent)
+void ModuleDelayJoin::OnUserKick(User* source, Membership* memb, const std::string &reason, CUList& except)
{
- Membership* memb = chan->GetUser(user);
if (unjoined.set(memb, 0))
- {
- silent = true;
- user->WriteFrom(source, "KICK %s %s %s", chan->name.c_str(), user->nick.c_str(), reason.c_str());
- }
+ populate(except, memb);
}
ModResult ModuleDelayJoin::OnHostCycle(User* user)
@@ -179,7 +168,7 @@ void ModuleDelayJoin::OnText(User* user, void* dest, int target_type, const std:
std::string n = this->ServerInstance->Modes->ModeString(user, channel);
if (n.length() > 0)
- this->WriteCommonFrom(user, channel, "MODE %s +%s", channel->name.c_str(), n.c_str());
+ channel->WriteAllExceptSender(user, false, 0, "MODE %s +%s", channel->name.c_str(), n.c_str());
}
MODULE_INIT(ModuleDelayJoin)
diff --git a/src/modules/m_delaymsg.cpp b/src/modules/m_delaymsg.cpp
index 5e2bb838c..3e9f2641c 100644
--- a/src/modules/m_delaymsg.cpp
+++ b/src/modules/m_delaymsg.cpp
@@ -60,10 +60,7 @@ class ModuleDelayMsg : public Module
}
~ModuleDelayMsg();
Version GetVersion();
- void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created);
- void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent);
- void OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent);
- void OnCleanup(int target_type, void* item);
+ void OnUserJoin(Membership* memb, bool sync, bool created, CUList&);
ModResult OnUserPreMessage(User* user, void* dest, int target_type, std::string &text, char status, CUList &exempt_list);
};
@@ -103,11 +100,10 @@ Version ModuleDelayMsg::GetVersion()
return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
}
-void ModuleDelayMsg::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created)
+void ModuleDelayMsg::OnUserJoin(Membership* memb, bool sync, bool created, CUList&)
{
- if (channel->IsModeSet('d'))
+ if (memb->chan->IsModeSet('d'))
{
- Membership* memb = channel->GetUser(user);
djm.jointime.set(memb, ServerInstance->Time());
}
}
diff --git a/src/modules/m_invisible.cpp b/src/modules/m_invisible.cpp
index 7da3f2934..cbdfcc600 100644
--- a/src/modules/m_invisible.cpp
+++ b/src/modules/m_invisible.cpp
@@ -16,8 +16,6 @@
/* $ModDesc: Allows for opered clients to join channels without being seen, similar to unreal 3.1 +I mode */
-static ConfigReader* conf;
-
class InvisibleMode : public ModeHandler
{
public:
@@ -109,7 +107,6 @@ class ModuleInvisible : public Module
ModuleInvisible(InspIRCd* Me)
: Module(Me), qm(Me, this), ido(Me)
{
- conf = new ConfigReader(ServerInstance);
if (!ServerInstance->Modes->AddMode(&qm))
throw ModuleException("Could not add new modes!");
if (!ServerInstance->Modes->AddModeWatcher(&ido))
@@ -119,61 +116,59 @@ class ModuleInvisible : public Module
ServerInstance->Users->ServerNoticeAll("*** m_invisible.so has just been loaded on this network. For more information, please visit http://inspircd.org/wiki/Modules/invisible");
Implementation eventlist[] = {
I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserJoin, I_OnUserPart, I_OnUserQuit,
- I_OnRehash, I_OnHostCycle, I_OnSendWhoLine
+ I_OnHostCycle, I_OnSendWhoLine, I_OnNamesListItem
};
ServerInstance->Modules->Attach(eventlist, this, 8);
};
- virtual ~ModuleInvisible()
+ ~ModuleInvisible()
{
ServerInstance->Modes->DelMode(&qm);
ServerInstance->Modes->DelModeWatcher(&ido);
- delete conf;
};
Version GetVersion();
- void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created);
- void OnRehash(User* user);
- void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent);
+ void OnUserJoin(Membership* memb, bool sync, bool created, CUList& excepts);
+ void OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts);
void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message);
ModResult OnHostCycle(User* user);
ModResult OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list);
ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list);
- void WriteCommonFrom(User *user, Channel* channel, const char* text, ...) CUSTOM_PRINTF(4, 5);
void OnSendWhoLine(User* source, User* user, Channel* channel, std::string& line);
+ void OnNamesListItem(User* issuer, Membership* memb, std::string &prefixes, std::string &nick);
};
Version ModuleInvisible::GetVersion()
{
- return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
+ return Version("Allows opers to join channels invisibly", VF_COMMON | VF_VENDOR);
}
-void ModuleInvisible::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created)
+static void BuildExcept(Membership* memb, CUList& excepts)
{
- if (user->IsModeSet('Q'))
+ const UserMembList* users = memb->chan->GetUsers();
+ for(UserMembCIter i = users->begin(); i != users->end(); i++)
{
- silent = true;
- /* Because we silenced the event, make sure it reaches the user whos joining (but only them of course) */
- this->WriteCommonFrom(user, channel, "JOIN %s", channel->name.c_str());
- ServerInstance->SNO->WriteToSnoMask('a', "\2NOTICE\2: Oper %s has joined %s invisibly (+Q)", user->GetFullHost().c_str(), channel->name.c_str());
+ // hide from all local non-opers
+ if (IS_LOCAL(i->first) && !IS_OPER(i->first))
+ excepts.insert(i->first);
}
}
-void ModuleInvisible::OnRehash(User* user)
+void ModuleInvisible::OnUserJoin(Membership* memb, bool sync, bool created, CUList& excepts)
{
- delete conf;
- conf = new ConfigReader(ServerInstance);
+ if (memb->user->IsModeSet('Q'))
+ {
+ BuildExcept(memb, excepts);
+ ServerInstance->SNO->WriteToSnoMask('a', "\2NOTICE\2: Oper %s has joined %s invisibly (+Q)",
+ memb->user->GetFullHost().c_str(), memb->chan->name.c_str());
+ }
}
-void ModuleInvisible::OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent)
+void ModuleInvisible::OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts)
{
- if (user->IsModeSet('Q'))
+ if (memb->user->IsModeSet('Q'))
{
- silent = true;
- /* Because we silenced the event, make sure it reaches the user whos leaving (but only them of course) */
- this->WriteCommonFrom(user, channel, "PART %s%s%s", channel->name.c_str(),
- partmessage.empty() ? "" : " :",
- partmessage.empty() ? "" : partmessage.c_str());
+ BuildExcept(memb, excepts);
}
}
@@ -224,34 +219,16 @@ ModResult ModuleInvisible::OnUserPreMessage(User* user,void* dest,int target_typ
return OnUserPreNotice(user, dest, target_type, text, status, exempt_list);
}
-/* Fix by Eric @ neowin.net, thanks :) -- Brain */
-void ModuleInvisible::WriteCommonFrom(User *user, Channel* channel, const char* text, ...)
-{
- va_list argsPtr;
- char textbuffer[MAXBUF];
- char tb[MAXBUF];
-
- va_start(argsPtr, text);
- vsnprintf(textbuffer, MAXBUF, text, argsPtr);
- va_end(argsPtr);
- snprintf(tb,MAXBUF,":%s %s",user->GetFullHost().c_str(), textbuffer);
-
- const UserMembList *ulist = channel->GetUsers();
-
- for (UserMembCIter i = ulist->begin(); i != ulist->end(); i++)
- {
- /* User only appears to vanish for non-opers */
- if (IS_LOCAL(i->first) && IS_OPER(i->first))
- {
- i->first->Write(std::string(tb));
- }
- }
-}
-
void ModuleInvisible::OnSendWhoLine(User* source, User* user, Channel* channel, std::string& line)
{
if (user->IsModeSet('Q') && !IS_OPER(source))
line.clear();
}
+void ModuleInvisible::OnNamesListItem(User* issuer, Membership* memb, std::string &prefixes, std::string &nick)
+{
+ if (memb->user->IsModeSet('Q') && !IS_OPER(issuer))
+ nick.clear();
+}
+
MODULE_INIT(ModuleInvisible)
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp
index 853ddee75..fd2957db1 100644
--- a/src/modules/m_joinflood.cpp
+++ b/src/modules/m_joinflood.cpp
@@ -221,13 +221,13 @@ class ModuleJoinFlood : public Module
return MOD_RES_PASSTHRU;
}
- void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created)
+ void OnUserJoin(Membership* memb, bool sync, bool created, CUList& excepts)
{
/* We arent interested in JOIN events caused by a network burst */
if (sync)
return;
- joinfloodsettings *f = jf.ext.get(channel);
+ joinfloodsettings *f = jf.ext.get(memb->chan);
/* But all others are OK */
if (f)
@@ -237,7 +237,7 @@ class ModuleJoinFlood : public Module
{
f->clear();
f->lock();
- channel->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :This channel has been closed to new users for 60 seconds because there have been more than %d joins in %d seconds.", channel->name.c_str(), f->joins, f->secs);
+ memb->chan->WriteChannelWithServ((char*)ServerInstance->Config->ServerName, "NOTICE %s :This channel has been closed to new users for 60 seconds because there have been more than %d joins in %d seconds.", memb->chan->name.c_str(), f->joins, f->secs);
}
}
}
diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp
index 47dec1803..c151cb4e4 100644
--- a/src/modules/m_kicknorejoin.cpp
+++ b/src/modules/m_kicknorejoin.cpp
@@ -150,17 +150,17 @@ public:
return MOD_RES_PASSTHRU;
}
- void OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent)
+ void OnUserKick(User* source, Membership* memb, const std::string &reason, CUList& excepts)
{
- if (chan->IsModeSet('J') && (source != user))
+ if (memb->chan->IsModeSet('J') && (source != memb->user))
{
- delaylist* dl = kr.ext.get(chan);
+ delaylist* dl = kr.ext.get(memb->chan);
if (dl)
{
dl = new delaylist;
- kr.ext.set(chan, dl);
+ kr.ext.set(memb->chan, dl);
}
- (*dl)[user] = ServerInstance->Time() + strtoint(chan->GetModeParameter('J'));
+ (*dl)[memb->user] = ServerInstance->Time() + strtoint(memb->chan->GetModeParameter('J'));
}
}
diff --git a/src/modules/m_namesx.cpp b/src/modules/m_namesx.cpp
index d0970ef9c..8c9c4e0c4 100644
--- a/src/modules/m_namesx.cpp
+++ b/src/modules/m_namesx.cpp
@@ -60,7 +60,7 @@ class ModuleNamesX : public Module
return MOD_RES_PASSTHRU;
}
- void OnNamesListItem(User* issuer, User* user, Channel* channel, std::string &prefixes, std::string &nick)
+ void OnNamesListItem(User* issuer, Membership* memb, std::string &prefixes, std::string &nick)
{
if (!cap.ext.get(issuer))
return;
@@ -69,7 +69,7 @@ class ModuleNamesX : public Module
if (nick.empty())
return;
- prefixes = channel->GetAllPrefixChars(user);
+ prefixes = memb->chan->GetAllPrefixChars(memb->user);
}
void OnEvent(Event *ev)
diff --git a/src/modules/m_nopartmsg.cpp b/src/modules/m_nopartmsg.cpp
index 931603907..1ea275167 100644
--- a/src/modules/m_nopartmsg.cpp
+++ b/src/modules/m_nopartmsg.cpp
@@ -35,12 +35,12 @@ class ModulePartMsgBan : public Module
}
- virtual void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent)
+ virtual void OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts)
{
- if (!IS_LOCAL(user))
+ if (!IS_LOCAL(memb->user))
return;
- if (channel->GetExtBanStatus(user, 'p') == MOD_RES_DENY)
+ if (memb->chan->GetExtBanStatus(memb->user, 'p') == MOD_RES_DENY)
partmessage = "";
return;
diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp
index e7a772432..f3137fc24 100644
--- a/src/modules/m_operprefix.cpp
+++ b/src/modules/m_operprefix.cpp
@@ -95,17 +95,10 @@ class ModuleOperPrefixMode : public Module
ServerInstance->SendMode(modechange,this->ServerInstance->FakeClient);
}
- void OnPostJoin(User *user, Channel *channel)
+ void OnPostJoin(Membership* memb)
{
- if (user && IS_OPER(user))
- {
- if (user->IsModeSet('H'))
- {
- /* we respect your wish to be invisible */
- return;
- }
- PushChanMode(channel, user);
- }
+ if (IS_OPER(memb->user) && !memb->user->IsModeSet('H'))
+ PushChanMode(memb->chan, memb->user);
}
// XXX: is there a better way to do this?
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp
index 0a445eff7..38864f400 100644
--- a/src/modules/m_override.cpp
+++ b/src/modules/m_override.cpp
@@ -132,16 +132,16 @@ class ModuleOverride : public Module
return MOD_RES_PASSTHRU;
}
- virtual ModResult OnUserPreKick(User* source, User* user, Channel* chan, const std::string &reason)
+ ModResult OnUserPreKick(User* source, Membership* memb, const std::string &reason)
{
if (IS_OPER(source) && CanOverride(source,"KICK"))
{
// If the kicker's status is less than the target's, or the kicker's status is less than or equal to voice
- if ((chan->GetPrefixValue(source) < chan->GetPrefixValue(user)) || (chan->GetPrefixValue(source) <= VOICE_VALUE))
+ if ((memb->chan->GetPrefixValue(source) < memb->getRank()) || (memb->chan->GetPrefixValue(source) <= VOICE_VALUE))
{
- ServerInstance->SNO->WriteGlobalSno('G',std::string(source->nick)+" used oper override to kick "+std::string(user->nick)+" on "+std::string(chan->name)+" ("+reason+")");
+ ServerInstance->SNO->WriteGlobalSno('G',std::string(source->nick)+" used oper override to kick "+std::string(memb->user->nick)+" on "+std::string(memb->chan->name)+" ("+reason+")");
+ return MOD_RES_ALLOW;
}
- return MOD_RES_ALLOW;
}
return MOD_RES_PASSTHRU;
}
diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp
index 4bc0cca4e..7ef77c089 100644
--- a/src/modules/m_servprotect.cpp
+++ b/src/modules/m_servprotect.cpp
@@ -40,7 +40,6 @@ class ServProtectMode : public ModeHandler
class ModuleServProtectMode : public Module
{
-
ServProtectMode bm;
public:
ModuleServProtectMode(InspIRCd* Me)
@@ -53,17 +52,17 @@ class ModuleServProtectMode : public Module
}
- virtual ~ModuleServProtectMode()
+ ~ModuleServProtectMode()
{
ServerInstance->Modes->DelMode(&bm);
}
- virtual Version GetVersion()
+ Version GetVersion()
{
return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
}
- virtual void OnWhois(User* src, User* dst)
+ void OnWhois(User* src, User* dst)
{
if (dst->IsModeSet('k'))
{
@@ -71,7 +70,7 @@ class ModuleServProtectMode : public Module
}
}
- virtual ModResult OnRawMode(User* user, Channel* chan, const char mode, const std::string &param, bool adding, int pcnt)
+ ModResult OnRawMode(User* user, Channel* chan, const char mode, const std::string &param, bool adding, int pcnt)
{
/* Check that the mode is not a server mode, it is being removed, the user making the change is local, there is a parameter,
* and the user making the change is not a uline
@@ -99,7 +98,7 @@ class ModuleServProtectMode : public Module
return MOD_RES_PASSTHRU;
}
- virtual ModResult OnKill(User* src, User* dst, const std::string &reason)
+ ModResult OnKill(User* src, User* dst, const std::string &reason)
{
if (src == NULL)
return MOD_RES_PASSTHRU;
@@ -113,18 +112,19 @@ class ModuleServProtectMode : public Module
return MOD_RES_PASSTHRU;
}
- virtual ModResult OnUserPreKick(User *src, User *dst, Channel *c, const std::string &reason)
+ ModResult OnUserPreKick(User *src, Membership* memb, const std::string &reason)
{
- if (dst->IsModeSet('k'))
+ if (memb->user->IsModeSet('k'))
{
- src->WriteNumeric(484, "%s %s :You are not permitted to kick services", src->nick.c_str(), c->name.c_str());
+ src->WriteNumeric(484, "%s %s :You are not permitted to kick services",
+ src->nick.c_str(), memb->chan->name.c_str());
return MOD_RES_DENY;
}
return MOD_RES_PASSTHRU;
}
- virtual ModResult OnWhoisLine(User* src, User* dst, int &numeric, std::string &text)
+ ModResult OnWhoisLine(User* src, User* dst, int &numeric, std::string &text)
{
return ((src != dst) && (numeric == 319) && dst->IsModeSet('k')) ? MOD_RES_DENY : MOD_RES_PASSTHRU;
}
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 5e30ced35..2549461f1 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -600,19 +600,19 @@ void ModuleSpanningTree::OnUserConnect(User* user)
Utils->TreeRoot->SetUserCount(1); // increment by 1
}
-void ModuleSpanningTree::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created)
+void ModuleSpanningTree::OnUserJoin(Membership* memb, bool sync, bool created, CUList& excepts)
{
// Only do this for local users
- if (IS_LOCAL(user))
+ if (IS_LOCAL(memb->user))
{
parameterlist params;
// set up their permissions and the channel TS with FJOIN.
// All users are FJOINed now, because a module may specify
// new joining permissions for the user.
- params.push_back(channel->name);
- params.push_back(ConvToStr(channel->age));
- params.push_back(std::string("+") + channel->ChanModes(true));
- params.push_back(ServerInstance->Modes->ModeString(user, channel, false)+","+std::string(user->uuid));
+ params.push_back(memb->chan->name);
+ params.push_back(ConvToStr(memb->chan->age));
+ params.push_back(std::string("+") + memb->chan->ChanModes(true));
+ params.push_back(memb->modes+","+std::string(memb->user->uuid));
Utils->DoOneToMany(ServerInstance->Config->GetSID(),"FJOIN",params);
}
}
@@ -650,15 +650,15 @@ void ModuleSpanningTree::OnChangeIdent(User* user, const std::string &ident)
Utils->DoOneToMany(user->uuid,"FIDENT",params);
}
-void ModuleSpanningTree::OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent)
+void ModuleSpanningTree::OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts)
{
- if (IS_LOCAL(user))
+ if (IS_LOCAL(memb->user))
{
parameterlist params;
- params.push_back(channel->name);
+ params.push_back(memb->chan->name);
if (!partmessage.empty())
params.push_back(":"+partmessage);
- Utils->DoOneToMany(user->uuid,"PART",params);
+ Utils->DoOneToMany(memb->user->uuid,"PART",params);
}
}
@@ -710,11 +710,11 @@ void ModuleSpanningTree::OnUserPostNick(User* user, const std::string &oldnick)
}
}
-void ModuleSpanningTree::OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent)
+void ModuleSpanningTree::OnUserKick(User* source, Membership* memb, const std::string &reason, CUList& excepts)
{
parameterlist params;
- params.push_back(chan->name);
- params.push_back(user->uuid);
+ params.push_back(memb->chan->name);
+ params.push_back(memb->user->uuid);
params.push_back(":"+reason);
if (IS_LOCAL(source))
{
diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h
index 04f281b28..1d3ec9d39 100644
--- a/src/modules/m_spanningtree/main.h
+++ b/src/modules/m_spanningtree/main.h
@@ -157,42 +157,42 @@ class ModuleSpanningTree : public Module
** *** MODULE EVENTS ***
**/
- virtual ModResult OnPreCommand(std::string &command, std::vector<std::string>& parameters, User *user, bool validated, const std::string &original_line);
- virtual void OnPostCommand(const std::string &command, const std::vector<std::string>& parameters, User *user, CmdResult result, const std::string &original_line);
- virtual void OnGetServerDescription(const std::string &servername,std::string &description);
- virtual void OnUserConnect(User* source);
- virtual void OnUserInvite(User* source,User* dest,Channel* channel, time_t);
- virtual void OnPostTopicChange(User* user, Channel* chan, const std::string &topic);
- virtual void OnWallops(User* user, const std::string &text);
- virtual void OnUserNotice(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list);
- virtual void OnUserMessage(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list);
- virtual void OnBackgroundTimer(time_t curtime);
- virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created);
- virtual ModResult OnChangeLocalUserHost(User* user, const std::string &newhost);
- virtual void OnChangeName(User* user, const std::string &gecos);
- virtual void OnChangeIdent(User* user, const std::string &ident);
- virtual void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent);
- virtual void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message);
- virtual void OnUserPostNick(User* user, const std::string &oldnick);
- virtual void OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent);
- virtual void OnRemoteKill(User* source, User* dest, const std::string &reason, const std::string &operreason);
- virtual void OnPreRehash(User* user, const std::string &parameter);
- virtual void OnRehash(User* user);
- virtual void OnOper(User* user, const std::string &opertype);
+ ModResult OnPreCommand(std::string &command, std::vector<std::string>& parameters, User *user, bool validated, const std::string &original_line);
+ void OnPostCommand(const std::string &command, const std::vector<std::string>& parameters, User *user, CmdResult result, const std::string &original_line);
+ void OnGetServerDescription(const std::string &servername,std::string &description);
+ void OnUserConnect(User* source);
+ void OnUserInvite(User* source,User* dest,Channel* channel, time_t);
+ void OnPostTopicChange(User* user, Channel* chan, const std::string &topic);
+ void OnWallops(User* user, const std::string &text);
+ void OnUserNotice(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list);
+ void OnUserMessage(User* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list);
+ void OnBackgroundTimer(time_t curtime);
+ void OnUserJoin(Membership* memb, bool sync, bool created, CUList& excepts);
+ ModResult OnChangeLocalUserHost(User* user, const std::string &newhost);
+ void OnChangeName(User* user, const std::string &gecos);
+ void OnChangeIdent(User* user, const std::string &ident);
+ void OnUserPart(Membership* memb, std::string &partmessage, CUList& excepts);
+ void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message);
+ void OnUserPostNick(User* user, const std::string &oldnick);
+ void OnUserKick(User* source, Membership* memb, const std::string &reason, CUList& excepts);
+ void OnRemoteKill(User* source, User* dest, const std::string &reason, const std::string &operreason);
+ void OnPreRehash(User* user, const std::string &parameter);
+ void OnRehash(User* user);
+ void OnOper(User* user, const std::string &opertype);
void OnLine(User* source, const std::string &host, bool adding, char linetype, long duration, const std::string &reason);
- virtual void OnAddLine(User *u, XLine *x);
- virtual void OnDelLine(User *u, XLine *x);
- virtual void OnMode(User* user, void* dest, int target_type, const std::vector<std::string> &text, const std::vector<TranslateType> &translate);
- virtual ModResult OnStats(char statschar, User* user, string_list &results);
- virtual ModResult OnSetAway(User* user, const std::string &awaymsg);
- virtual void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::vector<std::string> &modeline, const std::vector<TranslateType> &translate);
- virtual void ProtoSendMetaData(void* opaque, Extensible* target, const std::string &extname, const std::string &extdata);
- virtual std::string ProtoTranslate(Extensible* item);
- virtual void OnEvent(Event* event);
- virtual void OnLoadModule(Module* mod,const std::string &name);
- virtual void OnUnloadModule(Module* mod,const std::string &name);
- virtual ~ModuleSpanningTree();
- virtual Version GetVersion();
+ void OnAddLine(User *u, XLine *x);
+ void OnDelLine(User *u, XLine *x);
+ void OnMode(User* user, void* dest, int target_type, const std::vector<std::string> &text, const std::vector<TranslateType> &translate);
+ ModResult OnStats(char statschar, User* user, string_list &results);
+ ModResult OnSetAway(User* user, const std::string &awaymsg);
+ void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::vector<std::string> &modeline, const std::vector<TranslateType> &translate);
+ void ProtoSendMetaData(void* opaque, Extensible* target, const std::string &extname, const std::string &extdata);
+ std::string ProtoTranslate(Extensible* item);
+ void OnEvent(Event* event);
+ void OnLoadModule(Module* mod,const std::string &name);
+ void OnUnloadModule(Module* mod,const std::string &name);
+ ~ModuleSpanningTree();
+ Version GetVersion();
void Prioritize();
};
diff --git a/src/modules/m_uhnames.cpp b/src/modules/m_uhnames.cpp
index af8f0690f..126c41038 100644
--- a/src/modules/m_uhnames.cpp
+++ b/src/modules/m_uhnames.cpp
@@ -24,7 +24,7 @@ class ModuleUHNames : public Module
ModuleUHNames(InspIRCd* Me) : Module(Me), cap(this, "userhost-in-names")
{
Implementation eventlist[] = { I_OnEvent, I_OnPreCommand, I_OnNamesListItem, I_On005Numeric };
- ServerInstance->Modules->Attach(eventlist, this, 5);
+ ServerInstance->Modules->Attach(eventlist, this, 4);
}
~ModuleUHNames()
@@ -60,7 +60,7 @@ class ModuleUHNames : public Module
return MOD_RES_PASSTHRU;
}
- void OnNamesListItem(User* issuer, User* user, Channel* channel, std::string &prefixes, std::string &nick)
+ void OnNamesListItem(User* issuer, Membership* memb, std::string &prefixes, std::string &nick)
{
if (!cap.ext.get(issuer))
return;
@@ -68,7 +68,7 @@ class ModuleUHNames : public Module
if (nick.empty())
return;
- nick = user->GetFullHost();
+ nick = memb->user->GetFullHost();
}
void OnEvent(Event* ev)