From 7dd3760b6cba0ddd607b85ab97db7f958336fbe1 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 11 Mar 2006 13:21:25 +0000 Subject: 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 --- src/channels.cpp | 17 ++++++++++------- src/svn-rev.sh | 2 +- 2 files changed, 11 insertions(+), 8 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; } diff --git a/src/svn-rev.sh b/src/svn-rev.sh index 4a44fddeb..972734b6c 100755 --- a/src/svn-rev.sh +++ b/src/svn-rev.sh @@ -1 +1 @@ -echo 3648 +echo 3651 -- cgit v1.2.3