From ad3825303f9d3c82dd0cf03d7b10e9d1f75615a9 Mon Sep 17 00:00:00 2001 From: w00t Date: Thu, 22 Jan 2009 14:17:15 +0000 Subject: Small fix: don't set default modes when joining if usercount == 0, set if it was actually created locally - this is needed due to +P. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10976 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/channels.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/channels.cpp b/src/channels.cpp index 7a42bccbb..9ed0f8ee4 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -296,6 +296,7 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool strlcpy(cname, cn, Instance->Config->Limits.ChanMax); Ptr = Instance->FindChan(cname); + bool created_by_local = false; if (!Ptr) { @@ -310,6 +311,7 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool else { privs = "@"; + created_by_local = true; } if (IS_LOCAL(user) && override == false) @@ -412,9 +414,11 @@ Channel* Channel::JoinUser(InspIRCd* Instance, User *user, const char* cn, bool } } - /* As spotted by jilles, dont bother to set this on remote users */ - if (IS_LOCAL(user) && Ptr->GetUserCounter() == 0) + if (created_by_local) + { + /* As spotted by jilles, dont bother to set this on remote users */ Ptr->SetDefaultModes(); + } return Channel::ForceChan(Instance, Ptr, user, privs, bursting); } -- cgit v1.2.3