summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-11 13:21:25 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-11 13:21:25 +0000
commit7dd3760b6cba0ddd607b85ab97db7f958336fbe1 (patch)
tree4fded34d5c43859f8adb149e545a5080e586313e /src/channels.cpp
parent021a03b160faa19b3e8a6af6953913d6db6fb5f2 (diff)
Only calculate the names list when a local user joins (this was being calculated for remote user joins, then thrown into the bit bucket)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3652 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 41759f2e2..819195871 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -447,16 +447,19 @@ chanrec* ForceChan(chanrec* Ptr,ucrec *a,userrec* user, int created)
a->channel = Ptr;
Ptr->AddUser(user);
WriteChannel(Ptr,user,"JOIN :%s",Ptr->name);
- log(DEBUG,"Sent JOIN to client");
- if (Ptr->topicset)
+ /* Major improvement by Brain - we dont need to be calculating all this pointlessly for remote users */
+ if (IS_LOCAL(user))
{
- WriteServ(user->fd,"332 %s %s :%s", user->nick, Ptr->name, Ptr->topic);
- WriteServ(user->fd,"333 %s %s %s %lu", user->nick, Ptr->name, Ptr->setby, (unsigned long)Ptr->topicset);
+ log(DEBUG,"Sent JOIN to client");
+ if (Ptr->topicset)
+ {
+ WriteServ(user->fd,"332 %s %s :%s", user->nick, Ptr->name, Ptr->topic);
+ WriteServ(user->fd,"333 %s %s %s %lu", user->nick, Ptr->name, Ptr->setby, (unsigned long)Ptr->topicset);
+ }
+ userlist(user,Ptr);
+ WriteServ(user->fd,"366 %s %s :End of /NAMES list.", user->nick, Ptr->name);
}
-
- userlist(user,Ptr);
- WriteServ(user->fd,"366 %s %s :End of /NAMES list.", user->nick, Ptr->name);
FOREACH_MOD(I_OnUserJoin,OnUserJoin(user,Ptr));
return Ptr;
}