From f7c124297985fddf4c82fad22adcbc50677226cb Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Thu, 2 Jan 2003 18:03:05 +0000 Subject: [PATCH] - the server sets a correct default AWAY message when receiving a "MODE +a". --- ChangeLog | 4 +++- src/ngircd/irc-mode.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c17eba3..b36de1b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,8 @@ ngIRCd 0.6.x-CVS - The server no longer forwards commands to ordinary users, instead it answers with the correct error message ("no such server") now. - WHOIS commands weren't always forwarded as requested. + - The server sets a correct default AWAY message now when propagating + between servers. Older changes (sorry, only available in german language): @@ -381,4 +383,4 @@ ngIRCd 0.0.1, 31.12.2001 -- -$Id: ChangeLog,v 1.147.2.6 2003/01/01 13:46:06 alex Exp $ +$Id: ChangeLog,v 1.147.2.7 2003/01/02 18:03:05 alex Exp $ diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c index 05664949..6c07cb7b 100644 --- a/src/ngircd/irc-mode.c +++ b/src/ngircd/irc-mode.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-mode.c,v 1.24 2002/12/18 14:16:21 alex Exp $"; +static char UNUSED id[] = "$Id: irc-mode.c,v 1.24.2.1 2003/01/02 18:03:05 alex Exp $"; #include "imp.h" #include @@ -156,7 +156,11 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) { case 'a': /* Away */ - if( Client_Type( Client ) == CLIENT_SERVER ) x[0] = 'a'; + if( Client_Type( Client ) == CLIENT_SERVER ) + { + x[0] = 'a'; + Client_SetAway( Client, DEFAULT_AWAY_MSG ); + } else ok = IRC_WriteStrClient( Origin, ERR_NOPRIVILEGES_MSG, Client_ID( Origin )); break; case 'i': @@ -569,13 +573,14 @@ IRC_AWAY( CLIENT *Client, REQUEST *Req ) { /* AWAY setzen */ Client_SetAway( Client, Req->argv[0] ); + Client_ModeAdd( Client, 'a' ); IRC_WriteStrServersPrefix( Client, Client, "MODE %s :+a", Client_ID( Client )); return IRC_WriteStrClient( Client, RPL_NOWAWAY_MSG, Client_ID( Client )); } else { /* AWAY loeschen */ - Client_SetAway( Client, NULL ); + Client_ModeDel( Client, 'a' ); IRC_WriteStrServersPrefix( Client, Client, "MODE %s :-a", Client_ID( Client )); return IRC_WriteStrClient( Client, RPL_UNAWAY_MSG, Client_ID( Client )); } -- 2.39.2