summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commands/cmd_list.cpp7
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp13
2 files changed, 11 insertions, 9 deletions
diff --git a/src/commands/cmd_list.cpp b/src/commands/cmd_list.cpp
index 0e97d0db1..d5ceef9e3 100644
--- a/src/commands/cmd_list.cpp
+++ b/src/commands/cmd_list.cpp
@@ -64,16 +64,13 @@ CmdResult CommandList::Handle (const char** parameters, int pcnt, User *user)
bool n = i->second->HasUser(user);
if ((i->second->IsModeSet('p')) && (!n))
{
- if (users)
- user->WriteServ("322 %s *",user->nick,i->second->name);
+ user->WriteServ("322 %s *",user->nick,i->second->name);
}
else
{
if (((!(i->second->IsModeSet('p'))) && (!(i->second->IsModeSet('s')))) || (n))
{
- long users = i->second->GetUserCounter();
- if (users)
- user->WriteServ("322 %s %s %d :[+%s] %s",user->nick,i->second->name,users,i->second->ChanModes(n),i->second->topic);
+ user->WriteServ("322 %s %s %d :[+%s] %s",user->nick,i->second->name,users,i->second->ChanModes(n),i->second->topic);
}
}
}
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();