summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Burchell <viroteck@viroteck.net>2012-05-30 02:43:15 -0700
committerRobin Burchell <viroteck@viroteck.net>2012-05-30 02:43:15 -0700
commitc5beed4a5f9e7f50c7a26429bff06ed1684238d4 (patch)
tree5542c00a4d92f40eaa6b8480e4852bd28e2d86ab
parent7ca4e7f0450b376902b4987190e06c2a719a89c4 (diff)
parent7d41ace956e2b35cb9fe89cb43865bb3ed38523e (diff)
Merge pull request #163 from attilamolnar/insp20+silentjoinfix
[2.0] Don't send a MODE on join when the join was silenced by a module
-rw-r--r--src/channels.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 5539f4bfe..51fa74064 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -400,11 +400,15 @@ Channel* Channel::ForceChan(Channel* Ptr, User* user, const std::string &privs,
Ptr->WriteAllExcept(user, false, 0, except_list, "JOIN :%s", Ptr->name.c_str());
/* Theyre not the first ones in here, make sure everyone else sees the modes we gave the user */
- std::string ms = memb->modes;
- for(unsigned int i=0; i < memb->modes.length(); i++)
- ms.append(" ").append(user->nick);
- if ((Ptr->GetUserCounter() > 1) && (ms.length()))
- Ptr->WriteAllExceptSender(user, ServerInstance->Config->CycleHostsFromUser, 0, "MODE %s +%s", Ptr->name.c_str(), ms.c_str());
+ if ((Ptr->GetUserCounter() > 1) && (!memb->modes.empty()))
+ {
+ std::string ms = memb->modes;
+ for(unsigned int i=0; i < memb->modes.length(); i++)
+ ms.append(" ").append(user->nick);
+
+ except_list.insert(user);
+ Ptr->WriteAllExcept(user, !ServerInstance->Config->CycleHostsFromUser, 0, except_list, "MODE %s +%s", Ptr->name.c_str(), ms.c_str());
+ }
if (IS_LOCAL(user))
{
@@ -655,7 +659,7 @@ void Channel::WriteAllExcept(User* user, bool serversource, char status, CUList
if (!text)
return;
- int offset = snprintf(textbuffer,MAXBUF,":%s ", user->GetFullHost().c_str());
+ int offset = snprintf(textbuffer,MAXBUF,":%s ", serversource ? ServerInstance->Config->ServerName.c_str() : user->GetFullHost().c_str());
va_start(argsPtr, text);
vsnprintf(textbuffer + offset, MAXBUF - offset, text, argsPtr);