*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
static CL2CHAN *Get_Cl2Chan PARAMS(( CHANNEL *Chan, CLIENT *Client ));
static CL2CHAN *Add_Client PARAMS(( CHANNEL *Chan, CLIENT *Client ));
static bool Remove_Client PARAMS(( int Type, CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, const char *Reason, bool InformServer ));
static CL2CHAN *Get_Cl2Chan PARAMS(( CHANNEL *Chan, CLIENT *Client ));
static CL2CHAN *Add_Client PARAMS(( CHANNEL *Chan, CLIENT *Client ));
static bool Remove_Client PARAMS(( int Type, CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, const char *Reason, bool InformServer ));
Client_ID(Client), Name);
return false;
}
/* Check that the client is in the channel */
if (!Get_Cl2Chan(chan, Client)) {
Client_ID(Client), Name);
return false;
}
/* Check that the client is in the channel */
if (!Get_Cl2Chan(chan, Client)) {
- if( ! chan )
- {
- IRC_WriteStrClient( Origin, ERR_NOSUCHCHANNEL_MSG, Client_ID( Origin ), Name );
+ if (!chan) {
+ IRC_WriteErrClient(Origin, ERR_NOSUCHCHANNEL_MSG,
+ Client_ID(Origin), Name);
Client_Type(Origin) != CLIENT_SERVICE) {
/* Check that user is on the specified channel */
if (!Channel_IsMemberOf(chan, Origin)) {
Client_Type(Origin) != CLIENT_SERVICE) {
/* Check that user is on the specified channel */
if (!Channel_IsMemberOf(chan, Origin)) {
- IRC_WriteStrClient( Origin, ERR_NOTONCHANNEL_MSG,
- Client_ID(Origin), Name);
+ IRC_WriteErrClient(Origin, ERR_NOTONCHANNEL_MSG,
+ Client_ID(Origin), Name);
return;
}
}
/* Check that the client to be kicked is on the specified channel */
if (!Channel_IsMemberOf(chan, Target)) {
return;
}
}
/* Check that the client to be kicked is on the specified channel */
if (!Channel_IsMemberOf(chan, Target)) {
|| Client_HasMode(Target, 'q')
|| Client_Type(Target) == CLIENT_SERVICE)
&& !Client_HasMode(Origin, 'o')) {
|| Client_HasMode(Target, 'q')
|| Client_Type(Target) == CLIENT_SERVICE)
&& !Client_HasMode(Origin, 'o')) {
!Channel_UserHasMode(chan, Target, 'q') &&
!Channel_UserHasMode(chan, Target, 'a'))
can_kick = true;
!Channel_UserHasMode(chan, Target, 'q') &&
!Channel_UserHasMode(chan, Target, 'a'))
can_kick = true;
else if (Channel_UserHasMode(chan, Peer, 'h') &&
!Channel_UserHasMode(chan, Target, 'q') &&
!Channel_UserHasMode(chan, Target, 'a') &&
!Channel_UserHasMode(chan, Target, 'o'))
can_kick = true;
else if (Channel_UserHasMode(chan, Peer, 'h') &&
!Channel_UserHasMode(chan, Target, 'q') &&
!Channel_UserHasMode(chan, Target, 'a') &&
!Channel_UserHasMode(chan, Target, 'o'))
can_kick = true;
- IRC_WriteStrClient(Origin, ERR_CHANOPPRIVTOOLOW_MSG,
- Client_ID(Origin), Name);
+ IRC_WriteErrClient(Origin, ERR_CHANOPPRIVTOOLOW_MSG,
+ Client_ID(Origin), Name);
if (! SendErrors)
return CONNECTED; /* no error, see RFC 2812 */
if (Channel_HasMode(Chan, 'M'))
if (! SendErrors)
return CONNECTED; /* no error, see RFC 2812 */
if (Channel_HasMode(Chan, 'M'))
Client_ID(From), Channel_Name(Chan));
}
if (Client_Conn(From) > NONE)
Conn_UpdateIdle(Client_Conn(From));
Client_ID(From), Channel_Name(Chan));
}
if (Client_Conn(From) > NONE)
Conn_UpdateIdle(Client_Conn(From));
- return IRC_WriteStrChannelPrefix(Client, Chan, From, true,
- "%s %s :%s", Command, Channel_Name(Chan), Text);
+ IRC_WriteStrChannelPrefix(Client, Chan, From, true, "%s %s :%s",
+ Command, Channel_Name(Chan), Text);
+ return CONNECTED;
{
struct list_head *h = Channel_GetListBans(c);
LogDebug("Adding \"%s\" to \"%s\" ban list", mask, Channel_Name(c));
{
struct list_head *h = Channel_GetListBans(c);
LogDebug("Adding \"%s\" to \"%s\" ban list", mask, Channel_Name(c));
- return Lists_Add(h, mask, false, NULL);
+ return Lists_Add(h, mask, time(NULL), who, false);
{
struct list_head *h = Channel_GetListExcepts(c);
LogDebug("Adding \"%s\" to \"%s\" exception list", mask, Channel_Name(c));
{
struct list_head *h = Channel_GetListExcepts(c);
LogDebug("Adding \"%s\" to \"%s\" exception list", mask, Channel_Name(c));
- return Lists_Add(h, mask, false, NULL);
+ return Lists_Add(h, mask, time(NULL), who, false);
-Channel_AddInvite(CHANNEL *c, const char *mask, bool onlyonce)
+Channel_AddInvite(CHANNEL *c, const char *mask, bool onlyonce, const char *who )
{
struct list_head *h = Channel_GetListInvites(c);
LogDebug("Adding \"%s\" to \"%s\" invite list", mask, Channel_Name(c));
{
struct list_head *h = Channel_GetListInvites(c);
LogDebug("Adding \"%s\" to \"%s\" invite list", mask, Channel_Name(c));
- return Lists_Add(h, mask, onlyonce, NULL);
+ return Lists_Add(h, mask, time(NULL), who, onlyonce);
while (e) {
if (!IRC_WriteStrClient(Client, msg, Client_ID(Client),
Channel_Name(Channel),
while (e) {
if (!IRC_WriteStrClient(Client, msg, Client_ID(Client),
Channel_Name(Channel),