comparison libpurple/protocols/qq/qq.c @ 25365:367b3ddcf5c3

propagate from branch 'im.pidgin.pidgin' (head 81aa401ac9855c99eb55a7cf91fa221860dee220) to branch 'im.pidgin.pidgin.next.minor' (head cf7b71a77c33c3e1d2f392c46d090fb936eb47b7)
author Richard Laager <rlaager@wiktel.com>
date Mon, 08 Dec 2008 17:57:09 +0000
parents 9ffd54bf622a 0331bc480515
children 1260a3fb60f4
comparison
equal deleted inserted replaced
24656:6f41450584a7 25365:367b3ddcf5c3
244 static gchar *qq_status_text(PurpleBuddy *b) 244 static gchar *qq_status_text(PurpleBuddy *b)
245 { 245 {
246 qq_buddy_data *bd; 246 qq_buddy_data *bd;
247 GString *status; 247 GString *status;
248 248
249 bd = (qq_buddy_data *) b->proto_data; 249 bd = purple_buddy_get_protocol_data(b);
250 if (bd == NULL) 250 if (bd == NULL)
251 return NULL; 251 return NULL;
252 252
253 status = g_string_new(""); 253 status = g_string_new("");
254 254
287 gchar *tmp; 287 gchar *tmp;
288 GString *str; 288 GString *str;
289 289
290 g_return_if_fail(b != NULL); 290 g_return_if_fail(b != NULL);
291 291
292 bd = (qq_buddy_data *) b->proto_data; 292 bd = purple_buddy_get_protocol_data(b);
293 if (bd == NULL) 293 if (bd == NULL)
294 return; 294 return;
295 295
296 /* if (PURPLE_BUDDY_IS_ONLINE(b) && bd != NULL) */ 296 /* if (PURPLE_BUDDY_IS_ONLINE(b) && bd != NULL) */
297 if (bd->ip.s_addr != 0) { 297 if (bd->ip.s_addr != 0) {
378 PurpleAccount *account; 378 PurpleAccount *account;
379 PurpleConnection *gc; 379 PurpleConnection *gc;
380 qq_data *qd; 380 qq_data *qd;
381 qq_buddy_data *buddy; 381 qq_buddy_data *buddy;
382 382
383 if (!b || !(account = b->account) || 383 if (!b || !(account = purple_buddy_get_account(b)) ||
384 !(gc = purple_account_get_connection(account)) || !(qd = gc->proto_data)) 384 !(gc = purple_account_get_connection(account)) ||
385 !(qd = purple_connection_get_protocol_data(gc)))
385 return NULL; 386 return NULL;
386 387
387 buddy = (qq_buddy_data *)b->proto_data; 388 buddy = purple_buddy_get_protocol_data(b);
388 if (!buddy) { 389 if (!buddy) {
389 return "not-authorized"; 390 return "not-authorized";
390 } 391 }
391 392
392 if (buddy->comm_flag & QQ_COMM_FLAG_MOBILE) 393 if (buddy->comm_flag & QQ_COMM_FLAG_MOBILE)
691 */ 692 */
692 693
693 static void action_chat_quit(PurpleBlistNode * node) 694 static void action_chat_quit(PurpleBlistNode * node)
694 { 695 {
695 PurpleChat *chat = (PurpleChat *)node; 696 PurpleChat *chat = (PurpleChat *)node;
696 PurpleConnection *gc = purple_account_get_connection(chat->account); 697 PurpleAccount *account = purple_chat_get_account(chat);
697 GHashTable *components = chat -> components; 698 PurpleConnection *gc = purple_account_get_connection(account);
699 GHashTable *components = purple_chat_get_components(chat);
698 gchar *num_str; 700 gchar *num_str;
699 guint32 room_id; 701 guint32 room_id;
700 702
701 g_return_if_fail(PURPLE_BLIST_NODE_IS_CHAT(node)); 703 g_return_if_fail(PURPLE_BLIST_NODE_IS_CHAT(node));
702 704
710 } 712 }
711 713
712 static void action_chat_get_info(PurpleBlistNode * node) 714 static void action_chat_get_info(PurpleBlistNode * node)
713 { 715 {
714 PurpleChat *chat = (PurpleChat *)node; 716 PurpleChat *chat = (PurpleChat *)node;
715 PurpleConnection *gc = purple_account_get_connection(chat->account); 717 PurpleAccount *account = purple_chat_get_account(chat);
716 GHashTable *components = chat -> components; 718 PurpleConnection *gc = purple_account_get_connection(account);
719 GHashTable *components = purple_chat_get_components(chat);
717 gchar *num_str; 720 gchar *num_str;
718 guint32 room_id; 721 guint32 room_id;
719 722
720 g_return_if_fail(PURPLE_BLIST_NODE_IS_CHAT(node)); 723 g_return_if_fail(PURPLE_BLIST_NODE_IS_CHAT(node));
721 724
798 PurpleConnection *gc; 801 PurpleConnection *gc;
799 802
800 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node)); 803 g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
801 804
802 buddy = (PurpleBuddy *) node; 805 buddy = (PurpleBuddy *) node;
803 gc = purple_account_get_connection(buddy->account); 806 gc = purple_account_get_connection(purple_buddy_get_account(buddy));
804 807
805 qq_add_buddy(gc, buddy, NULL); 808 qq_add_buddy(gc, buddy, NULL);
806 } 809 }
807 810
808 static GList *qq_buddy_menu(PurpleBuddy *buddy) 811 static GList *qq_buddy_menu(PurpleBuddy *buddy)
811 PurpleMenuAction *act; 814 PurpleMenuAction *act;
812 /* 815 /*
813 PurpleConnection *gc = purple_account_get_connection(buddy->account); 816 PurpleConnection *gc = purple_account_get_connection(buddy->account);
814 qq_data *qd = gc->proto_data; 817 qq_data *qd = gc->proto_data;
815 */ 818 */
816 qq_buddy_data *bd = (qq_buddy_data *)buddy->proto_data; 819 qq_buddy_data *bd = purple_buddy_get_protocol_data(buddy);
817 820
818 if (bd == NULL) { 821 if (bd == NULL) {
819 act = purple_menu_action_new(_("Add Buddy"), 822 act = purple_menu_action_new(_("Add Buddy"),
820 PURPLE_CALLBACK(qq_add_buddy_from_menu_cb), 823 PURPLE_CALLBACK(qq_add_buddy_from_menu_cb),
821 NULL, NULL); 824 NULL, NULL);