Ignore:
Timestamp:
2007-04-16T04:01:13Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
cfc8d58
Parents:
84b045d
Message:

Split serv_got_update() into imcb_buddy_(status|times). (Well, the second
one isn't implemented yet, but I'll do that later.) At last I got rid of
the hack called get_status_string(). And now Yahoo seems to mess up away
messages...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/oscar/oscar.c

    r84b045d r6bbb939  
    365365                   Let's hope nothing will break. ;-) */
    366366        } else {
    367                 ic->flags |= OPT_CONN_HTML;
     367                ic->flags |= OPT_DOES_HTML;
    368368        }
    369369
     
    968968        aim_userinfo_t *info;
    969969        time_t time_idle = 0, signon = 0;
    970         int type = 0;
    971         int caps = 0;
    972         char *tmp;
     970        int flags = OPT_LOGGED_IN;
     971        char *tmp, *state_string = NULL;
    973972
    974973        va_list ap;
     
    977976        va_end(ap);
    978977
    979         if (info->present & AIM_USERINFO_PRESENT_CAPABILITIES)
    980                 caps = info->capabilities;
    981         if (info->flags & AIM_FLAG_ACTIVEBUDDY)
    982                 type |= UC_AB;
    983 
    984978        if ((!od->icq) && (info->present & AIM_USERINFO_PRESENT_FLAGS)) {
    985                 if (info->flags & AIM_FLAG_UNCONFIRMED)
    986                         type |= UC_UNCONFIRMED;
    987                 if (info->flags & AIM_FLAG_ADMINISTRATOR)
    988                         type |= UC_ADMIN;
    989                 if (info->flags & AIM_FLAG_AOL)
    990                         type |= UC_AOL;
    991                 if (info->flags & AIM_FLAG_FREE)
    992                         type |= UC_NORMAL;
    993979                if (info->flags & AIM_FLAG_AWAY)
    994                         type |= UC_UNAVAILABLE;
    995                 if (info->flags & AIM_FLAG_WIRELESS)
    996                         type |= UC_WIRELESS;
    997         }
     980                        flags |= OPT_AWAY;
     981        }
     982       
    998983        if (info->present & AIM_USERINFO_PRESENT_ICQEXTSTATUS) {
    999                 type = (info->icqinfo.status << 7);
    1000984                if (!(info->icqinfo.status & AIM_ICQ_STATE_CHAT) &&
    1001985                      (info->icqinfo.status != AIM_ICQ_STATE_NORMAL)) {
    1002                         type |= UC_UNAVAILABLE;
     986                        flags |= OPT_AWAY;
    1003987                }
    1004         }
    1005 
    1006         if (caps & AIM_CAPS_ICQ)
    1007                 caps ^= AIM_CAPS_ICQ;
     988               
     989                if( info->icqinfo.status & AIM_ICQ_STATE_DND )
     990                        state_string = "Do Not Disturb";
     991                else if( info->icqinfo.status & AIM_ICQ_STATE_OUT )
     992                        state_string = "Not Available";
     993                else if( info->icqinfo.status & AIM_ICQ_STATE_BUSY )
     994                        state_string = "Occupied";
     995                else if( info->icqinfo.status & AIM_ICQ_STATE_INVISIBLE )
     996                        state_string = "Invisible";
     997        }
    1008998
    1009999        if (info->present & AIM_USERINFO_PRESENT_IDLE) {
     
    10201010        g_free(tmp);
    10211011
    1022         serv_got_update(ic, info->sn, 1, info->warnlevel/10, signon,
    1023                         time_idle, type, caps);
     1012        imcb_buddy_status(ic, info->sn, flags, state_string, NULL);
     1013        /* imcb_buddy_times(ic, info->sn, signon, time_idle); */
    10241014
    10251015        return 1;
     
    10351025        va_end(ap);
    10361026
    1037         serv_got_update(ic, info->sn, 0, 0, 0, 0, 0, 0);
     1027        imcb_buddy_status(ic, info->sn, 0, NULL, NULL );
    10381028
    10391029        return 1;
     
    10461036       
    10471037        if (args->icbmflags & AIM_IMFLAGS_AWAY)
    1048                 flags |= IM_FLAG_AWAY;
     1038                flags |= OPT_AWAY;
    10491039       
    10501040        if ((args->icbmflags & AIM_IMFLAGS_UNICODE) || (args->icbmflags & AIM_IMFLAGS_ISO_8859_1)) {
     
    18211811        struct oscar_data *odata = (struct oscar_data *)ic->proto_data;
    18221812        int ret = 0, len = strlen(message);
    1823         if (imflags & IM_FLAG_AWAY) {
     1813        if (imflags & OPT_AWAY) {
    18241814                ret = aim_send_im(odata->sess, name, AIM_IMFLAGS_AWAY, message);
    18251815        } else {
     
    24452435}
    24462436
    2447 static char *oscar_get_status_string( struct im_connection *ic, int number )
    2448 {
    2449         struct oscar_data *od = ic->proto_data;
    2450        
    2451         if( ! number & UC_UNAVAILABLE )
    2452         {
    2453                 return( NULL );
    2454         }
    2455         else if( od->icq )
    2456         {
    2457                 number >>= 7;
    2458                 if( number & AIM_ICQ_STATE_DND )
    2459                         return( "Do Not Disturb" );
    2460                 else if( number & AIM_ICQ_STATE_OUT )
    2461                         return( "Not Available" );
    2462                 else if( number & AIM_ICQ_STATE_BUSY )
    2463                         return( "Occupied" );
    2464                 else if( number & AIM_ICQ_STATE_INVISIBLE )
    2465                         return( "Invisible" );
    2466                 else
    2467                         return( "Away" );
    2468         }
    2469         else
    2470         {
    2471                 return( "Away" );
    2472         }
    2473 }
    2474 
    24752437int oscar_send_typing(struct im_connection *ic, char * who, int typing)
    24762438{
     
    26332595        ret->rem_deny = oscar_rem_deny;
    26342596        ret->set_permit_deny = oscar_set_permit_deny;
    2635         ret->get_status_string = oscar_get_status_string;
    26362597        ret->send_typing = oscar_send_typing;
    26372598       
Note: See TracChangeset for help on using the changeset viewer.