Changeset 56699f0


Ignore:
Timestamp:
2010-06-07T15:11:09Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
0e8b3e8
Parents:
4aa0f6b
Message:

Show idle + login time info in /WHOIS (if available).

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • irc_send.c

    r4aa0f6b r56699f0  
    240240                        irc_send_num( irc, 301, "%s :%s", iu->nick, "User is offline" );
    241241                }
     242               
     243                if( bu->idle_time || bu->login_time )
     244                {
     245                        irc_send_num( irc, 317, "%s %d %d :seconds idle, signon time",
     246                                      iu->nick,
     247                                      bu->idle_time ? (int) ( time( NULL ) - bu->idle_time ) : 0,
     248                                      (int) bu->login_time );
     249                }
    242250        }
    243251        else
  • protocols/bee.h

    r4aa0f6b r56699f0  
    6868        char *status_msg;
    6969       
     70        time_t login_time, idle_time;
     71       
    7072        bee_t *bee;
    7173        void *ui_data;
     
    123125 * - 'state' and 'message' can be NULL */
    124126G_MODULE_EXPORT void imcb_buddy_status( struct im_connection *ic, const char *handle, int flags, const char *state, const char *message );
    125 /* Not implemented yet! */ G_MODULE_EXPORT void imcb_buddy_times( struct im_connection *ic, const char *handle, time_t login, time_t idle );
     127G_MODULE_EXPORT void imcb_buddy_times( struct im_connection *ic, const char *handle, time_t login, time_t idle );
    126128/* Call when a handle says something. 'flags' and 'sent_at may be just 0. */
    127129G_MODULE_EXPORT void imcb_buddy_msg( struct im_connection *ic, const char *handle, char *msg, guint32 flags, time_t sent_at );
  • protocols/bee_user.c

    r4aa0f6b r56699f0  
    192192}
    193193
     194void imcb_buddy_times( struct im_connection *ic, const char *handle, time_t login, time_t idle )
     195{
     196        bee_t *bee = ic->bee;
     197        bee_user_t *bu;
     198       
     199        if( !( bu = bee_user_by_handle( bee, ic, handle ) ) )
     200                return;
     201       
     202        bu->login_time = login;
     203        bu->idle_time = idle;
     204}
     205
    194206void imcb_buddy_msg( struct im_connection *ic, const char *handle, char *msg, uint32_t flags, time_t sent_at )
    195207{
  • protocols/oscar/oscar.c

    r4aa0f6b r56699f0  
    938938        tmp = normalize(info->sn);
    939939        imcb_buddy_status(ic, tmp, flags, state_string, NULL);
    940         /* imcb_buddy_times(ic, tmp, signon, time_idle); */
     940        imcb_buddy_times(ic, tmp, signon, time_idle);
    941941
    942942
  • protocols/purple/purple.c

    r4aa0f6b r56699f0  
    687687                imcb_buddy_status( ic, bud->name, flags, purple_status_get_name( as ),
    688688                                   purple_status_get_attr_string( as, "message" ) );
     689               
     690                imcb_buddy_times( ic, bud->name,
     691                                  purple_presence_get_login_time( bud->presence ),
     692                                  purple_presence_get_idle_time( bud->presence ) );
    689693        }
    690694}
  • protocols/yahoo/yahoo.c

    r4aa0f6b r56699f0  
    613613        imcb_buddy_status( ic, who, flags, state_string, msg );
    614614       
    615         /* Not implemented yet...
    616615        if( stat == YAHOO_STATUS_IDLE )
    617                 imcb_buddy_times( ic, who, 0, away );
    618         */
     616                imcb_buddy_times( ic, who, 0, idle );
    619617}
    620618
Note: See TracChangeset for help on using the changeset viewer.