/soc/2013/ankitkv/gobjectification: 0d7682bdf828: Updated protoc...

Ankit Vani a at nevitus.org
Sat Sep 14 06:16:48 EDT 2013


Changeset: 0d7682bdf828343e37061c30373c8447c8150802
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-14 15:46 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/0d7682bdf828

Description:

Updated protocol iface calls

diffstat:

 finch/gntblist.c               |   16 ++--
 finch/gntconv.c                |    6 +-
 finch/gntroomlist.c            |    2 +-
 libpurple/account.c            |   22 +++---
 libpurple/blistnodetypes.c     |    6 +-
 libpurple/buddyicon.c          |    2 +-
 libpurple/buddylist.c          |    4 +-
 libpurple/connection.c         |   12 +-
 libpurple/conversation.c       |    2 +-
 libpurple/conversationtypes.c  |    2 +-
 libpurple/log.c                |    8 +-
 libpurple/plugins/log_reader.c |    4 +-
 libpurple/presence.c           |    2 +-
 libpurple/protocol.c           |  132 ++++++++++++++++++++--------------------
 libpurple/protocols.c          |   10 +-
 libpurple/protocols/irc/msgs.c |    2 +-
 libpurple/roomlist.c           |    6 +-
 libpurple/server.c             |   40 ++++++------
 libpurple/util.c               |    4 +-
 pidgin/gtkaccount.c            |    8 +-
 pidgin/gtkblist.c              |   32 ++++----
 pidgin/gtkconv.c               |   20 +++---
 pidgin/gtkroomlist.c           |    2 +-
 pidgin/gtkutils.c              |   10 +-
 pidgin/plugins/xmppconsole.c   |    2 +-
 25 files changed, 178 insertions(+), 178 deletions(-)

diffs (truncated from 1611 to 300 lines):

diff --git a/finch/gntblist.c b/finch/gntblist.c
--- a/finch/gntblist.c
+++ b/finch/gntblist.c
@@ -743,7 +743,7 @@ add_chat_cb(void *data, PurpleRequestFie
 
 	gc = purple_account_get_connection(account);
 	protocol = purple_connection_get_protocol(gc);
-	hash = purple_protocol_iface_chat_info_defaults(protocol, gc, name);
+	hash = purple_protocol_chat_iface_info_defaults(protocol, gc, name);
 
 	chat = purple_chat_new(account, name, hash);
 
@@ -1064,7 +1064,7 @@ append_proto_menu(GntMenu *menu, PurpleC
 	if(!protocol || !PURPLE_PROTOCOL_IMPLEMENTS(protocol, blist_node_menu))
 		return;
 
-	for(list = purple_protocol_iface_blist_node_menu(protocol, node); list;
+	for(list = purple_protocol_client_iface_blist_node_menu(protocol, node); list;
 			list = g_list_delete_link(list, list))
 	{
 		PurpleMenuAction *act = (PurpleMenuAction *) list->data;
@@ -1123,7 +1123,7 @@ chat_components_edit(PurpleBlistNode *se
 	purple_request_fields_add_group(fields, group);
 
 	gc = purple_account_get_connection(purple_chat_get_account(chat));
-	parts = purple_protocol_iface_chat_info(purple_connection_get_protocol(gc), gc);
+	parts = purple_protocol_chat_iface_info(purple_connection_get_protocol(gc), gc);
 
 	for (iter = parts; iter; iter = iter->next) {
 		pce = iter->data;
@@ -1286,7 +1286,7 @@ create_buddy_menu(GntMenu *menu, PurpleB
 	if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, send_file))
 	{
 		if (!PURPLE_PROTOCOL_IMPLEMENTS(protocol, can_receive_file) ||
-			purple_protocol_iface_can_receive_file(protocol, gc, purple_buddy_get_name(buddy)))
+			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);
 	}
@@ -1412,7 +1412,7 @@ static void showlog_cb(PurpleBlistNode *
 		account = purple_chat_get_account(c);
 		protocol = purple_protocols_find(purple_account_get_protocol_id(account));
 		if (protocol) {
-			name = purple_protocol_iface_get_chat_name(protocol, purple_chat_get_components(c));
+			name = purple_protocol_chat_iface_get_name(protocol, purple_chat_get_components(c));
 		}
 	} else if (PURPLE_IS_CONTACT(node)) {
 		finch_log_show_contact((PurpleContact *)node);
@@ -1734,7 +1734,7 @@ tooltip_for_buddy(PurpleBuddy *buddy, GS
 
 	protocol = purple_protocols_find(purple_account_get_protocol_id(account));
 	if (protocol) {
-		purple_protocol_iface_tooltip_text(protocol, buddy, user_info, full);
+		purple_protocol_client_iface_tooltip_text(protocol, buddy, user_info, full);
 	}
 
 	if (purple_prefs_get_bool("/finch/blist/idletime")) {
@@ -2489,7 +2489,7 @@ build_protocol_actions(GntMenuItem *item
 	GntMenuItem *menuitem;
 
 	gnt_menuitem_set_submenu(item, GNT_MENU(sub));
-	for (actions = purple_protocol_iface_get_actions(protocol, gc); actions;
+	for (actions = purple_protocol_client_iface_get_actions(protocol, gc); actions;
 			actions = g_list_delete_link(actions, actions)) {
 		if (actions->data) {
 			PurpleProtocolAction *action = actions->data;
@@ -2810,7 +2810,7 @@ join_chat_select_cb(gpointer data, Purpl
 	chat = purple_blist_find_chat(account, name);
 	if (chat == NULL) {
 		PurpleProtocol *protocol = purple_connection_get_protocol(gc);
-		hash = purple_protocol_iface_chat_info_defaults(protocol, gc, name);
+		hash = purple_protocol_chat_iface_info_defaults(protocol, gc, name);
 	} else {
 		hash = purple_chat_get_components(chat);
 	}
diff --git a/finch/gntconv.c b/finch/gntconv.c
--- a/finch/gntconv.c
+++ b/finch/gntconv.c
@@ -340,7 +340,7 @@ account_signed_on_off(PurpleConnection *
 			chat = find_chat_for_conversation(conv);
 			if (chat == NULL) {
 				PurpleProtocol *protocol = purple_connection_get_protocol(gc);
-				comps = purple_protocol_iface_chat_info_defaults(protocol, gc,
+				comps = purple_protocol_chat_iface_info_defaults(protocol, gc,
 						purple_conversation_get_name(conv));
 			} else {
 				comps = purple_chat_get_components(chat);
@@ -651,7 +651,7 @@ gg_create_menu(FinchConv *ggc)
 
 		if (protocol && PURPLE_PROTOCOL_IMPLEMENTS(protocol, send_file) &&
 				(!PURPLE_PROTOCOL_IMPLEMENTS(protocol, can_receive_file) ||
-					purple_protocol_iface_can_receive_file(protocol, gc,
+					purple_protocol_xfer_iface_can_receive(protocol, gc,
 					purple_conversation_get_name(ggc->active_conv)))) {
 			item = gnt_menuitem_new(_("Send File"));
 			gnt_menu_add_item(GNT_MENU(sub), item);
@@ -706,7 +706,7 @@ create_conv_from_userlist(GntWidget *wid
 
 	protocol = purple_connection_get_protocol(gc);
 	if (protocol)
-		realname = purple_protocol_iface_get_cuser_real_name(protocol, gc,
+		realname = purple_protocol_chat_iface_get_user_real_name(protocol, gc,
 				purple_chat_conversation_get_id(
 				PURPLE_CHAT_CONVERSATION(fc->active_conv)), name);
 
diff --git a/finch/gntroomlist.c b/finch/gntroomlist.c
--- a/finch/gntroomlist.c
+++ b/finch/gntroomlist.c
@@ -121,7 +121,7 @@ static void fl_add_chat(GntWidget *butto
 	protocol = purple_connection_get_protocol(gc);
 
 	if(protocol != NULL && PURPLE_PROTOCOL_IMPLEMENTS(protocol, roomlist_room_serialize))
-		name = purple_protocol_iface_roomlist_room_serialize(protocol, room);
+		name = purple_protocol_roomlist_iface_room_serialize(protocol, room);
 	else
 		name = g_strdup(purple_roomlist_room_get_name(room));
 
diff --git a/libpurple/account.c b/libpurple/account.c
--- a/libpurple/account.c
+++ b/libpurple/account.c
@@ -1013,7 +1013,7 @@ purple_account_set_public_alias(PurpleAc
 	protocol = purple_connection_get_protocol(gc);
 
 	if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, set_public_alias))
-		purple_protocol_iface_set_public_alias(protocol, gc, alias, success_cb, failure_cb);
+		purple_protocol_server_iface_set_public_alias(protocol, gc, alias, success_cb, failure_cb);
 	else if (failure_cb) {
 		struct public_alias_closure *closure =
 				g_new0(struct public_alias_closure, 1);
@@ -1051,7 +1051,7 @@ purple_account_get_public_alias(PurpleAc
 	protocol = purple_connection_get_protocol(gc);
 
 	if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, get_public_alias))
-		purple_protocol_iface_get_public_alias(protocol, gc, success_cb, failure_cb);
+		purple_protocol_server_iface_get_public_alias(protocol, gc, success_cb, failure_cb);
 	else if (failure_cb) {
 		struct public_alias_closure *closure =
 				g_new0(struct public_alias_closure, 1);
@@ -2210,7 +2210,7 @@ purple_account_add_buddy(PurpleAccount *
 		protocol = purple_connection_get_protocol(gc);
 
 	if (protocol != NULL)
-		purple_protocol_iface_add_buddy(protocol, gc, buddy,
+		purple_protocol_server_iface_add_buddy(protocol, gc, buddy,
 				purple_buddy_get_group(buddy), message);
 }
 
@@ -2233,12 +2233,12 @@ purple_account_add_buddies(PurpleAccount
 		}
 
 		if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, add_buddies))
-			purple_protocol_iface_add_buddies(protocol, gc, buddies, groups, message);
+			purple_protocol_server_iface_add_buddies(protocol, gc, buddies, groups, message);
 		else if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, add_buddy)) {
 			GList *curb = buddies, *curg = groups;
 
 			while ((curb != NULL) && (curg != NULL)) {
-				purple_protocol_iface_add_buddy(protocol, gc, curb->data, curg->data, message);
+				purple_protocol_server_iface_add_buddy(protocol, gc, curb->data, curg->data, message);
 				curb = curb->next;
 				curg = curg->next;
 			}
@@ -2259,7 +2259,7 @@ purple_account_remove_buddy(PurpleAccoun
 		protocol = purple_connection_get_protocol(gc);
 
 	if (protocol)
-		purple_protocol_iface_remove_buddy(protocol, gc, buddy, group);
+		purple_protocol_server_iface_remove_buddy(protocol, gc, buddy, group);
 }
 
 void
@@ -2273,7 +2273,7 @@ purple_account_remove_buddies(PurpleAcco
 
 	if (protocol) {
 		if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, remove_buddies))
-			purple_protocol_iface_remove_buddies(protocol, gc, buddies, groups);
+			purple_protocol_server_iface_remove_buddies(protocol, gc, buddies, groups);
 		else {
 			GList *curb = buddies;
 			GList *curg = groups;
@@ -2296,7 +2296,7 @@ purple_account_remove_group(PurpleAccoun
 		protocol = purple_connection_get_protocol(gc);
 
 	if (protocol)
-		purple_protocol_iface_remove_group(protocol, gc, group);
+		purple_protocol_server_iface_remove_group(protocol, gc, group);
 }
 
 void
@@ -2312,7 +2312,7 @@ purple_account_change_password(PurpleAcc
 		protocol = purple_connection_get_protocol(gc);
 
 	if (protocol)
-		purple_protocol_iface_change_passwd(protocol, gc, orig_pw, new_pw);
+		purple_protocol_server_iface_change_passwd(protocol, gc, orig_pw, new_pw);
 }
 
 gboolean purple_account_supports_offline_message(PurpleAccount *account, PurpleBuddy *buddy)
@@ -2331,7 +2331,7 @@ gboolean purple_account_supports_offline
 
 	if (!protocol)
 		return FALSE;
-	return purple_protocol_iface_offline_message(protocol, buddy);
+	return purple_protocol_client_iface_offline_message(protocol, buddy);
 }
 
 void
@@ -2880,7 +2880,7 @@ purple_account_constructed(GObject *obje
 
 	if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, status_types))
 		purple_account_set_status_types(account,
-				purple_protocol_iface_status_types(protocol, account));
+				purple_protocol_class_status_types(protocol, account));
 
 	priv->presence = PURPLE_PRESENCE(purple_account_presence_new(account));
 
diff --git a/libpurple/blistnodetypes.c b/libpurple/blistnodetypes.c
--- a/libpurple/blistnodetypes.c
+++ b/libpurple/blistnodetypes.c
@@ -633,7 +633,7 @@ purple_buddy_dispose(GObject *object)
 	 */
 	protocol = purple_protocols_find(purple_account_get_protocol_id(priv->account));
 	if (protocol)
-		purple_protocol_iface_buddy_free(protocol, buddy);
+		purple_protocol_client_iface_buddy_free(protocol, buddy);
 
 	/* Delete the node */
 	purple_buddy_icon_unref(priv->icon);
@@ -1121,7 +1121,7 @@ const char *purple_chat_get_name_only(Pu
 
 	if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, chat_info)) {
 		PurpleProtocolChatEntry *pce;
-		GList *parts = purple_protocol_iface_chat_info(protocol, purple_account_get_connection(priv->account));
+		GList *parts = purple_protocol_chat_iface_info(protocol, purple_account_get_connection(priv->account));
 		pce = parts->data;
 		ret = g_hash_table_lookup(priv->components, pce->identifier);
 		g_list_foreach(parts, (GFunc)g_free, NULL);
@@ -1532,7 +1532,7 @@ void purple_group_set_name(PurpleGroup *
 			}
 
 			if(PURPLE_PROTOCOL_IMPLEMENTS(protocol, rename_group)) {
-				purple_protocol_iface_rename_group(protocol, gc, old_name, source, buddies);
+				purple_protocol_server_iface_rename_group(protocol, gc, old_name, source, buddies);
 			} else {
 				GList *cur, *groups = NULL;
 
diff --git a/libpurple/buddyicon.c b/libpurple/buddyicon.c
--- a/libpurple/buddyicon.c
+++ b/libpurple/buddyicon.c
@@ -751,7 +751,7 @@ purple_buddy_icons_set_account_icon(Purp
 		protocol = purple_connection_get_protocol(gc);
 
 		if (protocol)
-			purple_protocol_iface_set_buddy_icon(protocol, gc, img);
+			purple_protocol_server_iface_set_buddy_icon(protocol, gc, img);
 	}
 
 	if (old_img)
diff --git a/libpurple/buddylist.c b/libpurple/buddylist.c
--- a/libpurple/buddylist.c
+++ b/libpurple/buddylist.c
@@ -1637,7 +1637,7 @@ purple_blist_find_chat(PurpleAccount *ac
 	protocol = purple_protocols_find(purple_account_get_protocol_id(account));
 
 	if (PURPLE_PROTOCOL_IMPLEMENTS(protocol, find_blist_chat))
-		return purple_protocol_iface_find_blist_chat(protocol, account, name);
+		return purple_protocol_client_iface_find_blist_chat(protocol, account, name);
 
 	normname = g_strdup(purple_normalize(account, name));
 	for (group = purplebuddylist->root; group != NULL; group = group->next) {
@@ -1649,7 +1649,7 @@ purple_blist_find_chat(PurpleAccount *ac
 				if (account != purple_chat_get_account(chat))
 					continue;
 
-				parts = purple_protocol_iface_chat_info(protocol, 
+				parts = purple_protocol_chat_iface_info(protocol, 
 					purple_account_get_connection(purple_chat_get_account(chat)));
 
 				pce = parts->data;
diff --git a/libpurple/connection.c b/libpurple/connection.c
--- a/libpurple/connection.c
+++ b/libpurple/connection.c
@@ -120,7 +120,7 @@ send_keepalive(gpointer data)
 	if ((time(NULL) - priv->last_received) < KEEPALIVE_INTERVAL)
 		return TRUE;
 
-	purple_protocol_iface_keepalive(priv->protocol, gc);
+	purple_protocol_server_iface_keepalive(priv->protocol, gc);
 
 	return TRUE;
 }
@@ -732,7 +732,7 @@ purple_connection_dispose(GObject *objec
 	purple_http_conn_cancel_all(gc);
 	purple_proxy_connect_cancel_with_handle(gc);
 
-	purple_protocol_iface_close(priv->protocol, gc);
+	purple_protocol_class_close_connection(priv->protocol, gc);
 
 	/* Clear out the proto data that was freed in the protocol's close method */
 	buddies = purple_blist_find_buddies(account, NULL);



More information about the Commits mailing list