comparison libpurple/protocols/jabber/jabber.c @ 15462:0b6f337a46d5

Emblems in the blist
author Sean Egan <seanegan@gmail.com>
date Tue, 30 Jan 2007 06:53:23 +0000
parents 5fe8042783c1
children 0d4890637238
comparison
equal deleted inserted replaced
15461:e9c12873fae0 15462:0b6f337a46d5
1066 static const char *jabber_list_icon(GaimAccount *a, GaimBuddy *b) 1066 static const char *jabber_list_icon(GaimAccount *a, GaimBuddy *b)
1067 { 1067 {
1068 return "jabber"; 1068 return "jabber";
1069 } 1069 }
1070 1070
1071 static void jabber_list_emblems(GaimBuddy *b, const char **se, const char **sw, 1071 static const char* jabber_list_emblem(GaimBuddy *b)
1072 const char **nw, const char **ne)
1073 { 1072 {
1074 JabberStream *js; 1073 JabberStream *js;
1075 JabberBuddy *jb = NULL; 1074 JabberBuddy *jb = NULL;
1076 1075
1077 if(!b->account->gc) 1076 if(!b->account->gc)
1079 js = b->account->gc->proto_data; 1078 js = b->account->gc->proto_data;
1080 if(js) 1079 if(js)
1081 jb = jabber_buddy_find(js, b->name, FALSE); 1080 jb = jabber_buddy_find(js, b->name, FALSE);
1082 1081
1083 if(!GAIM_BUDDY_IS_ONLINE(b)) { 1082 if(!GAIM_BUDDY_IS_ONLINE(b)) {
1084 if(jb && jb->error_msg)
1085 *nw = "error";
1086
1087 if(jb && (jb->subscription & JABBER_SUB_PENDING || 1083 if(jb && (jb->subscription & JABBER_SUB_PENDING ||
1088 !(jb->subscription & JABBER_SUB_TO))) 1084 !(jb->subscription & JABBER_SUB_TO)))
1089 *se = "notauthorized"; 1085 return "not-authorized";
1090 else 1086 }
1091 *se = "offline"; 1087 return NULL;
1092 } else {
1093 GaimStatusType *status_type = gaim_status_get_type(gaim_presence_get_active_status(gaim_buddy_get_presence(b)));
1094 GaimStatusPrimitive primitive = gaim_status_type_get_primitive(status_type);
1095
1096 if(primitive > GAIM_STATUS_AVAILABLE) {
1097 *se = gaim_status_type_get_id(status_type);
1098 }
1099 }
1100 } 1088 }
1101 1089
1102 static char *jabber_status_text(GaimBuddy *b) 1090 static char *jabber_status_text(GaimBuddy *b)
1103 { 1091 {
1104 JabberBuddy *jb = jabber_buddy_find(b->account->gc->proto_data, b->name, 1092 JabberBuddy *jb = jabber_buddy_find(b->account->gc->proto_data, b->name,
1851 OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_MAIL_CHECK, 1839 OPT_PROTO_CHAT_TOPIC | OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_MAIL_CHECK,
1852 NULL, /* user_splits */ 1840 NULL, /* user_splits */
1853 NULL, /* protocol_options */ 1841 NULL, /* protocol_options */
1854 {"png,gif,jpeg", 32, 32, 96, 96, 8191, GAIM_ICON_SCALE_SEND | GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */ 1842 {"png,gif,jpeg", 32, 32, 96, 96, 8191, GAIM_ICON_SCALE_SEND | GAIM_ICON_SCALE_DISPLAY}, /* icon_spec */
1855 jabber_list_icon, /* list_icon */ 1843 jabber_list_icon, /* list_icon */
1856 jabber_list_emblems, /* list_emblems */ 1844 jabber_list_emblem, /* list_emblems */
1857 jabber_status_text, /* status_text */ 1845 jabber_status_text, /* status_text */
1858 jabber_tooltip_text, /* tooltip_text */ 1846 jabber_tooltip_text, /* tooltip_text */
1859 jabber_status_types, /* status_types */ 1847 jabber_status_types, /* status_types */
1860 jabber_blist_node_menu, /* blist_node_menu */ 1848 jabber_blist_node_menu, /* blist_node_menu */
1861 jabber_chat_info, /* chat_info */ 1849 jabber_chat_info, /* chat_info */