commit - 9a7499af8bb3c4b781492fef216c86cf7ab04134
commit + eaaf0c3bd5ce4f48205ca928fba994d0c44e59b2
blob - 868d0ad495ee09cd1222fbb6ad852d0e89e3aeb9
blob + aae071bfc33ddbea589527da3ef218d2396e9d46
--- src/ngircd/irc-oper.c
+++ src/ngircd/irc-oper.c
GLOBAL bool
IRC_WALLOPS( CLIENT *Client, REQUEST *Req )
{
- CLIENT *to, *from;
- int client_type;
+ CLIENT *from;
assert( Client != NULL );
assert( Req != NULL );
if (Req->argc != 1)
return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG, Client_ID(Client), Req->command);
- client_type = Client_Type(Client);
- switch (client_type) {
+ switch (Client_Type(Client)) {
case CLIENT_USER:
if (!Client_OperByMe(Client))
return IRC_WriteStrClient(Client, ERR_NOPRIVILEGES_MSG, Client_ID(Client));
if (!from)
return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, Client_ID(Client), Req->prefix);
-
- for (to=Client_First(); to != NULL; to=Client_Next(to)) {
- if (Client_Conn(to) < 0) /* no local connection or WALLOPS origin */
- continue;
- client_type = Client_Type(to);
- switch (client_type) {
- case CLIENT_USER:
- if (Client_HasMode(to, 'w'))
- IRC_WriteStrClientPrefix(to, from, "WALLOPS :%s", Req->argv[0]);
- break;
- case CLIENT_SERVER:
- if (to != Client)
- IRC_WriteStrClientPrefix(to, from, "WALLOPS :%s", Req->argv[0]);
- break;
- }
- }
+ IRC_SendWallops(Client, from, Req->argv[0]);
return CONNECTED;
-}
+} /* IRC_WALLOPS */
-
/* -eof- */
blob - ea0f5f8a288158531e55952212197b360690102e
blob + dae78e582335fd6ab817b1d7f75da1a773706f72
--- src/ngircd/irc-write.c
+++ src/ngircd/irc-write.c
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2005 by Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
*
* 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
}
return ok;
} /* IRC_WriteStrRelatedPrefix */
+
+
+/**
+ * Send WALLOPS message.
+ */
+GLOBAL void
+IRC_SendWallops(CLIENT *Client, CLIENT *From, const char *Message)
+{
+ CLIENT *to;
+
+ for (to=Client_First(); to != NULL; to=Client_Next(to)) {
+ if (Client_Conn(to) == NONE) /* no local connection */
+ continue;
+
+ switch (Client_Type(to)) {
+ case CLIENT_USER:
+ if (Client_HasMode(to, 'w'))
+ IRC_WriteStrClientPrefix(to, From,
+ "WALLOPS :%s", Message);
+ break;
+ case CLIENT_SERVER:
+ if (to != Client)
+ IRC_WriteStrClientPrefix(to, From,
+ "WALLOPS :%s", Message);
+ break;
+ }
+ }
+} /* IRC_SendWallops */
GLOBAL void
blob - 51c8f0c2b72fff27f371101d7792f4d19468fbc8
blob + 5bac0de7a9960f8351f2c3cc5101bfdd8103023a
--- src/ngircd/irc-write.h
+++ src/ngircd/irc-write.h
GLOBAL bool IRC_WriteStrRelatedPrefix PARAMS((CLIENT *Client, CLIENT *Prefix,
bool Remote, char *Format, ...));
+GLOBAL void IRC_SendWallops PARAMS((CLIENT *Client, CLIENT *From,
+ const char *Message));
+
GLOBAL void IRC_SetPenalty PARAMS((CLIENT *Client, time_t Seconds));
#endif