aboutsummaryrefslogtreecommitdiff
path: root/src/cmd_topic.cpp
diff options
context:
space:
mode:
authorGravatar brain2006-02-05 13:00:43 +0000
committerGravatar brain2006-02-05 13:00:43 +0000
commitfbd9fad27b8f03f6d36f097f944fffb0531bf2e2 (patch)
tree3a1a676a40bf75858c69b63941ce16066b8f9c26 /src/cmd_topic.cpp
parentFix to prevent use of aliases before reigstering connection (diff)
Fixes for (unlikely and theoretical) desync in TOPIC
Fix to not bother trying to write away response if user is not local git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3093 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_topic.cpp')
-rw-r--r--src/cmd_topic.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/cmd_topic.cpp b/src/cmd_topic.cpp
index 48f6b7b7e..96aadd8fd 100644
--- a/src/cmd_topic.cpp
+++ b/src/cmd_topic.cpp
@@ -102,15 +102,18 @@ void cmd_topic::Handle (char **parameters, int pcnt, userrec *user)
Ptr = FindChan(parameters[0]);
if (Ptr)
{
- if ((Ptr) && (!has_channel(user,Ptr)))
+ if (IS_LOCAL(user))
{
- WriteServ(user->fd,"442 %s %s :You're not on that channel!",user->nick, Ptr->name);
- return;
- }
- if ((Ptr->binarymodes & CM_TOPICLOCK) && (cstatus(user,Ptr)<STATUS_HOP))
- {
- WriteServ(user->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel", user->nick, Ptr->name);
- return;
+ if ((Ptr) && (!has_channel(user,Ptr)))
+ {
+ WriteServ(user->fd,"442 %s %s :You're not on that channel!",user->nick, Ptr->name);
+ return;
+ }
+ if ((Ptr->binarymodes & CM_TOPICLOCK) && (cstatus(user,Ptr)<STATUS_HOP))
+ {
+ WriteServ(user->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel", user->nick, Ptr->name);
+ return;
+ }
}
char topic[MAXBUF];
@@ -120,7 +123,7 @@ void cmd_topic::Handle (char **parameters, int pcnt, userrec *user)
topic[MAXTOPIC] = '\0';
}
- if (user->fd > -1)
+ if (IS_LOCAL(user))
{
int MOD_RESULT = 0;
FOREACH_RESULT(I_OnLocalTopicChange,OnLocalTopicChange(user,Ptr,topic));
@@ -132,7 +135,7 @@ void cmd_topic::Handle (char **parameters, int pcnt, userrec *user)
strlcpy(Ptr->setby,user->nick,NICKMAX);
Ptr->topicset = TIME;
WriteChannel(Ptr,user,"TOPIC %s :%s",Ptr->name, Ptr->topic);
- if (user->fd > -1)
+ if (IS_LOCAL(user))
{
FOREACH_MOD(I_OnPostLocalTopicChange,OnPostLocalTopicChange(user,Ptr,topic));
}