soc.2009.transport: 7d8f5ee2: Updated libpurple patch
hanzz at soc.pidgin.im
hanzz at soc.pidgin.im
Sun Jul 26 12:45:46 EDT 2009
-----------------------------------------------------------------
Revision: 7d8f5ee27e6dbda8d07b972da6944fa25b313db2
Ancestor: b6db5e5b8fde5bb428b57d001e0954756108df97
Author: hanzz at soc.pidgin.im
Date: 2009-07-26T15:35:59
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/7d8f5ee27e6dbda8d07b972da6944fa25b313db2
Modified files:
patches/2-purple-abstract-blist-save.diff
ChangeLog:
Updated libpurple patch
-------------- next part --------------
============================================================
--- patches/2-purple-abstract-blist-save.diff e9c40c7d1f31ad4c3379f4f74f617d937f2caf45
+++ patches/2-purple-abstract-blist-save.diff 4fea2433d5069047b0837916b409ffae4a1bafcc
@@ -2,71 +2,39 @@
# old_revision [08979461f8fd9f122c665f3ee192c20788dd1bca]
#
# add_file "libpurple/blistsaving.c"
-# content [98baed84682e327e333fb87f21e9441eef010764]
+# content [bad281765af5a967831252ed8455d68f1ffef615]
#
# add_file "libpurple/blistsaving.h"
-# content [e571e125d589317871839e622c3ee946df8f266d]
+# content [1e9ad6bf7a255ed8d2111fc61944caa8aedc6ecc]
#
-# patch "finch/finch.c"
-# from [7de9b76dc4808a46137c007229f0210ea9ffd659]
-# to [5d6b5aaadc171f133d4ad6f6eb97ec42c715425e]
-#
-# patch "finch/gntaccount.c"
-# from [24d52150587c87297f848a21a98fe4488ad43cbb]
-# to [4067a68f59ea25675ede9b5bbe79ece2c985a7da]
-#
-# patch "finch/gntblist.c"
-# from [d7891e6e97a491a82f1e3baee278be83774087b0]
-# to [4e4e7efb0b05bf77aabcc21a0a74c31b17a61ede]
-#
# patch "libpurple/Makefile.am"
# from [22dfd64715e47d7c86458cd3686d2c7857fce25f]
# to [be1014b632e6314515ab53d482e2906833260098]
#
# patch "libpurple/account.c"
# from [f30d42673ff93f36740312dacb3ee1c876bf2936]
-# to [0e6b671fb591c61b5cb01909006266db929e7b99]
+# to [955dcdae8e3208724c11b848ed66f8144eea1bf5]
#
+# patch "libpurple/account.h"
+# from [9b08f5687265f22f391b0c71cb1631fd360b1681]
+# to [7da4ba14206cf1237f4df86e46afb0f9199c7463]
+#
# patch "libpurple/blist.c"
# from [880a4f22c97e117941e6d36767fd82cf322c0c91]
-# to [c84e7f646d0b84b3c692ddeeb017596ac572816f]
+# to [0a2c52fee11835228b32c82a28b55b45883b52fd]
#
# patch "libpurple/blist.h"
# from [9580da3d4ae9096b2e4b8cbb88ca57a84f03f901]
-# to [a5774f27060c7e8ad0e67dc536c1a566e46e001a]
+# to [963a9275946f159d188373d2444787bd7f7e00ed]
#
-# patch "libpurple/example/nullclient.c"
-# from [587f78d7b0f0c1d170ac1eac35d526ca62efa8f8]
-# to [4d496227427056c83a613c6abdcbd6634ee6e563]
-#
# patch "libpurple/privacy.c"
# from [5e9715a02d5433f53c7de47f703619bc84be82f5]
-# to [470a92591d021b1f71178640dfbd13c6dff73b54]
-#
-# patch "pidgin/gtkaccount.c"
-# from [f7bb182fa4fd2fb71894e9c2580c2ea1e64e84ae]
-# to [e99275271fde3c64d09ab6ec083cdfa0803acb42]
-#
-# patch "pidgin/gtkblist.c"
-# from [122e9ad802a1125cad575c5cea42bed04d7416f1]
-# to [80b0cb722f2803e37e5b2e2ecfee9c0f0f095e2e]
-#
-# patch "pidgin/gtkblist.h"
-# from [094332f5deb237f91ca4bd5f362bbbba2c4406fd]
-# to [3a78e84707ed0071a48763371f8c3c386f0daa25]
-#
-# patch "pidgin/gtkmain.c"
-# from [e8b5e9c5fa4c46fef1318293e9c3d96ac583d0c5]
-# to [f462a52c4f262cc8c78443009bdf20168cab867c]
-#
-# patch "pidgin/gtkprivacy.c"
-# from [0539636ae120a83ed054e2fc0defb5fc235fd35a]
-# to [61982de66d62ba27f59afbf2640fa4e8f221486a]
+# to [8afe566bde4b11a9b5426cf92aff781627c5e59c]
#
============================================================
---- libpurple/blistsaving.c 98baed84682e327e333fb87f21e9441eef010764
-+++ libpurple/blistsaving.c 98baed84682e327e333fb87f21e9441eef010764
-@@ -0,0 +1,573 @@
+--- libpurple/blistsaving.c bad281765af5a967831252ed8455d68f1ffef615
++++ libpurple/blistsaving.c bad281765af5a967831252ed8455d68f1ffef615
+@@ -0,0 +1,580 @@
+/* purple
+ *
+ * Purple is the legal property of its developers, whose names are too numerous
@@ -558,7 +526,7 @@
+
+
+void
-+purple_blist_load()
++purple_blist_load_from_file()
+{
+ xmlnode *purple, *blist, *privacy;
+
@@ -628,10 +596,10 @@
+}
+
+void
-+purple_blist_schedule_save()
++purple_blist_schedule_save_callback()
+{
+ PurpleBuddyList *blist = purple_get_blist();
-+ if (save_timer == 0)
++ if (save_timer == 0 && blist)
+ save_timer = purple_timeout_add_seconds(5, (GSourceFunc) save_cb, blist);
+}
+
@@ -640,10 +608,17 @@
+ purple_blist_schedule_save();
+}
+
++void
++purple_blist_save_account_callback(PurpleAccount *account)
++{
++ purple_blist_schedule_save();
++}
++
++
============================================================
---- libpurple/blistsaving.h e571e125d589317871839e622c3ee946df8f266d
-+++ libpurple/blistsaving.h e571e125d589317871839e622c3ee946df8f266d
-@@ -0,0 +1,47 @@
+--- libpurple/blistsaving.h 1e9ad6bf7a255ed8d2111fc61944caa8aedc6ecc
++++ libpurple/blistsaving.h 1e9ad6bf7a255ed8d2111fc61944caa8aedc6ecc
+@@ -0,0 +1,49 @@
+/**
+ * @file blistsaving.h Buddy List Saving API
+ * @ingroup core
@@ -677,7 +652,7 @@
+/**
+ * Loads the buddy list from ~/.purple/blist.xml.
+ */
-+void purple_blist_load(void);
++void purple_blist_load_from_file(void);
+
+/**
+ * Schedule a save of the blist.xml file. This is used by the privacy
@@ -686,53 +661,14 @@
+ * the buddy list is saved automatically, so you should not need to
+ * call this.
+ */
-+void purple_blist_schedule_save(void);
++void purple_blist_schedule_save_callback(void);
+
+void purple_blist_save_callback(PurpleBuddyList *blist, PurpleBlistNode *node);
+
++void purple_blist_save_account_callback(PurpleAccount *account);
++
+#endif
============================================================
---- finch/finch.c 7de9b76dc4808a46137c007229f0210ea9ffd659
-+++ finch/finch.c 5d6b5aaadc171f133d4ad6f6eb97ec42c715425e
-@@ -37,6 +37,7 @@
- #include "status.h"
- #include "util.h"
- #include "whiteboard.h"
-+#include "blistsaving.h"
-
- #include "gntdebug.h"
- #include "gntprefs.h"
-============================================================
---- finch/gntaccount.c 24d52150587c87297f848a21a98fe4488ad43cbb
-+++ finch/gntaccount.c 4067a68f59ea25675ede9b5bbe79ece2c985a7da
-@@ -44,6 +44,7 @@
- #include <plugin.h>
- #include <request.h>
- #include <savedstatuses.h>
-+#include <blistsaving.h>
-
- #include "gntaccount.h"
- #include "gntblist.h"
-@@ -160,6 +161,7 @@ save_account_cb(AccountEditDialog *dialo
- /* Protocol */
- purple_account_set_protocol_id(account, purple_plugin_get_id(plugin));
- purple_account_set_username(account, username->str);
-+ purple_blist_schedule_save();
- }
- g_string_free(username, TRUE);
-
-============================================================
---- finch/gntblist.c d7891e6e97a491a82f1e3baee278be83774087b0
-+++ finch/gntblist.c 4e4e7efb0b05bf77aabcc21a0a74c31b17a61ede
-@@ -37,6 +37,7 @@
- #include <status.h>
- #include <util.h>
- #include "debug.h"
-+#include "blistsaving.h"
-
- #include "gntbox.h"
- #include "gntcolors.h"
-============================================================
--- libpurple/Makefile.am 22dfd64715e47d7c86458cd3686d2c7857fce25f
+++ libpurple/Makefile.am be1014b632e6314515ab53d482e2906833260098
@@ -90,7 +90,8 @@ purple_coresources = \
@@ -757,21 +693,41 @@
============================================================
--- libpurple/account.c f30d42673ff93f36740312dacb3ee1c876bf2936
-+++ libpurple/account.c 0e6b671fb591c61b5cb01909006266db929e7b99
-@@ -1506,7 +1506,9 @@ purple_account_set_username(PurpleAccoun
++++ libpurple/account.c 955dcdae8e3208724c11b848ed66f8144eea1bf5
+@@ -40,6 +40,7 @@
+ #include "status.h"
+ #include "util.h"
+ #include "xmlnode.h"
++#include "blistsaving.h"
- /* if the name changes, we should re-write the buddy list
- * to disk with the new name */
-- purple_blist_schedule_save();
-+// TODO: We must do it somehow with new saving API... but I don't know how to do it...
-+// Maybe UI should do it before or after calling this function...
-+// purple_blist_schedule_save();
+ typedef struct
+ {
+@@ -2679,6 +2680,9 @@ purple_accounts_set_ui_ops(PurpleAccount
+ purple_accounts_set_ui_ops(PurpleAccountUiOps *ops)
+ {
+ account_ui_ops = ops;
++
++ if (!ops->save_account)
++ ops->save_account = purple_blist_save_account_callback;
}
- void
+ PurpleAccountUiOps *
============================================================
+--- libpurple/account.h 9b08f5687265f22f391b0c71cb1631fd360b1681
++++ libpurple/account.h 7da4ba14206cf1237f4df86e46afb0f9199c7463
+@@ -101,7 +101,8 @@ struct _PurpleAccountUiOps
+ */
+ void (*close_account_request)(void *ui_handle);
+
+- void (*_purple_reserved1)(void);
++ void (*save_account)(PurpleAccount *account);
++
+ void (*_purple_reserved2)(void);
+ void (*_purple_reserved3)(void);
+ void (*_purple_reserved4)(void);
+============================================================
--- libpurple/blist.c 880a4f22c97e117941e6d36767fd82cf322c0c91
-+++ libpurple/blist.c c84e7f646d0b84b3c692ddeeb017596ac572816f
++++ libpurple/blist.c 0a2c52fee11835228b32c82a28b55b45883b52fd
@@ -36,6 +36,7 @@
#include "util.h"
#include "value.h"
@@ -1317,7 +1273,25 @@
* Stuff *
*********************************************************************/
-@@ -958,7 +439,8 @@ void purple_blist_rename_buddy(PurpleBud
+@@ -714,6 +195,17 @@ void
+ }
+
+ void
++purple_blist_load(void)
++{
++ purple_blist_load_from_file();
++}
++
++void purple_blist_schedule_save(void)
++{
++ purple_blist_schedule_save_callback();
++}
++
++void
+ purple_set_blist(PurpleBuddyList *list)
+ {
+ purplebuddylist = list;
+@@ -958,7 +450,8 @@ void purple_blist_rename_buddy(PurpleBud
g_free(buddy->name);
buddy->name = g_strdup(name);
@@ -1327,7 +1301,7 @@
if (ops && ops->update)
ops->update(purplebuddylist, (PurpleBlistNode *)buddy);
-@@ -998,7 +480,8 @@ void purple_blist_alias_contact(PurpleCo
+@@ -998,7 +491,8 @@ void purple_blist_alias_contact(PurpleCo
g_free(new_alias); /* could be "\0" */
}
@@ -1337,7 +1311,7 @@
if (ops && ops->update)
ops->update(purplebuddylist, (PurpleBlistNode *)contact);
-@@ -1043,7 +526,8 @@ void purple_blist_alias_chat(PurpleChat
+@@ -1043,7 +537,8 @@ void purple_blist_alias_chat(PurpleChat
g_free(new_alias); /* could be "\0" */
}
@@ -1347,7 +1321,7 @@
if (ops && ops->update)
ops->update(purplebuddylist, (PurpleBlistNode *)chat);
-@@ -1079,7 +563,8 @@ void purple_blist_alias_buddy(PurpleBudd
+@@ -1079,7 +574,8 @@ void purple_blist_alias_buddy(PurpleBudd
g_free(new_alias); /* could be "\0" */
}
@@ -1357,7 +1331,7 @@
if (ops && ops->update)
ops->update(purplebuddylist, (PurpleBlistNode *)buddy);
-@@ -1120,7 +605,8 @@ void purple_blist_server_alias_buddy(Pur
+@@ -1120,7 +616,8 @@ void purple_blist_server_alias_buddy(Pur
g_free(new_alias); /* could be "\0"; */
}
@@ -1367,7 +1341,7 @@
if (ops && ops->update)
ops->update(purplebuddylist, (PurpleBlistNode *)buddy);
-@@ -1214,7 +700,8 @@ void purple_blist_rename_group(PurpleGro
+@@ -1214,7 +711,8 @@ void purple_blist_rename_group(PurpleGro
}
/* Save our changes */
@@ -1377,7 +1351,7 @@
/* Update the UI */
if (ops && ops->update)
-@@ -1473,7 +960,8 @@ void purple_blist_add_chat(PurpleChat *c
+@@ -1473,7 +971,8 @@ void purple_blist_add_chat(PurpleChat *c
if (ops && ops->new_node)
ops->new_node(cnode);
@@ -1387,7 +1361,7 @@
}
if (node != NULL) {
-@@ -1502,7 +990,8 @@ void purple_blist_add_chat(PurpleChat *c
+@@ -1502,7 +1001,8 @@ void purple_blist_add_chat(PurpleChat *c
}
}
@@ -1397,7 +1371,7 @@
if (ops && ops->update)
ops->update(purplebuddylist, (PurpleBlistNode *)cnode);
-@@ -1580,8 +1069,6 @@ void purple_blist_add_buddy(PurpleBuddy
+@@ -1580,8 +1080,6 @@ void purple_blist_add_buddy(PurpleBuddy
if (ops && ops->remove)
ops->remove(purplebuddylist, bnode);
@@ -1406,7 +1380,7 @@
if (bnode->parent->parent != (PurpleBlistNode*)g) {
hb = g_new(struct _purple_hbuddy, 1);
hb->name = g_strdup(purple_normalize(buddy->account, buddy->name));
-@@ -1649,7 +1136,8 @@ void purple_blist_add_buddy(PurpleBuddy
+@@ -1649,7 +1147,8 @@ void purple_blist_add_buddy(PurpleBuddy
purple_contact_invalidate_priority_buddy(purple_buddy_get_contact(buddy));
@@ -1416,17 +1390,17 @@
if (ops && ops->update)
ops->update(purplebuddylist, (PurpleBlistNode*)buddy);
-@@ -1868,7 +1356,8 @@ void purple_blist_add_contact(PurpleCont
+@@ -1868,7 +1367,8 @@ void purple_blist_add_contact(PurpleCont
if (ops && ops->remove)
ops->remove(purplebuddylist, cnode);
- purple_blist_schedule_save();
-+ if (ops && ops->delete_node)
-+ ops->delete_node(purplebuddylist, (PurpleBlistNode*) cnode);
++ if (ops && ops->remove_node)
++ ops->remove_node(purplebuddylist, (PurpleBlistNode*) cnode);
}
if (node && (PURPLE_BLIST_NODE_IS_CONTACT(node) ||
-@@ -1894,7 +1383,13 @@ void purple_blist_add_contact(PurpleCont
+@@ -1894,7 +1394,13 @@ void purple_blist_add_contact(PurpleCont
g->currentsize++;
g->totalsize++;
@@ -1441,7 +1415,7 @@
if (ops && ops->update)
{
-@@ -1989,7 +1484,11 @@ void purple_blist_add_group(PurpleGroup
+@@ -1989,7 +1495,11 @@ void purple_blist_add_group(PurpleGroup
purplebuddylist->root = gnode;
}
@@ -1454,7 +1428,7 @@
if (ops && ops->update) {
ops->update(purplebuddylist, gnode);
-@@ -2035,12 +1534,13 @@ void purple_blist_remove_contact(PurpleC
+@@ -2035,12 +1545,13 @@ void purple_blist_remove_contact(PurpleC
if (node->next)
node->next->prev = node->prev;
@@ -1464,13 +1438,13 @@
if (ops && ops->remove)
ops->remove(purplebuddylist, node);
-+ if (ops && ops->delete_node)
-+ ops->delete_node(purplebuddylist, (PurpleBlistNode*) node);
++ if (ops && ops->remove_node)
++ ops->remove_node(purplebuddylist, (PurpleBlistNode*) node);
+
purple_signal_emit(purple_blist_get_handle(), "blist-node-removed",
PURPLE_BLIST_NODE(contact));
-@@ -2096,8 +1596,6 @@ void purple_blist_remove_buddy(PurpleBud
+@@ -2096,8 +1607,6 @@ void purple_blist_remove_buddy(PurpleBud
}
}
@@ -1479,17 +1453,17 @@
/* Remove this buddy from the buddies hash table */
hb.name = g_strdup(purple_normalize(buddy->account, buddy->name));
hb.account = buddy->account;
-@@ -2113,6 +1611,9 @@ void purple_blist_remove_buddy(PurpleBud
+@@ -2113,6 +1622,9 @@ void purple_blist_remove_buddy(PurpleBud
if (ops && ops->remove)
ops->remove(purplebuddylist, node);
-+ if (ops && ops->delete_node)
-+ ops->delete_node(purplebuddylist, (PurpleBlistNode*) node);
++ if (ops && ops->remove_node)
++ ops->remove_node(purplebuddylist, (PurpleBlistNode*) node);
+
/* Signal that the buddy has been removed before freeing the memory for it */
purple_signal_emit(purple_blist_get_handle(), "buddy-removed", buddy);
-@@ -2155,13 +1656,15 @@ void purple_blist_remove_chat(PurpleChat
+@@ -2155,13 +1667,15 @@ void purple_blist_remove_chat(PurpleChat
}
group->totalsize--;
@@ -1500,13 +1474,13 @@
if (ops && ops->remove)
ops->remove(purplebuddylist, node);
-+ if (ops && ops->delete_node)
-+ ops->delete_node(purplebuddylist, (PurpleBlistNode*) node);
++ if (ops && ops->remove_node)
++ ops->remove_node(purplebuddylist, (PurpleBlistNode*) node);
+
purple_signal_emit(purple_blist_get_handle(), "blist-node-removed",
PURPLE_BLIST_NODE(chat));
-@@ -2191,12 +1694,13 @@ void purple_blist_remove_group(PurpleGro
+@@ -2191,12 +1705,13 @@ void purple_blist_remove_group(PurpleGro
if (node->next)
node->next->prev = node->prev;
@@ -1516,13 +1490,13 @@
if (ops && ops->remove)
ops->remove(purplebuddylist, node);
-+ if (ops && ops->delete_node)
-+ ops->delete_node(purplebuddylist, (PurpleBlistNode*) node);
++ if (ops && ops->remove_node)
++ ops->remove_node(purplebuddylist, (PurpleBlistNode*) node);
+
purple_signal_emit(purple_blist_get_handle(), "blist-node-removed",
PURPLE_BLIST_NODE(group));
-@@ -2808,13 +2312,16 @@ void purple_blist_node_remove_setting(Pu
+@@ -2808,13 +2323,16 @@ void purple_blist_node_remove_setting(Pu
void purple_blist_node_remove_setting(PurpleBlistNode *node, const char *key)
{
@@ -1540,7 +1514,7 @@
}
void
-@@ -2844,6 +2351,7 @@ purple_blist_node_set_bool(PurpleBlistNo
+@@ -2844,6 +2362,7 @@ purple_blist_node_set_bool(PurpleBlistNo
purple_blist_node_set_bool(PurpleBlistNode* node, const char *key, gboolean data)
{
PurpleValue *value;
@@ -1548,7 +1522,7 @@
g_return_if_fail(node != NULL);
g_return_if_fail(node->settings != NULL);
-@@ -2854,7 +2362,9 @@ purple_blist_node_set_bool(PurpleBlistNo
+@@ -2854,7 +2373,9 @@ purple_blist_node_set_bool(PurpleBlistNo
g_hash_table_replace(node->settings, g_strdup(key), value);
@@ -1559,7 +1533,7 @@
}
gboolean
-@@ -2880,6 +2390,7 @@ purple_blist_node_set_int(PurpleBlistNod
+@@ -2880,6 +2401,7 @@ purple_blist_node_set_int(PurpleBlistNod
purple_blist_node_set_int(PurpleBlistNode* node, const char *key, int data)
{
PurpleValue *value;
@@ -1567,7 +1541,7 @@
g_return_if_fail(node != NULL);
g_return_if_fail(node->settings != NULL);
-@@ -2890,7 +2401,9 @@ purple_blist_node_set_int(PurpleBlistNod
+@@ -2890,7 +2412,9 @@ purple_blist_node_set_int(PurpleBlistNod
g_hash_table_replace(node->settings, g_strdup(key), value);
@@ -1578,7 +1552,7 @@
}
int
-@@ -2916,6 +2429,7 @@ purple_blist_node_set_string(PurpleBlist
+@@ -2916,6 +2440,7 @@ purple_blist_node_set_string(PurpleBlist
purple_blist_node_set_string(PurpleBlistNode* node, const char *key, const char *data)
{
PurpleValue *value;
@@ -1586,7 +1560,7 @@
g_return_if_fail(node != NULL);
g_return_if_fail(node->settings != NULL);
-@@ -2926,7 +2440,9 @@ purple_blist_node_set_string(PurpleBlist
+@@ -2926,7 +2451,9 @@ purple_blist_node_set_string(PurpleBlist
g_hash_table_replace(node->settings, g_strdup(key), value);
@@ -1597,18 +1571,18 @@
}
const char *
-@@ -2981,6 +2497,10 @@ purple_blist_set_ui_ops(PurpleBlistUiOps
+@@ -2981,6 +2508,10 @@ purple_blist_set_ui_ops(PurpleBlistUiOps
purple_blist_set_ui_ops(PurpleBlistUiOps *ops)
{
blist_ui_ops = ops;
+ if (!ops->save_node)
+ ops->save_node = purple_blist_save_callback;
-+ if (!ops->delete_node)
-+ ops->delete_node = purple_blist_save_callback;
++ if (!ops->remove_node)
++ ops->remove_node = purple_blist_save_callback;
}
PurpleBlistUiOps *
-@@ -3100,13 +2620,13 @@ purple_blist_uninit(void)
+@@ -3100,13 +2631,13 @@ purple_blist_uninit(void)
/* This happens if we quit before purple_set_blist is called. */
if (purplebuddylist == NULL)
return;
@@ -1630,7 +1604,7 @@
next_node = node->next;
============================================================
--- libpurple/blist.h 9580da3d4ae9096b2e4b8cbb88ca57a84f03f901
-+++ libpurple/blist.h a5774f27060c7e8ad0e67dc536c1a566e46e001a
++++ libpurple/blist.h 963a9275946f159d188373d2444787bd7f7e00ed
@@ -216,8 +216,12 @@ struct _PurpleBlistUiOps
const char *alias, const char *name);
void (*request_add_group)(void);
@@ -1640,13 +1614,34 @@
+ void (*save_node)(PurpleBuddyList *blist,
+ PurpleBlistNode *node);
+
-+ void (*delete_node)(PurpleBuddyList *blist,
++ void (*remove_node)(PurpleBuddyList *blist,
+ PurpleBlistNode *node);
+
void (*_purple_reserved3)(void);
void (*_purple_reserved4)(void);
};
-@@ -1002,20 +1006,6 @@ int purple_blist_get_group_online_count(
+@@ -239,6 +243,20 @@ PurpleBuddyList *purple_blist_new(void);
+ PurpleBuddyList *purple_blist_new(void);
+
+ /**
++ * Loads the buddy list from ~/.purple/blist.xml.
++ */
++void purple_blist_load(void);
++
++/**
++ * Schedule a save of the blist.xml file. This is used by the privacy
++ * API whenever the privacy settings are changed. If you make a change
++ * to blist.xml using one of the functions in the buddy list API, then
++ * the buddy list is saved automatically, so you should not need to
++ * call this.
++ */
++void purple_blist_schedule_save(void);
++
++/**
+ * Sets the main buddy list.
+ *
+ * @param blist The buddy list you want to use.
+@@ -1002,20 +1020,6 @@ int purple_blist_get_group_online_count(
/****************************************************************************************/
/**
@@ -1668,156 +1663,83 @@
* buddy list.
*
============================================================
---- libpurple/example/nullclient.c 587f78d7b0f0c1d170ac1eac35d526ca62efa8f8
-+++ libpurple/example/nullclient.c 4d496227427056c83a613c6abdcbd6634ee6e563
-@@ -212,7 +212,7 @@ init_libpurple(void)
-
- /* Create and load the buddylist. */
- purple_set_blist(purple_blist_new());
-- purple_blist_load();
-+// purple_blist_load();
-
- /* Load the preferences. */
- purple_prefs_load();
-============================================================
--- libpurple/privacy.c 5e9715a02d5433f53c7de47f703619bc84be82f5
-+++ libpurple/privacy.c 470a92591d021b1f71178640dfbd13c6dff73b54
-@@ -62,7 +62,8 @@ purple_privacy_permit_add(PurpleAccount
++++ libpurple/privacy.c 8afe566bde4b11a9b5426cf92aff781627c5e59c
+@@ -35,6 +35,7 @@ purple_privacy_permit_add(PurpleAccount
+ GSList *l;
+ char *name;
+ PurpleBuddy *buddy;
++ PurpleAccountUiOps *ui_ops;
+
+ g_return_val_if_fail(account != NULL, FALSE);
+ g_return_val_if_fail(who != NULL, FALSE);
+@@ -62,7 +63,9 @@ purple_privacy_permit_add(PurpleAccount
if (privacy_ops != NULL && privacy_ops->permit_added != NULL)
privacy_ops->permit_added(account, who);
- purple_blist_schedule_save();
-+ // UI should save privacy settings in permit_added callback
-+// purple_blist_schedule_save();
++ ui_ops = purple_accounts_get_ui_ops();
++ if (ui_ops != NULL && ui_ops->save_account != NULL)
++ ui_ops->save_account(account);
/* This lets the UI know a buddy has had its privacy setting changed */
buddy = purple_find_buddy(account, name);
-@@ -109,7 +110,8 @@ purple_privacy_permit_remove(PurpleAccou
+@@ -81,6 +84,7 @@ purple_privacy_permit_remove(PurpleAccou
+ const char *name;
+ PurpleBuddy *buddy;
+ char *del;
++ PurpleAccountUiOps *ui_ops;
+
+ g_return_val_if_fail(account != NULL, FALSE);
+ g_return_val_if_fail(who != NULL, FALSE);
+@@ -109,7 +113,9 @@ purple_privacy_permit_remove(PurpleAccou
if (privacy_ops != NULL && privacy_ops->permit_removed != NULL)
privacy_ops->permit_removed(account, who);
- purple_blist_schedule_save();
-+ // UI should do it in permit_removed callback
-+// purple_blist_schedule_save();
++ ui_ops = purple_accounts_get_ui_ops();
++ if (ui_ops != NULL && ui_ops->save_account != NULL)
++ ui_ops->save_account(account);
buddy = purple_find_buddy(account, name);
if (buddy != NULL) {
-@@ -154,7 +156,8 @@ purple_privacy_deny_add(PurpleAccount *a
+@@ -127,6 +133,7 @@ purple_privacy_deny_add(PurpleAccount *a
+ GSList *l;
+ char *name;
+ PurpleBuddy *buddy;
++ PurpleAccountUiOps *ui_ops;
+
+ g_return_val_if_fail(account != NULL, FALSE);
+ g_return_val_if_fail(who != NULL, FALSE);
+@@ -154,7 +161,9 @@ purple_privacy_deny_add(PurpleAccount *a
if (privacy_ops != NULL && privacy_ops->deny_added != NULL)
privacy_ops->deny_added(account, who);
- purple_blist_schedule_save();
-+// UI should do it in deny_added callback
-+// purple_blist_schedule_save();
++ ui_ops = purple_accounts_get_ui_ops();
++ if (ui_ops != NULL && ui_ops->save_account != NULL)
++ ui_ops->save_account(account);
buddy = purple_find_buddy(account, name);
if (buddy != NULL) {
-@@ -205,7 +208,8 @@ purple_privacy_deny_remove(PurpleAccount
+@@ -172,6 +181,7 @@ purple_privacy_deny_remove(PurpleAccount
+ const char *normalized;
+ char *name;
+ PurpleBuddy *buddy;
++ PurpleAccountUiOps *ui_ops;
+
+ g_return_val_if_fail(account != NULL, FALSE);
+ g_return_val_if_fail(who != NULL, FALSE);
+@@ -205,8 +215,11 @@ purple_privacy_deny_remove(PurpleAccount
}
g_free(name);
- purple_blist_schedule_save();
-+ // UI should save privacy settings in deny_removed callback
-+// purple_blist_schedule_save();
- return TRUE;
- }
-============================================================
---- pidgin/gtkaccount.c f7bb182fa4fd2fb71894e9c2580c2ea1e64e84ae
-+++ pidgin/gtkaccount.c e99275271fde3c64d09ab6ec083cdfa0803acb42
-@@ -39,6 +39,7 @@
- #include "savedstatuses.h"
- #include "signals.h"
- #include "util.h"
-+#include "blistsaving.h"
-
- #include "gtkaccount.h"
- #include "gtkblist.h"
-@@ -1318,6 +1319,7 @@ ok_account_prefs_cb(GtkWidget *w, Accoun
-
- purple_account_set_username(account, username);
- g_free(username);
-+ purple_blist_schedule_save();
-
- /* Add the protocol settings */
- if (dialog->prpl_info) {
-============================================================
---- pidgin/gtkblist.c 122e9ad802a1125cad575c5cea42bed04d7416f1
-+++ pidgin/gtkblist.c 80b0cb722f2803e37e5b2e2ecfee9c0f0f095e2e
-@@ -41,6 +41,7 @@
- #include "theme-loader.h"
- #include "theme-manager.h"
- #include "util.h"
-+#include "blistsaving.h"
-
- #include "gtkaccount.h"
- #include "gtkblist.h"
-============================================================
---- pidgin/gtkblist.h 094332f5deb237f91ca4bd5f362bbbba2c4406fd
-+++ pidgin/gtkblist.h 3a78e84707ed0071a48763371f8c3c386f0daa25
-@@ -153,6 +153,11 @@ void pidgin_blist_init(void);
- void pidgin_blist_init(void);
-
- /**
-+ * Loads the buddy list from ~/.purple/blist.xml.
-+ */
-+void pidgin_blist_load(void);
++ ui_ops = purple_accounts_get_ui_ops();
++ if (ui_ops != NULL && ui_ops->save_account != NULL)
++ ui_ops->save_account(account);
+
-+/**
- * Uninitializes the GTK+ blist system.
- */
- void pidgin_blist_uninit(void);
-@@ -165,6 +170,15 @@ PurpleBlistUiOps *pidgin_blist_get_ui_op
- PurpleBlistUiOps *pidgin_blist_get_ui_ops(void);
-
- /**
-+ * Schedule a save of the blist.xml file. This is used by the privacy
-+ * API whenever the privacy settings are changed. If you make a change
-+ * to blist.xml using one of the functions in the buddy list API, then
-+ * the buddy list is saved automatically, so you should not need to
-+ * call this.
-+ */
-+void pidgin_blist_schedule_save(void);
-+
-+/**
- * Returns the default gtk buddy list
- *
- * There's normally only one buddy list window, but that isn't a necessity. This function
-============================================================
---- pidgin/gtkmain.c e8b5e9c5fa4c46fef1318293e9c3d96ac583d0c5
-+++ pidgin/gtkmain.c f462a52c4f262cc8c78443009bdf20168cab867c
-@@ -41,6 +41,7 @@
- #include "status.h"
- #include "util.h"
- #include "whiteboard.h"
-+#include "blistsaving.h"
-
- #include "gtkaccount.h"
- #include "gtkblist.h"
-============================================================
---- pidgin/gtkprivacy.c 0539636ae120a83ed054e2fc0defb5fc235fd35a
-+++ pidgin/gtkprivacy.c 61982de66d62ba27f59afbf2640fa4e8f221486a
-@@ -31,6 +31,7 @@
- #include "privacy.h"
- #include "request.h"
- #include "util.h"
-+#include "blistsaving.h"
-
- #include "gtkblist.h"
- #include "gtkprivacy.h"
-@@ -573,6 +574,7 @@ pidgin_permit_added_removed(PurpleAccoun
- {
- if (privacy_dialog != NULL)
- rebuild_allow_list(privacy_dialog);
-+ purple_blist_schedule_save();
+ return TRUE;
}
- static void
-@@ -580,6 +582,7 @@ pidgin_deny_added_removed(PurpleAccount
- {
- if (privacy_dialog != NULL)
- rebuild_block_list(privacy_dialog);
-+ purple_blist_schedule_save();
- }
-
- static PurplePrivacyUiOps privacy_ops =
More information about the Commits
mailing list