X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-write.c;h=dae78e582335fd6ab817b1d7f75da1a773706f72;hb=eaaf0c3bd5ce4f48205ca928fba994d0c44e59b2;hp=ea0f5f8a288158531e55952212197b360690102e;hpb=9a7499af8bb3c4b781492fef216c86cf7ab04134;p=ngircd-alex.git diff --git a/src/ngircd/irc-write.c b/src/ngircd/irc-write.c index ea0f5f8a..dae78e58 100644 --- a/src/ngircd/irc-write.c +++ b/src/ngircd/irc-write.c @@ -1,6 +1,6 @@ /* * 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 @@ -405,6 +405,34 @@ va_dcl } /* 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 IRC_SetPenalty( CLIENT *Client, time_t Seconds ) {