summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2012-05-29 15:13:42 +0200
committerattilamolnar <attilamolnar@hush.com>2012-05-29 15:13:42 +0200
commit0409230be0aba22360ce23cab1d9d070fe15c838 (patch)
tree16b3a31435d3b12aff20c8256b75bbe6edc7d68c /src/channels.cpp
parent7ca4e7f0450b376902b4987190e06c2a719a89c4 (diff)
Silence the MODE too if a join was silenced by a module not just the JOIN
This leaked information when a module gave privs to the joining user in OnUserPreJoin Fix CycleHostsFromUser having the opposite effect
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 5539f4bfe..6419d3b9a 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))
{