diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:44:15 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:44:15 +0000 |
commit | 5abd3b1cc5fba26486d71c6a415fae797388ddf3 (patch) | |
tree | c863c777b37939059ce7b98f37aba82df7299f30 /src | |
parent | fbe8169b82cb071dd57b66941093df654aa7b22c (diff) |
Add "created" parameter to OnUserJoin, to avoid explicit checks for +P
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11597 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.cpp | 6 | ||||
-rw-r--r-- | src/modules.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_auditorium.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_chancreate.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_delayjoin.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_invisible.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_joinflood.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.h | 2 |
9 files changed, 14 insertions, 14 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index 0ff1298c1..6e0f4c686 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -405,10 +405,10 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool Ptr->SetDefaultModes(); } - return Channel::ForceChan(Instance, Ptr, user, privs, bursting); + return Channel::ForceChan(Instance, Ptr, user, privs, bursting, created_by_local); } -Channel* Channel::ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const std::string &privs, bool bursting) +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; @@ -448,7 +448,7 @@ Channel* Channel::ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const } } - FOREACH_MOD_I(Instance,I_OnUserJoin,OnUserJoin(user, Ptr, bursting, silent)); + FOREACH_MOD_I(Instance,I_OnUserJoin,OnUserJoin(user, Ptr, bursting, silent, created)); if (!silent) Ptr->WriteChannel(user,"JOIN :%s",Ptr->name.c_str()); diff --git a/src/modules.cpp b/src/modules.cpp index b05452cff..21db883c4 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -111,7 +111,7 @@ int Module::OnSendSnotice(char &snomask, std::string &type, const std::string & 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&) { } +void Module::OnUserJoin(User*, Channel*, bool, bool&, bool) { } void Module::OnPostJoin(User*, Channel*) { } void Module::OnUserPart(User*, Channel*, std::string&, bool&) { } void Module::OnPreRehash(User*, const std::string&) { } diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp index 19b37e245..8da062593 100644 --- a/src/modules/m_auditorium.cpp +++ b/src/modules/m_auditorium.cpp @@ -113,7 +113,7 @@ class ModuleAuditorium : public Module } } - virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent) + virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created) { if (channel->IsModeSet('u')) { diff --git a/src/modules/m_chancreate.cpp b/src/modules/m_chancreate.cpp index eb1491bb6..c37ffd690 100644 --- a/src/modules/m_chancreate.cpp +++ b/src/modules/m_chancreate.cpp @@ -40,9 +40,9 @@ class ModuleChanCreate : public Module } - virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent) + virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created) { - if (channel->GetUserCounter() == 1 && !channel->IsModeSet('P')) + 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()); diff --git a/src/modules/m_delayjoin.cpp b/src/modules/m_delayjoin.cpp index 11ce78aff..8b5e83e88 100644 --- a/src/modules/m_delayjoin.cpp +++ b/src/modules/m_delayjoin.cpp @@ -41,7 +41,7 @@ class ModuleDelayJoin : public Module virtual ~ModuleDelayJoin(); virtual Version GetVersion(); virtual void OnNamesListItem(User* issuer, User* user, Channel* channel, std::string &prefixes, std::string &nick); - virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent); + virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created); void CleanUser(User* user); bool OnHostCycle(User* user); void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent); @@ -100,7 +100,7 @@ void ModuleDelayJoin::OnNamesListItem(User* issuer, User* user, Channel* channel nick.clear(); } -void ModuleDelayJoin::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent) +void ModuleDelayJoin::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created) { if (channel->IsModeSet('D')) { diff --git a/src/modules/m_invisible.cpp b/src/modules/m_invisible.cpp index c54014c85..d471b44d9 100644 --- a/src/modules/m_invisible.cpp +++ b/src/modules/m_invisible.cpp @@ -156,7 +156,7 @@ class ModuleInvisible : public Module }; virtual Version GetVersion(); - virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent); + virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created); virtual void OnRehash(User* user); void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent); void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message); @@ -173,7 +173,7 @@ Version ModuleInvisible::GetVersion() return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); } -void ModuleInvisible::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent) +void ModuleInvisible::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created) { if (user->IsModeSet('Q')) { diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp index b3abeaf61..31d0b4e84 100644 --- a/src/modules/m_joinflood.cpp +++ b/src/modules/m_joinflood.cpp @@ -228,7 +228,7 @@ class ModuleJoinFlood : public Module return 0; } - virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent) + virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created) { joinfloodsettings *f; diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 2e92f8374..9f73aa0dd 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -579,7 +579,7 @@ void ModuleSpanningTree::OnBackgroundTimer(time_t curtime) DoConnectTimeout(curtime); } -void ModuleSpanningTree::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent) +void ModuleSpanningTree::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created) { // Only do this for local users if (IS_LOCAL(user)) diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 375d99b14..3d6e3375d 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -166,7 +166,7 @@ class ModuleSpanningTree : public Module 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); + virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created); virtual int OnChangeLocalUserHost(User* user, const std::string &newhost); virtual void OnChangeName(User* user, const std::string &gecos); virtual void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent); |