diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-01-06 13:40:34 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-01-06 13:40:34 +0000 |
commit | 860a3579257124d1d9cbc3081a2096726103e5d0 (patch) | |
tree | 665affab7d8af8e1ad0e333ffad2be4417dc53a2 /src/modules/m_spanningtree | |
parent | c916c63445ab46b060d783181bf41e8b94e8ae27 (diff) |
Basic core changes for permanent channels.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8649 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
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<std::string> &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<std::string> &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(); |