From 860a3579257124d1d9cbc3081a2096726103e5d0 Mon Sep 17 00:00:00 2001 From: w00t Date: Sun, 6 Jan 2008 13:40:34 +0000 Subject: Basic core changes for permanent channels. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8649 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/treesocket1.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 78db02d8b..37a93084e 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -780,21 +780,23 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque &p * they wont as their timestamp will be too high :-) */ - if (params.size() < 3) + if (params.size() < 2) return true; irc::modestacker modestack(true); /* Modes to apply from the users in the user list */ User* who = NULL; /* User we are currently checking */ std::string channel = params[0]; /* Channel name, as a string */ time_t TS = atoi(params[1].c_str()); /* Timestamp given to us for remote side */ - irc::tokenstream users(params[2]); /* Users from the user list */ + irc::tokenstream users((params.size() > 2) ? params[2] : ""); /* users from the user list */ bool apply_other_sides_modes = true; /* True if we are accepting the other side's modes */ Channel* chan = this->Instance->FindChan(channel); /* The channel we're sending joins to */ time_t ourTS = chan ? chan->age : Instance->Time(true)+600; /* The TS of our side of the link */ bool created = !chan; /* True if the channel doesnt exist here yet */ std::string item; /* One item in the list of nicks */ - params[2] = ":" + params[2]; + if (params.size() > 2) + params[2] = ":" + params[2]; + Utils->DoOneToAllButSender(source,"FJOIN",params,source); if (!TS) @@ -804,6 +806,9 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque &p return true; } + if (created) + chan = new Channel(Instance, channel, ourTS); + /* If our TS is less than theirs, we dont accept their modes */ if (ourTS < TS) apply_other_sides_modes = false; @@ -1145,7 +1150,7 @@ void TreeSocket::SendFJoins(TreeServer* Current, Channel* c) size_t dlen, curlen; dlen = curlen = snprintf(list,MAXBUF,":%s FJOIN %s %lu",this->Instance->Config->GetSID().c_str(),c->name,(unsigned long)c->age); - int numusers = 0; + int numusers = 1; char* ptr = list + dlen; CUList *ulist = c->GetUsers(); -- cgit v1.2.3