diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-16 10:18:02 +0000 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-16 10:18:02 +0000 | 
| commit | 449a51de265cb3b4f0f5003e09fbbb030247c972 (patch) | |
| tree | 86ce0c9894f8910187fd65c8d43cd366d05ba9fc | |
| parent | 9fca06579d61d6360520db98092bce13d30d39ce (diff) | |
Include non-away status messages in blist and whois responses. The whois
change is a complete violation of the IRC protocol but that doesn't seem
to be an uncommon thing.
| -rw-r--r-- | irc_commands.c | 2 | ||||
| -rw-r--r-- | protocols/nogaim.c | 13 | ||||
| -rw-r--r-- | root_commands.c | 9 | ||||
| -rw-r--r-- | user.h | 1 | 
4 files changed, 17 insertions, 8 deletions
| diff --git a/irc_commands.c b/irc_commands.c index 750bbcf5..a417e0d9 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -496,6 +496,8 @@ static void irc_cmd_whois( irc_t *irc, char **cmd )  			irc_reply( irc, 301, "%s :%s", u->nick, "User is offline" );  		else if( u->away )  			irc_reply( irc, 301, "%s :%s", u->nick, u->away ); +		if( u->status_msg ) +			irc_reply( irc, 333, "%s :Status: %s", u->nick, u->status_msg );  		irc_reply( irc, 318, "%s :End of /WHOIS list", nick );  	} diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 9c6daeaf..c326e378 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -646,11 +646,9 @@ void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags,  	oa = u->away != NULL;  	oo = u->online; -	if( u->away ) -	{ -		g_free( u->away ); -		u->away = NULL; -	} +	g_free( u->away ); +	g_free( u->status_msg ); +	u->away = u->status_msg = NULL;  	if( ( flags & OPT_LOGGED_IN ) && !u->online )  	{ @@ -688,7 +686,10 @@ void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags,  			u->away = g_strdup( "Away" );  		}  	} -	/* else waste_any_state_information_for_now(); */ +	else +	{ +		u->status_msg = g_strdup( message ); +	}  	/* LISPy... */  	if( ( set_getbool( &ic->irc->set, "away_devoice" ) ) &&		/* Don't do a thing when user doesn't want it */ diff --git a/root_commands.c b/root_commands.c index b3432b9b..15e6e72a 100644 --- a/root_commands.c +++ b/root_commands.c @@ -913,7 +913,7 @@ static void cmd_blist( irc_t *irc, char **cmd )  	else if( cmd[1] && g_strcasecmp( cmd[1], "online" ) == 0 )  		online = 1;  	else -		online =  away = 1; +		online = away = 1;  	if( strchr( irc->umode, 'b' ) != NULL )  		format = "%s\t%s\t%s"; @@ -926,8 +926,13 @@ static void cmd_blist( irc_t *irc, char **cmd )  	{  		if( online == 1 )  		{ +			char st[256] = "Online"; +			 +			if( u->status_msg ) +				g_snprintf( st, sizeof( st ) - 1, "Online (%s)", u->status_msg ); +			  			g_snprintf( s, sizeof( s ) - 1, "%s@%s %s(%s)", u->user, u->host, u->ic->acc->prpl->name, u->ic->acc->user ); -			irc_usermsg( irc, format, u->nick, s, "Online" ); +			irc_usermsg( irc, format, u->nick, s, st );  		}  		n_online ++; @@ -33,6 +33,7 @@ typedef struct __USER  	char *realname;  	char *away; +	char *status_msg; /* Non-IRC extension, but nice on IM. */  	char is_private;  	char online; | 
