Changeset 6bbb939 for protocols/oscar
- Timestamp:
- 2007-04-16T04:01:13Z (18 years ago)
- Branches:
- master
- Children:
- cfc8d58
- Parents:
- 84b045d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/oscar/oscar.c
r84b045d r6bbb939 365 365 Let's hope nothing will break. ;-) */ 366 366 } else { 367 ic->flags |= OPT_ CONN_HTML;367 ic->flags |= OPT_DOES_HTML; 368 368 } 369 369 … … 968 968 aim_userinfo_t *info; 969 969 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; 973 972 974 973 va_list ap; … … 977 976 va_end(ap); 978 977 979 if (info->present & AIM_USERINFO_PRESENT_CAPABILITIES)980 caps = info->capabilities;981 if (info->flags & AIM_FLAG_ACTIVEBUDDY)982 type |= UC_AB;983 984 978 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;993 979 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 998 983 if (info->present & AIM_USERINFO_PRESENT_ICQEXTSTATUS) { 999 type = (info->icqinfo.status << 7);1000 984 if (!(info->icqinfo.status & AIM_ICQ_STATE_CHAT) && 1001 985 (info->icqinfo.status != AIM_ICQ_STATE_NORMAL)) { 1002 type |= UC_UNAVAILABLE;986 flags |= OPT_AWAY; 1003 987 } 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 } 1008 998 1009 999 if (info->present & AIM_USERINFO_PRESENT_IDLE) { … … 1020 1010 g_free(tmp); 1021 1011 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); */ 1024 1014 1025 1015 return 1; … … 1035 1025 va_end(ap); 1036 1026 1037 serv_got_update(ic, info->sn, 0, 0, 0, 0, 0, 0);1027 imcb_buddy_status(ic, info->sn, 0, NULL, NULL ); 1038 1028 1039 1029 return 1; … … 1046 1036 1047 1037 if (args->icbmflags & AIM_IMFLAGS_AWAY) 1048 flags |= IM_FLAG_AWAY;1038 flags |= OPT_AWAY; 1049 1039 1050 1040 if ((args->icbmflags & AIM_IMFLAGS_UNICODE) || (args->icbmflags & AIM_IMFLAGS_ISO_8859_1)) { … … 1821 1811 struct oscar_data *odata = (struct oscar_data *)ic->proto_data; 1822 1812 int ret = 0, len = strlen(message); 1823 if (imflags & IM_FLAG_AWAY) {1813 if (imflags & OPT_AWAY) { 1824 1814 ret = aim_send_im(odata->sess, name, AIM_IMFLAGS_AWAY, message); 1825 1815 } else { … … 2445 2435 } 2446 2436 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 else2467 return( "Away" );2468 }2469 else2470 {2471 return( "Away" );2472 }2473 }2474 2475 2437 int oscar_send_typing(struct im_connection *ic, char * who, int typing) 2476 2438 { … … 2633 2595 ret->rem_deny = oscar_rem_deny; 2634 2596 ret->set_permit_deny = oscar_set_permit_deny; 2635 ret->get_status_string = oscar_get_status_string;2636 2597 ret->send_typing = oscar_send_typing; 2637 2598
Note: See TracChangeset
for help on using the changeset viewer.