cpw.nader.asynclogging-3: 08f0ec49: Fixed up gntblist to account for the new...

morshed.nader at gmail.com morshed.nader at gmail.com
Fri Jan 14 00:31:59 EST 2011


----------------------------------------------------------------------
Revision: 08f0ec49f9569717f0850a7d3c7f82b4c5e71084
Parent:   9491c476c58f8a95dbfd670b349316b38e0b5b22
Author:   morshed.nader at gmail.com
Date:     01/13/11 23:52:40
Branch:   im.pidgin.cpw.nader.asynclogging-3
URL: http://d.pidgin.im/viewmtn/revision/info/08f0ec49f9569717f0850a7d3c7f82b4c5e71084

Changelog: 

Fixed up gntblist to account for the new logging API changes

Changes against parent 9491c476c58f8a95dbfd670b349316b38e0b5b22

  patched  finch/gntblist.c
  patched  finch/gntlog.c
  patched  finch/gntlog.h

-------------- next part --------------
============================================================
--- finch/gntblist.c	9e21aaef31baacd8331062abbcf2c14e34bbb711
+++ finch/gntblist.c	133535b5f28db02517258390616c80dea9bcf48b
@@ -1452,19 +1452,19 @@ static void showlog_cb(PurpleBlistNode *
 
 static void showlog_cb(PurpleBlistNode *sel, PurpleBlistNode *node)
 {
-	PurpleLogType type;
+	PurpleLogChatType chat_type;
 	PurpleAccount *account;
 	char *name = NULL;
 
 	if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
 		PurpleBuddy *b = (PurpleBuddy*) node;
-		type = PURPLE_LOG_IM;
+		chat_type = PURPLE_LOG_IM;
 		name = g_strdup(purple_buddy_get_name(b));
 		account = purple_buddy_get_account(b);
 	} else if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
 		PurpleChat *c = (PurpleChat*) node;
 		PurplePluginProtocolInfo *prpl_info = NULL;
-		type = PURPLE_LOG_CHAT;
+		chat_type = PURPLE_LOG_CHAT;
 		account = purple_chat_get_account(c);
 		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(account)));
 		if (prpl_info && prpl_info->get_chat_name) {
@@ -1480,7 +1480,7 @@ static void showlog_cb(PurpleBlistNode *
 	}
 
 	if (name && account) {
-		finch_log_show(type, name, account);
+		finch_log_show(chat_type, name, account);
 		g_free(name);
 	}
 }
@@ -2466,7 +2466,7 @@ get_contact_log_size(PurpleBlistNode *c)
 
 	for (node = purple_blist_node_get_first_child(c); node; node = purple_blist_node_get_sibling_next(node)) {
 		PurpleBuddy *b = (PurpleBuddy*)node;
-		log += purple_log_get_total_size(PURPLE_LOG_IM, purple_buddy_get_name(b),
+		log += purple_logs_get_total_size(PURPLE_LOG_IM, purple_buddy_get_name(b),
 				purple_buddy_get_account(b));
 	}
 
@@ -2486,8 +2486,8 @@ blist_node_compare_log(PurpleBlistNode *
 		case PURPLE_BLIST_BUDDY_NODE:
 			b1 = (PurpleBuddy*)n1;
 			b2 = (PurpleBuddy*)n2;
-			ret = purple_log_get_total_size(PURPLE_LOG_IM, purple_buddy_get_name(b2), purple_buddy_get_account(b2)) -
-					purple_log_get_total_size(PURPLE_LOG_IM, purple_buddy_get_name(b1), purple_buddy_get_account(b1));
+			ret = purple_logs_get_total_size(PURPLE_LOG_IM, purple_buddy_get_name(b2), purple_buddy_get_account(b2)) -
+					purple_logs_get_total_size(PURPLE_LOG_IM, purple_buddy_get_name(b1), purple_buddy_get_account(b1));
 			if (ret != 0)
 				return ret;
 			break;
============================================================
--- finch/gntlog.c	ed7282419ae6ff1bd595c802a14a6f00bd3d55ed
+++ finch/gntlog.c	210fe522065d96c130eb4dbe22d3f9b399457bb3
@@ -79,7 +79,7 @@ typedef struct {
 typedef struct {
 	PurpleAccount *account;
 	PurpleContact *contact;
-	PurpleLogType type;
+	PurpleLogChatType chat_type;
 	gchar *username;
 } log_viewer_hash_t;
 
@@ -823,7 +823,7 @@ void
 }
 
 void
-finch_log_show(PurpleLogType type, const gchar *username, PurpleAccount *account)
+finch_log_show(PurpleLogChatType chat_type, const gchar *username, PurpleAccount *account)
 {
 	log_viewer_hash_t *ht;
 	_finch_log_data *finch_log_data;
@@ -832,14 +832,14 @@ finch_log_show(PurpleLogType type, const
 	const gchar *name = username;
 	gchar *title;
 
-	if (type != PURPLE_LOG_IM) {
+	if (chat_type != PURPLE_LOG_IM) {
 		g_return_if_fail(account != NULL);
 		g_return_if_fail(username != NULL);
 	}
 
 	ht = g_new0(log_viewer_hash_t, 1);
 
-	ht->type = type;
+	ht->chat_type = chat_type;
 	ht->username = g_strdup(username);
 	ht->account = account;
 
@@ -890,15 +890,15 @@ finch_log_show(PurpleLogType type, const
 	if (username != NULL) {
 		finch_log_data->count = finch_log_data->total = 2;
 
-		purple_log_get_logs_async(type, username, account,
+		purple_logs_get_logs_async(chat_type, username, account,
 			G_PRIORITY_DEFAULT, cancel, finch_log_list_cb, finch_log_data);
-		purple_log_get_total_size_async(type, username, account,
+		purple_logs_get_total_size_async(chat_type, username, account,
 			G_PRIORITY_DEFAULT, cancel, finch_log_size_cb, finch_log_data);
 	} else {
 		/* This will happen only for IMs */
 		finch_log_data->count = finch_log_data->total = 1;
 
-		purple_log_get_log_sets_async(G_PRIORITY_DEFAULT, cancel,
+		purple_logs_get_log_sets_async(G_PRIORITY_DEFAULT, cancel,
 			finch_log_sets_cb, finch_log_data);
 	}
 
@@ -919,7 +919,7 @@ finch_log_show_contact(PurpleContact *co
 	g_return_if_fail(contact != NULL);
 
 	ht = g_new0(log_viewer_hash_t, 1);
-	ht->type = PURPLE_LOG_IM;
+	ht->chat_type = PURPLE_LOG_IM;
 	ht->contact = contact;
 
 	if (log_viewers == NULL)
============================================================
--- finch/gntlog.h	02f892c394bbc98990f9c0bbf5f58cd0a9ace230
+++ finch/gntlog.h	93c1a036b3b32630a8902d4c867abc96d2da8436
@@ -68,7 +68,7 @@ G_BEGIN_DECLS
  * @param username:    The buddy or chat name
  * @param account:     The account
  */
-void finch_log_show(PurpleLogType type, const gchar *username, PurpleAccount *account);
+void finch_log_show(PurpleLogChatType chat_type, const gchar *username, PurpleAccount *account);
 
 /**
  * Displays the logs for one contact


More information about the Commits mailing list