mirror of
https://github.com/osmarks/ngircd.git
synced 2025-05-23 09:34:09 +00:00
irc-op.c: use irc-macros.h
This commit is contained in:
parent
a53de63ba7
commit
3228f1b267
@ -24,6 +24,7 @@
|
|||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
#include "conn.h"
|
#include "conn.h"
|
||||||
#include "channel.h"
|
#include "channel.h"
|
||||||
|
#include "irc-macros.h"
|
||||||
#include "irc-write.h"
|
#include "irc-write.h"
|
||||||
#include "lists.h"
|
#include "lists.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
@ -69,9 +70,8 @@ IRC_KICK(CLIENT *Client, REQUEST *Req)
|
|||||||
assert( Client != NULL );
|
assert( Client != NULL );
|
||||||
assert( Req != NULL );
|
assert( Req != NULL );
|
||||||
|
|
||||||
if ((Req->argc < 2) || (Req->argc > 3))
|
_IRC_ARGC_BETWEEN_OR_RETURN_(Client, Req, 2, 3)
|
||||||
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
|
||||||
Client_ID(Client), Req->command);
|
|
||||||
|
|
||||||
while (*itemList) {
|
while (*itemList) {
|
||||||
if (*itemList == ',') {
|
if (*itemList == ',') {
|
||||||
@ -90,15 +90,6 @@ IRC_KICK(CLIENT *Client, REQUEST *Req)
|
|||||||
itemList++;
|
itemList++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Client_Type(Client) == CLIENT_SERVER)
|
|
||||||
from = Client_Search(Req->prefix);
|
|
||||||
else
|
|
||||||
from = Client;
|
|
||||||
|
|
||||||
if (!from)
|
|
||||||
return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
|
|
||||||
Client_ID(Client), Req->prefix);
|
|
||||||
|
|
||||||
reason = Req->argc == 3 ? Req->argv[2] : Client_ID(from);
|
reason = Req->argc == 3 ? Req->argv[2] : Client_ID(from);
|
||||||
currentNick = Req->argv[1];
|
currentNick = Req->argv[1];
|
||||||
currentChannel = Req->argv[0];
|
currentChannel = Req->argv[0];
|
||||||
@ -155,17 +146,8 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req)
|
|||||||
assert( Client != NULL );
|
assert( Client != NULL );
|
||||||
assert( Req != NULL );
|
assert( Req != NULL );
|
||||||
|
|
||||||
if (Req->argc != 2)
|
_IRC_ARGC_EQ_OR_RETURN_(Client, Req, 2)
|
||||||
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
|
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
|
||||||
Client_ID(Client), Req->command);
|
|
||||||
|
|
||||||
if (Client_Type(Client) == CLIENT_SERVER)
|
|
||||||
from = Client_Search(Req->prefix);
|
|
||||||
else
|
|
||||||
from = Client;
|
|
||||||
if (!from)
|
|
||||||
return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
|
|
||||||
Client_ID(Client), Req->prefix);
|
|
||||||
|
|
||||||
/* Search user */
|
/* Search user */
|
||||||
target = Client_Search(Req->argv[0]);
|
target = Client_Search(Req->argv[0]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user