]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Move topic and NAMES sending on join from core into core_channel
authorAttila Molnar <attilamolnar@hush.com>
Sat, 16 May 2015 14:40:22 +0000 (16:40 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Sat, 16 May 2015 14:40:22 +0000 (16:40 +0200)
src/channels.cpp
src/coremods/core_channel/core_channel.cpp

index e06e4c6fcd3b085107ecad75aab6f9142f313eaf..adfb32c3e5963928f42c2fcd166b9915fb480c7e 100644 (file)
@@ -344,16 +344,6 @@ Membership* Channel::ForceJoin(User* user, const std::string* privs, bool bursti
                this->WriteAllExcept(user, !ServerInstance->Config->CycleHostsFromUser, 0, except_list, "MODE %s +%s", this->name.c_str(), ms.c_str());
        }
 
-       if (IS_LOCAL(user))
-       {
-               if (this->topicset)
-               {
-                       user->WriteNumeric(RPL_TOPIC, "%s :%s", this->name.c_str(), this->topic.c_str());
-                       user->WriteNumeric(RPL_TOPICTIME, "%s %s %lu", this->name.c_str(), this->setby.c_str(), (unsigned long)this->topicset);
-               }
-               this->UserList(user);
-       }
-
        FOREACH_MOD(OnPostJoin, (memb));
        return memb;
 }
index 47f722e1ea6f26e027a21fdc2eacc7a5711d084e..ac590ebcc6fe7f7298cc72a1ae2694b532ebbf76 100644 (file)
@@ -34,6 +34,23 @@ class CoreModChannel : public Module
        {
        }
 
+       void OnPostJoin(Membership* memb) CXX11_OVERRIDE
+       {
+               Channel* const chan = memb->chan;
+               LocalUser* const localuser = IS_LOCAL(memb->user);
+               if (localuser)
+               {
+                       if (chan->topicset)
+                               Topic::ShowTopic(localuser, chan);
+                       chan->UserList(localuser);
+               }
+       }
+
+       void Prioritize() CXX11_OVERRIDE
+       {
+               ServerInstance->Modules.SetPriority(this, I_OnPostJoin, PRIORITY_FIRST);
+       }
+
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Provides the INVITE, JOIN, KICK, NAMES, and TOPIC commands", VF_VENDOR|VF_CORE);