Fix up +G and make it actually work.

This commit is contained in:
B.Greenham 2010-02-25 19:16:38 -05:00
parent c279d43b75
commit 12cbce8059
1 changed files with 18 additions and 15 deletions

View File

@ -767,7 +767,7 @@ msg_client(int p_or_n, const char *command,
}
/* XXX Controversial? allow opers always to send through a +g */
else if(!IsServer(source_p) && (IsSetCallerId(target_p) ||
(IsSetRegOnlyMsg(target_p) && !source_p->user->suser[0])))
(IsSetSCallerId(target_p) || (IsSetRegOnlyMsg(target_p) && !source_p->user->suser[0]))))
{
/* Here is the anti-flood bot/spambot code -db */
if(accept_message(source_p, target_p) || IsOper(source_p))
@ -779,6 +779,8 @@ msg_client(int p_or_n, const char *command,
source_p->host, command, target_p->name, text);
return;
}
if (!IsSetCallerId(target_p))
{
if (IsSetRegOnlyMsg(target_p) && !source_p->user->suser[0])
{
if (p_or_n != NOTICE)
@ -787,7 +789,7 @@ msg_client(int p_or_n, const char *command,
target_p->name);
return;
}
if (IsSetSCallerId(target_p) && !source_p->user->suser[0])
if (IsSetSCallerId(target_p)&& !has_common_channel(source_p, target_p))
{
if (p_or_n != NOTICE)
sendto_one_numeric(source_p, ERR_NOCOMMONCHAN,
@ -795,6 +797,7 @@ msg_client(int p_or_n, const char *command,
target_p->name);
return;
}
}
/* check for accept, flag recipient incoming message */
if(p_or_n != NOTICE)
{