}
return;
}
- else if (parameters[0][0] == '#')
+ char status = 0;
+ if ((*parameters[0] == '@') || (*parameters[0] == '%') || (*parameters[0] == '+'))
+ {
+ status = *parameters[0];
+ parameters[0]++;
+ }
+ if (*parameters[0] == '#')
{
chan = FindChan(parameters[0]);
if (chan)
{
- if ((chan->binarymodes & CM_NOEXTERNAL) && (!has_channel(user,chan)))
- {
- WriteServ(user->fd,"404 %s %s :Cannot send to channel (no external messages)", user->nick, chan->name);
- return;
- }
- if ((chan->binarymodes & CM_MODERATED) && (cstatus(user,chan)<STATUS_VOICE))
+ if (IS_LOCAL(user))
{
- WriteServ(user->fd,"404 %s %s :Cannot send to channel (+m)", user->nick, chan->name);
- return;
+ if ((chan->binarymodes & CM_NOEXTERNAL) && (!has_channel(user,chan)))
+ {
+ WriteServ(user->fd,"404 %s %s :Cannot send to channel (no external messages)", user->nick, chan->name);
+ return;
+ }
+ if ((chan->binarymodes & CM_MODERATED) && (cstatus(user,chan)<STATUS_VOICE))
+ {
+ WriteServ(user->fd,"404 %s %s :Cannot send to channel (+m)", user->nick, chan->name);
+ return;
+ }
}
int MOD_RESULT = 0;
std::string temp = parameters[1];
- FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,chan,TYPE_CHANNEL,temp));
+ FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,chan,TYPE_CHANNEL,temp,status));
if (MOD_RESULT) {
return;
}
return;
}
- ChanExceptSender(chan, user, "NOTICE %s :%s", chan->name, parameters[1]);
+ ChanExceptSender(chan, user, status, "NOTICE %s :%s", chan->name, parameters[1]);
- FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,chan,TYPE_CHANNEL,parameters[1]));
+ FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,chan,TYPE_CHANNEL,parameters[1],status));
}
else
{
int MOD_RESULT = 0;
std::string temp = parameters[1];
- FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,dest,TYPE_USER,temp));
+ FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,dest,TYPE_USER,temp,0));
if (MOD_RESULT) {
return;
}
WriteTo(user, dest, "NOTICE %s :%s", dest->nick, parameters[1]);
}
- FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,dest,TYPE_USER,parameters[1]));
+ FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,dest,TYPE_USER,parameters[1],0));
}
else
{