]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_spanningtree Fix incoming channel modes being lost for 0-user permanent channels...
authorattilamolnar <attilamolnar@hush.com>
Wed, 13 Mar 2013 15:41:44 +0000 (16:41 +0100)
committerattilamolnar <attilamolnar@hush.com>
Wed, 20 Mar 2013 17:23:44 +0000 (18:23 +0100)
This did not affect listmodes

src/modules/m_spanningtree/fjoin.cpp

index 71d837b2840b4bf0b150029ac935fd12a484115e..c0475613afece31941cd93a2f9766bdc2d2ab5de 100644 (file)
@@ -106,6 +106,14 @@ CmdResult CommandFJoin::Handle(const std::vector<std::string>& params, User *src
                        chan->ClearInvites();
                        param_list.push_back(channel);
                        this->RemoveStatus(ServerInstance->FakeClient, param_list);
+
+                       // XXX: If the channel does not exist in the chan hash at this point, create it so the remote modes can be applied on it.
+                       // This happens to 0-user permanent channels on the losing side, because those are removed (from the chan hash, then
+                       // deleted later) as soon as the permchan mode is removed from them.
+                       if (ServerInstance->FindChan(channel) == NULL)
+                       {
+                               chan = new Channel(channel, TS);
+                       }
                }
                // The silent case here is ourTS == TS, we don't need to remove modes here, just to merge them later on.
        }