From: Florian Westphal Date: Tue, 26 Feb 2008 12:06:57 +0000 (+0000) Subject: send "G" flag in WHOIS replies instead of "H" if client is marked as being away. X-Git-Tag: rel-0-11-1~3 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git;a=commitdiff_plain;h=082a92beef53fd26304c0dd059255d5eaba89f37 send "G" flag in WHOIS replies instead of "H" if client is marked as being away. (reported by Dana Dahlstrom) --- diff --git a/ChangeLog b/ChangeLog index 28faac75..0b07949b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ -- ChangeLog -- ngIRCd 0.11.1 + - send "G" instead of "H" flag in WHO replies (reported by Dana Dahlstrom). - Under some circumstances ngIRCd issued channel MODE message with a trailing space. (Dana Dahlstrom) [from HEAD] @@ -737,4 +738,4 @@ ngIRCd 0.0.1, 31.12.2001 -- -$Id: ChangeLog,v 1.332.2.7 2008/02/16 11:26:11 fw Exp $ +$Id: ChangeLog,v 1.332.2.8 2008/02/26 12:06:57 fw Exp $ diff --git a/NEWS b/NEWS index a9f698d6..7eb5c84f 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,9 @@ -- NEWS -- +ngIRCd 0.11.0 (2008-02-27) + + - send "G" instead of "H" flag in WHO replies (reported by Dana Dahlstrom). ngIRCd 0.11.0 (2008-01-15) @@ -251,4 +254,4 @@ ngIRCd 0.0.1, 31.12.2001 -- -$Id: NEWS,v 1.83.2.2 2008/01/15 20:45:52 alex Exp $ +$Id: NEWS,v 1.83.2.3 2008/02/26 12:06:57 fw Exp $ diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c index 24db75de..4e51d757 100644 --- a/src/ngircd/irc-info.c +++ b/src/ngircd/irc-info.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-info.c,v 1.41 2007/12/11 11:29:44 fw Exp $"; +static char UNUSED id[] = "$Id: irc-info.c,v 1.41.2.1 2008/02/26 12:06:57 fw Exp $"; #include "imp.h" #include @@ -648,7 +648,11 @@ IRC_WHO( CLIENT *Client, REQUEST *Req ) if( ok && (( ! only_ops ) || ( strchr( Client_Modes( c ), 'o' )))) { /* Get flags */ - strcpy( flags, "H" ); + if (strchr(Client_Modes( c ), 'a')) + strcpy(flags, "G"); /* away */ + else + strcpy(flags, "H"); + if( strchr( Client_Modes( c ), 'o' )) strlcat( flags, "*", sizeof( flags )); /* Search suitable channel */ @@ -1082,10 +1086,12 @@ IRC_Send_WHO( CLIENT *Client, CHANNEL *Chan, bool OnlyOps ) if( strchr( Client_Modes( c ), 'i' )) is_visible = false; else is_visible = true; - if( is_member || is_visible ) - { - /* Flags zusammenbasteln */ - strcpy( flags, "H" ); + if( is_member || is_visible ) { + if (strchr(Client_Modes( c ), 'a')) + strcpy(flags, "G"); /* away */ + else + strcpy(flags, "H"); + if( strchr( Client_Modes( c ), 'o' )) strlcat( flags, "*", sizeof( flags )); if( strchr( Channel_UserModes( Chan, c ), 'o' )) strlcat( flags, "@", sizeof( flags )); else if( strchr( Channel_UserModes( Chan, c ), 'v' )) strlcat( flags, "+", sizeof( flags ));