diff options
-rw-r--r-- | include/channels.h | 2 | ||||
-rw-r--r-- | include/modules.h | 3 | ||||
-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 |
11 files changed, 17 insertions, 16 deletions
diff --git a/include/channels.h b/include/channels.h index 1b6e9a875..220c56cf9 100644 --- a/include/channels.h +++ b/include/channels.h @@ -111,7 +111,7 @@ class CoreExport Channel : public Extensible /** Connect a Channel to a User */ - static Channel* ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const std::string &privs, bool bursting); + static Channel* ForceChan(InspIRCd* Instance, Channel* Ptr, User* user, const std::string &privs, bool bursting, bool created); /** Set default modes for the channel on creation */ diff --git a/include/modules.h b/include/modules.h index 21e476089..47f495373 100644 --- a/include/modules.h +++ b/include/modules.h @@ -501,8 +501,9 @@ class CoreExport Module : public Extensible * of the channel (useful for modules such as auditorium) * @param sync This is set to true if the JOIN is the result of a network sync and the remote user is being introduced * to a channel due to the network sync. + * @param created This is true if the join created the channel */ - virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent); + virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created); /** Called after a user joins a channel * Identical to OnUserJoin, but called immediately afterwards, when any linking module has 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); |