Changeset e7f46c5 for protocols


Ignore:
Timestamp:
2005-12-04T12:58:41Z (19 years ago)
Author:
Matt Sparks <root@…>
Branches:
master
Children:
22bf64e
Parents:
25d1be7
Message:

Implements solution to typing notifications in ticket #45

Location:
protocols
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/sb.c

    r25d1be7 re7f46c5  
    644644                        if( who )
    645645                        {
    646                                 serv_got_typing( gc, who, 5 );
     646                                serv_got_typing( gc, who, 5, 1 );
    647647                                g_free( who );
    648648                        }
  • protocols/nogaim.c

    r25d1be7 re7f46c5  
    697697}
    698698
    699 void serv_got_typing( struct gaim_connection *gc, char *handle, int timeout )
     699void serv_got_typing( struct gaim_connection *gc, char *handle, int timeout, int type )
    700700{
    701701        user_t *u;
     
    704704                return;
    705705       
    706         if( ( u = user_findhandle( gc, handle ) ) )
    707                 irc_privmsg( gc->irc, u, "PRIVMSG", gc->irc->nick, NULL, "\1TYPING \1" );
     706        if( ( u = user_findhandle( gc, handle ) ) ) {
     707                /* If type is:
     708                 * 0: user has stopped typing
     709                 * 1: user is actively typing
     710                 * 2: user has entered text, but is not actively typing
     711                 */
     712                if (type == 0 || type == 1 || type == 2) {
     713                        char buf[256];
     714                        g_snprintf(buf, 256, "\1TYPING %d\1", type);
     715                        irc_privmsg( gc->irc, u, "PRIVMSG", gc->irc->nick, NULL, buf );
     716                }
     717        }
    708718}
    709719
  • protocols/nogaim.h

    r25d1be7 re7f46c5  
    300300G_MODULE_EXPORT void serv_got_update( struct gaim_connection *gc, char *handle, int loggedin, int evil, time_t signon, time_t idle, int type, guint caps );
    301301G_MODULE_EXPORT void serv_got_im( struct gaim_connection *gc, char *handle, char *msg, guint32 flags, time_t mtime, gint len );
    302 G_MODULE_EXPORT void serv_got_typing( struct gaim_connection *gc, char *handle, int timeout );
     302G_MODULE_EXPORT void serv_got_typing( struct gaim_connection *gc, char *handle, int timeout, int type );
    303303G_MODULE_EXPORT void serv_got_chat_invite( struct gaim_connection *gc, char *handle, char *who, char *msg, GList *data );
    304304G_MODULE_EXPORT struct conversation *serv_got_joined_chat( struct gaim_connection *gc, int id, char *handle );
  • protocols/oscar/oscar.c

    r25d1be7 re7f46c5  
    24432443        type2 = va_arg(ap, int);
    24442444        va_end(ap);
    2445 
    2446         if(type2 == 0x0001 || type2 == 0x0002)
    2447                 serv_got_typing(gc, sn, 0);
    2448 
     2445   
     2446        if(type2 == 0x0002) {
     2447                /* User is typing */
     2448                serv_got_typing(gc, sn, 0, 1);
     2449        }
     2450        else if (type2 == 0x0001) {
     2451                /* User has typed something, but is not actively typing (stale) */
     2452                serv_got_typing(gc, sn, 0, 2);
     2453        }
     2454        else {
     2455                /* User has stopped typing */
     2456                serv_got_typing(gc, sn, 0, 0);
     2457        }       
     2458       
    24492459        return 1;
    24502460}
  • protocols/yahoo/yahoo.c

    r25d1be7 re7f46c5  
    641641{
    642642        struct gaim_connection *gc = byahoo_get_gc_by_id( id );
    643        
    644         serv_got_typing( gc, who, 1 );
     643        if (stat == 1) {
     644                /* User is typing */
     645                serv_got_typing( gc, who, 1, 1 );
     646        }
     647        else {
     648                /* User stopped typing */
     649                serv_got_typing( gc, who, 1, 0 );
     650        }
    645651}
    646652
Note: See TracChangeset for help on using the changeset viewer.