Sat, 14 Sep 2013 22:16:47 +0530
Refactored finch to use the new protocol API
| finch/gntaccount.c | file | annotate | diff | comparison | revisions | |
| finch/gntblist.c | file | annotate | diff | comparison | revisions | |
| finch/gntconv.c | file | annotate | diff | comparison | revisions | |
| finch/gntroomlist.c | file | annotate | diff | comparison | revisions |
--- a/finch/gntaccount.c Sat Sep 14 22:16:35 2013 +0530 +++ b/finch/gntaccount.c Sat Sep 14 22:16:47 2013 +0530 @@ -251,7 +251,7 @@ gnt_box_give_focus_to_child(GNT_BOX(accounts.window), accounts.tree); } - if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, register_user) && + if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER_IFACE, register_user) && gnt_check_box_get_checked(GNT_CHECK_BOX(dialog->regserver))) { purple_account_register(account); } else if (dialog->account == NULL) { @@ -484,7 +484,7 @@ /* Show the registration checkbox only in a new account dialog, * and when the selected protocol has the support for it. */ gnt_widget_set_visible(dialog->regserver, account == NULL && - PURPLE_PROTOCOL_IMPLEMENTS(protocol, register_user)); + PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER_IFACE, register_user)); } static void
--- a/finch/gntblist.c Sat Sep 14 22:16:35 2013 +0530 +++ b/finch/gntblist.c Sat Sep 14 22:16:47 2013 +0530 @@ -1061,7 +1061,7 @@ GList *list; PurpleProtocol *protocol = purple_connection_get_protocol(gc); - if(!protocol || !PURPLE_PROTOCOL_IMPLEMENTS(protocol, blist_node_menu)) + if(!protocol || !PURPLE_PROTOCOL_IMPLEMENTS(protocol, CLIENT_IFACE, blist_node_menu)) return; for(list = purple_protocol_client_iface_blist_node_menu(protocol, node); list; @@ -1274,7 +1274,7 @@ PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(buddy)); protocol = purple_connection_get_protocol(gc); - if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, get_info)) + if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER_IFACE, get_info)) { add_custom_action(menu, _("Get Info"), PURPLE_CALLBACK(finch_blist_get_buddy_info_cb), buddy); @@ -1283,9 +1283,9 @@ add_custom_action(menu, _("Add Buddy Pounce"), PURPLE_CALLBACK(finch_blist_pounce_node_cb), buddy); - if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, send_file)) + if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, XFER_IFACE, send)) { - if (!PURPLE_PROTOCOL_IMPLEMENTS(protocol, can_receive_file) || + if (!PURPLE_PROTOCOL_IMPLEMENTS(protocol, XFER_IFACE, can_receive) || purple_protocol_xfer_iface_can_receive(protocol, gc, purple_buddy_get_name(buddy))) add_custom_action(menu, _("Send File"), PURPLE_CALLBACK(finch_blist_menu_send_file_cb), buddy); @@ -2608,7 +2608,7 @@ continue; protocol = purple_connection_get_protocol(gc); - if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, get_actions)) { + if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, CLIENT_IFACE, get_actions)) { item = gnt_menuitem_new(purple_account_get_username(account)); gnt_menu_add_item(GNT_MENU(sub), item); build_protocol_actions(item, protocol, gc);
--- a/finch/gntconv.c Sat Sep 14 22:16:35 2013 +0530 +++ b/finch/gntconv.c Sat Sep 14 22:16:47 2013 +0530 @@ -639,7 +639,7 @@ PurpleProtocol *protocol = gc ? purple_connection_get_protocol(gc) : NULL; - if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, get_info)) { + if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, SERVER_IFACE, get_info)) { item = gnt_menuitem_new(_("Get Info")); gnt_menu_add_item(GNT_MENU(sub), item); gnt_menuitem_set_callback(item, get_info_cb, ggc); @@ -649,8 +649,8 @@ gnt_menu_add_item(GNT_MENU(sub), item); gnt_menuitem_set_callback(item, add_pounce_cb, ggc); - if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, send_file) && - (!PURPLE_PROTOCOL_IMPLEMENTS(protocol, can_receive_file) || + if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, XFER_IFACE, send) && + (!PURPLE_PROTOCOL_IMPLEMENTS(protocol, XFER_IFACE, can_receive) || purple_protocol_xfer_iface_can_receive(protocol, gc, purple_conversation_get_name(ggc->active_conv)))) { item = gnt_menuitem_new(_("Send File"));
--- a/finch/gntroomlist.c Sat Sep 14 22:16:35 2013 +0530 +++ b/finch/gntroomlist.c Sat Sep 14 22:16:47 2013 +0530 @@ -120,7 +120,7 @@ protocol = purple_connection_get_protocol(gc); - if(protocol != NULL && PURPLE_PROTOCOL_IMPLEMENTS(protocol, roomlist_room_serialize)) + if(protocol != NULL && PURPLE_PROTOCOL_IMPLEMENTS(protocol, ROOMLIST_IFACE, room_serialize)) name = purple_protocol_roomlist_iface_room_serialize(protocol, room); else name = g_strdup(purple_roomlist_room_get_name(room)); @@ -242,7 +242,7 @@ protocol = purple_connection_get_protocol(gc); if (PURPLE_CONNECTION_IS_CONNECTED(gc) && - PURPLE_PROTOCOL_IMPLEMENTS(protocol, roomlist_get_list)) { + PURPLE_PROTOCOL_IMPLEMENTS(protocol, ROOMLIST_IFACE, get_list)) { PurpleAccount *account = purple_connection_get_account(gc); char *text = g_strdup_printf("%s (%s)", purple_account_get_username(account),