diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2005-12-14 00:27:58 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2005-12-14 00:27:58 +0100 |
commit | 22bf64eab8a79352317ee190cddfeef3011aa8dc (patch) | |
tree | 588aeb197e2b24660c2813866270f8e780903da0 /protocols/nogaim.c | |
parent | 6aaa2213588f7c4c00a68c5622f6974679eaf196 (diff) | |
parent | e7f46c56ffa29c6f8f4917c5f367a61706758e2a (diff) |
Improved typing notification support. (from f0rked)
Diffstat (limited to 'protocols/nogaim.c')
-rw-r--r-- | protocols/nogaim.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 3ab4737e..34dfb2c3 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -696,15 +696,25 @@ void serv_got_im( struct gaim_connection *gc, char *handle, char *msg, guint32 f irc_msgfrom( irc, u->nick, msg ); } -void serv_got_typing( struct gaim_connection *gc, char *handle, int timeout ) +void serv_got_typing( struct gaim_connection *gc, char *handle, int timeout, int type ) { user_t *u; if( !set_getint( gc->irc, "typing_notice" ) ) return; - if( ( u = user_findhandle( gc, handle ) ) ) - irc_privmsg( gc->irc, u, "PRIVMSG", gc->irc->nick, NULL, "\1TYPING 1\1" ); + if( ( u = user_findhandle( gc, handle ) ) ) { + /* If type is: + * 0: user has stopped typing + * 1: user is actively typing + * 2: user has entered text, but is not actively typing + */ + if (type == 0 || type == 1 || type == 2) { + char buf[256]; + g_snprintf(buf, 256, "\1TYPING %d\1", type); + irc_privmsg( gc->irc, u, "PRIVMSG", gc->irc->nick, NULL, buf ); + } + } } void serv_got_chat_left( struct gaim_connection *gc, int id ) |