Changeset 573dab0


Ignore:
Timestamp:
2010-04-13T10:20:04Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
81186cab
Parents:
3a9b123
Message:

Incoming typing notifications.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • irc_im.c

    r3a9b123 r573dab0  
    116116        g_free( wrapped );
    117117        g_free( prefix );
     118       
     119        return TRUE;
     120}
     121
     122static gboolean bee_irc_user_typing( bee_t *bee, bee_user_t *bu, uint32_t flags )
     123{
     124        irc_t *irc = (irc_t *) bee->ui_data;
     125       
     126        if( set_getbool( &bee->set, "typing_notice" ) )
     127                irc_send_msg_f( (irc_user_t *) bu->ui_data, "PRIVMSG", irc->user->nick,
     128                                "\001TYPING %d\001", ( flags >> 8 ) & 3 );
     129        else
     130                return FALSE;
    118131       
    119132        return TRUE;
     
    193206        bee_irc_user_status,
    194207        bee_irc_user_msg,
     208        bee_irc_user_typing,
    195209       
    196210        bee_irc_ft_in_start,
  • protocols/bee.h

    r3a9b123 r573dab0  
    7171        gboolean (*user_status)( bee_t *bee, struct bee_user *bu, struct bee_user *old );
    7272        gboolean (*user_msg)( bee_t *bee, bee_user_t *bu, const char *msg, time_t sent_at );
     73        gboolean (*user_typing)( bee_t *bee, bee_user_t *bu, guint32 flags );
    7374       
    7475        struct file_transfer* (*ft_in_start)( bee_t *bee, bee_user_t *bu, const char *file_name, size_t file_size );
  • protocols/bee_user.c

    r3a9b123 r573dab0  
    194194                imcb_log( ic, "Message from unknown handle %s:\n%s", handle, msg );
    195195}
     196
     197void imcb_buddy_typing( struct im_connection *ic, char *handle, uint32_t flags )
     198{
     199        bee_user_t *bu;
     200       
     201        if( ic->bee->ui->user_typing &&
     202            ( bu = bee_user_by_handle( ic->bee, ic, handle ) ) )
     203        {
     204                ic->bee->ui->user_typing( ic->bee, bu, flags );
     205        }
     206}
  • protocols/nogaim.c

    r3a9b123 r573dab0  
    525525        query_add( (irc_t *) ic->bee->ui_data, ic, s,
    526526                   imcb_ask_add_cb_yes, imcb_ask_add_cb_no, data );
    527 }
    528 
    529 void imcb_buddy_typing( struct im_connection *ic, char *handle, uint32_t flags )
    530 {
    531 #if 0
    532         user_t *u;
    533        
    534         if( !set_getbool( &ic->bee->set, "typing_notice" ) )
    535                 return;
    536        
    537         if( ( u = user_findhandle( ic, handle ) ) )
    538         {
    539                 char buf[256];
    540                
    541                 g_snprintf( buf, 256, "\1TYPING %d\1", ( flags >> 8 ) & 3 );
    542                 irc_privmsg( ic->irc, u, "PRIVMSG", ic->irc->nick, NULL, buf );
    543         }
    544 #endif
    545527}
    546528
Note: See TracChangeset for help on using the changeset viewer.