Fix everything I broke with the last three commits and make +G work for real.
This commit is contained in:
parent
12cbce8059
commit
99c780941a
|
@ -759,15 +759,10 @@ msg_client(int p_or_n, const char *command,
|
||||||
|
|
||||||
if(MyClient(target_p))
|
if(MyClient(target_p))
|
||||||
{
|
{
|
||||||
if (IsSetNoCTCP(target_p) && p_or_n != NOTICE && *text == '\001' && strncasecmp(text + 1, "ACTION", 6))
|
|
||||||
{
|
|
||||||
sendto_one_numeric(source_p, ERR_NOCTCP,
|
|
||||||
form_str(ERR_NOCTCP),
|
|
||||||
target_p->name);
|
|
||||||
}
|
|
||||||
/* XXX Controversial? allow opers always to send through a +g */
|
/* XXX Controversial? allow opers always to send through a +g */
|
||||||
else if(!IsServer(source_p) && (IsSetCallerId(target_p) ||
|
if(!IsServer(source_p) && (IsSetCallerId(target_p) ||
|
||||||
(IsSetSCallerId(target_p) || (IsSetRegOnlyMsg(target_p) && !source_p->user->suser[0]))))
|
(IsSetSCallerId(target_p) && !has_common_channel(source_p, target_p)) ||
|
||||||
|
(IsSetRegOnlyMsg(target_p) && !source_p->user->suser[0])))
|
||||||
{
|
{
|
||||||
/* Here is the anti-flood bot/spambot code -db */
|
/* Here is the anti-flood bot/spambot code -db */
|
||||||
if(accept_message(source_p, target_p) || IsOper(source_p))
|
if(accept_message(source_p, target_p) || IsOper(source_p))
|
||||||
|
@ -777,27 +772,23 @@ msg_client(int p_or_n, const char *command,
|
||||||
source_p->name,
|
source_p->name,
|
||||||
source_p->username,
|
source_p->username,
|
||||||
source_p->host, command, target_p->name, text);
|
source_p->host, command, target_p->name, text);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (!IsSetCallerId(target_p))
|
else if (IsSetRegOnlyMsg(target_p) && !source_p->user->suser[0])
|
||||||
{
|
|
||||||
if (IsSetRegOnlyMsg(target_p) && !source_p->user->suser[0])
|
|
||||||
{
|
{
|
||||||
if (p_or_n != NOTICE)
|
if (p_or_n != NOTICE)
|
||||||
sendto_one_numeric(source_p, ERR_NONONREG,
|
sendto_one_numeric(source_p, ERR_NONONREG,
|
||||||
form_str(ERR_NONONREG),
|
form_str(ERR_NONONREG),
|
||||||
target_p->name);
|
target_p->name);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (IsSetSCallerId(target_p)&& !has_common_channel(source_p, target_p))
|
else if (IsSetSCallerId(target_p) && !has_common_channel(source_p, target_p))
|
||||||
{
|
{
|
||||||
if (p_or_n != NOTICE)
|
if (p_or_n != NOTICE)
|
||||||
sendto_one_numeric(source_p, ERR_NOCOMMONCHAN,
|
sendto_one_numeric(source_p, ERR_NOCOMMONCHAN,
|
||||||
form_str(ERR_NOCOMMONCHAN),
|
form_str(ERR_NOCOMMONCHAN),
|
||||||
target_p->name);
|
target_p->name);
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/* check for accept, flag recipient incoming message */
|
/* check for accept, flag recipient incoming message */
|
||||||
if(p_or_n != NOTICE)
|
if(p_or_n != NOTICE)
|
||||||
{
|
{
|
||||||
|
@ -822,6 +813,7 @@ msg_client(int p_or_n, const char *command,
|
||||||
target_p->localClient->last_caller_id_time = rb_current_time();
|
target_p->localClient->last_caller_id_time = rb_current_time();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
add_reply_target(target_p, source_p);
|
add_reply_target(target_p, source_p);
|
||||||
|
|
|
@ -1127,7 +1127,7 @@ has_common_channel(struct Client *client1, struct Client *client2)
|
||||||
if(IsMember(client2, ((struct membership *)ptr->data)->chptr))
|
if(IsMember(client2, ((struct membership *)ptr->data)->chptr))
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* channel_modes()
|
/* channel_modes()
|
||||||
|
|
Loading…
Reference in New Issue