From 487f555c687571cee39d69b3954b4d1f82811d29 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 26 Nov 2009 00:04:40 +0000 Subject: Support for sending zomg-im-typing notifications. --- protocols/purple/purple.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'protocols/purple') diff --git a/protocols/purple/purple.c b/protocols/purple/purple.c index 50770187..6bb8fc99 100644 --- a/protocols/purple/purple.c +++ b/protocols/purple/purple.c @@ -242,9 +242,26 @@ static void purple_keepalive( struct im_connection *ic ) { } -static int purple_send_typing( struct im_connection *ic, char *who, int typing ) +static int purple_send_typing( struct im_connection *ic, char *who, int flags ) { - return 1; + PurpleTypingState state = PURPLE_NOT_TYPING; + PurpleConversation *conv; + + if( flags & OPT_TYPING ) + state = PURPLE_TYPING; + else if( flags & OPT_THINKING ) + state = PURPLE_TYPED; + + if( ( conv = purple_find_conversation_with_account( PURPLE_CONV_TYPE_IM, + who, ic->proto_data ) ) == NULL ) + { + purple_conv_im_set_typing_state( purple_conversation_get_im_data( conv ), state ); + return 1; + } + else + { + return 0; + } } static void purple_ui_init(); -- cgit v1.2.3