diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-12-13 00:42:58 +0000 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-12-13 00:42:58 +0000 | 
| commit | 9c846175a71a36cbc49b63ab1668d01675e16203 (patch) | |
| tree | f58c520fb35ba99b2b793bea00373301a128b60c | |
| parent | 8eec79d7d84aa0ba0f615db91c992102bc1bbce6 (diff) | |
Silently adding /CTCP NUDGE support for MSN contacts.
| -rw-r--r-- | protocols/msn/msn.c | 26 | ||||
| -rw-r--r-- | protocols/msn/msn.h | 13 | ||||
| -rw-r--r-- | protocols/msn/sb.c | 7 | 
3 files changed, 42 insertions, 4 deletions
| diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c index 11e50fb7..43feb2c4 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -353,6 +353,30 @@ static void msn_buddy_data_free( bee_user_t *bu )  	g_tree_remove( md->domaintree, bu->handle );  } +GList *msn_buddy_action_list( bee_user_t *bu ) +{ +	static GList *ret = NULL; +	 +	if( ret == NULL ) +	{ +		static const struct buddy_action ba[2] = { +			{ "NUDGE", "Draw attention" }, +		}; +		 +		ret = g_list_prepend( ret, (void*) ba + 0 ); +	} +	 +	return ret; +} + +void *msn_buddy_action( struct bee_user *bu, const char *action, char * const args[], void *data ) +{ +	if( g_strcasecmp( action, "NUDGE" ) == 0 ) +		msn_buddy_msg( bu->ic, bu->handle, NUDGE_MESSAGE, 0 ); +	 +	return NULL; +} +  void msn_initmodule()  {  	struct prpl *ret = g_new0(struct prpl, 1); @@ -381,6 +405,8 @@ void msn_initmodule()  	ret->handle_cmp = g_strcasecmp;  	ret->buddy_data_add = msn_buddy_data_add;  	ret->buddy_data_free = msn_buddy_data_free; +	ret->buddy_action_list = msn_buddy_action_list; +	ret->buddy_action = msn_buddy_action;  	//ret->transfer_request = msn_ftp_transfer_request; diff --git a/protocols/msn/msn.h b/protocols/msn/msn.h index f9993868..da9430ab 100644 --- a/protocols/msn/msn.h +++ b/protocols/msn/msn.h @@ -29,6 +29,7 @@  /* Some hackish magicstrings to make special-purpose messages/switchboards.   */  #define TYPING_NOTIFICATION_MESSAGE "\r\r\rBEWARE, ME R TYPINK MESSAGE!!!!\r\r\r" +#define NUDGE_MESSAGE "\r\r\rSHAKE THAT THING\r\r\r"  #define GROUPCHAT_SWITCHBOARD_MESSAGE "\r\r\rME WANT TALK TO MANY PEOPLE\r\r\r"  #define SB_KEEPALIVE_MESSAGE "\r\r\rDONT HANG UP ON ME!\r\r\r" @@ -69,9 +70,15 @@                             "TypingUser: %s\r\n" \                             "\r\n\r\n" -#define SB_KEEPALIVE_HEADERS "MIME-Version: 1.0\r\n" \ -                             "Content-Type: text/x-ping\r\n" \ -                             "\r\n\r\n" +#define MSN_NUDGE_HEADERS "MIME-Version: 1.0\r\n" \ +			  "Content-Type: text/x-msnmsgr-datacast\r\n" \ +			  "\r\n" \ +			  "ID: 1\r\n" \ +			  "\r\n" + +#define MSN_SB_KEEPALIVE_HEADERS "MIME-Version: 1.0\r\n" \ +                                 "Content-Type: text/x-ping\r\n" \ +                                 "\r\n\r\n"  #define PROFILE_URL "http://members.msn.com/" diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c index 898fb34f..37ac2889 100644 --- a/protocols/msn/sb.c +++ b/protocols/msn/sb.c @@ -183,9 +183,14 @@ int msn_sb_sendmessage( struct msn_switchboard *sb, char *text )  			buf = g_new0( char, i );  			i = g_snprintf( buf, i, MSN_TYPING_HEADERS, sb->ic->acc->user );  		} +		else if( strcmp( text, NUDGE_MESSAGE ) == 0 ) +		{ +			buf = g_strdup( MSN_NUDGE_HEADERS ); +			i = strlen( buf ); +		}  		else if( strcmp( text, SB_KEEPALIVE_MESSAGE ) == 0 )  		{ -			buf = g_strdup( SB_KEEPALIVE_HEADERS ); +			buf = g_strdup( MSN_SB_KEEPALIVE_HEADERS );  			i = strlen( buf );  		}  		else if( strncmp( text, MSN_INVITE_HEADERS, sizeof( MSN_INVITE_HEADERS ) - 1 ) == 0 )  | 
