mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-19 03:52:52 +00:00
Remove Can_Send_To_Channel_Identified()
Move the functionality directly into Can_Send_To_Channel() function. There should be no functional change ...
This commit is contained in:
parent
1aaf54ac24
commit
fee591b759
@ -832,6 +832,10 @@ Can_Send_To_Channel(CHANNEL *Chan, CLIENT *From)
|
||||
if (strchr(Channel_Modes(Chan), 'n') && !is_member)
|
||||
return false;
|
||||
|
||||
if (strchr(Channel_Modes(Chan), 'M') && !Client_HasMode(From, 'R')
|
||||
&& !Client_HasMode(From, 'o'))
|
||||
return false;
|
||||
|
||||
if (is_op || has_voice)
|
||||
return true;
|
||||
|
||||
@ -845,22 +849,6 @@ Can_Send_To_Channel(CHANNEL *Chan, CLIENT *From)
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
Can_Send_To_Channel_Identified(CHANNEL *Chan, CLIENT *From)
|
||||
{
|
||||
if ((Client_ThisServer() == From) || Client_HasMode(From, 'o'))
|
||||
return true;
|
||||
|
||||
if (strchr(Channel_Modes(Chan), 'M') && !Client_HasMode(From, 'R'))
|
||||
return false;
|
||||
|
||||
if (Lists_Check(&Chan->list_excepts, From))
|
||||
return true;
|
||||
|
||||
return !Lists_Check(&Chan->list_bans, From);
|
||||
}
|
||||
|
||||
|
||||
GLOBAL bool
|
||||
Channel_Write(CHANNEL *Chan, CLIENT *From, CLIENT *Client, const char *Command,
|
||||
bool SendErrors, const char *Text)
|
||||
@ -872,13 +860,6 @@ Channel_Write(CHANNEL *Chan, CLIENT *From, CLIENT *Client, const char *Command,
|
||||
Client_ID(From), Channel_Name(Chan));
|
||||
}
|
||||
|
||||
if (!Can_Send_To_Channel_Identified(Chan, From)) {
|
||||
if (! SendErrors)
|
||||
return CONNECTED;
|
||||
return IRC_WriteStrClient(From, ERR_CANNOTSENDTOCHAN_MSG,
|
||||
Client_ID(From), Channel_Name(Chan));
|
||||
}
|
||||
|
||||
if (Client_Conn(From) > NONE)
|
||||
Conn_UpdateIdle(Client_Conn(From));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user