pidgin: 7602af90: Add purple_contact_get_contact_size().
andrew.victor at mxit.com
andrew.victor at mxit.com
Mon Oct 31 17:31:06 EDT 2011
----------------------------------------------------------------------
Revision: 7602af90be7836b5e42ae409d4745833e2d6141c
Parent: 75d46d336da2a157e05000cc532d4428b4d0e47c
Author: andrew.victor at mxit.com
Date: 10/31/11 16:35:39
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/7602af90be7836b5e42ae409d4745833e2d6141c
Changelog:
Add purple_contact_get_contact_size().
Changes against parent 75d46d336da2a157e05000cc532d4428b4d0e47c
patched ChangeLog.API
patched finch/gntblist.c
patched finch/plugins/grouping.c
patched libpurple/blist.c
patched libpurple/blist.h
patched pidgin/gtkdialogs.c
-------------- next part --------------
============================================================
--- libpurple/blist.c 15122c5352a467c02184a7ff116f41be9ac0417b
+++ libpurple/blist.c 378a9f59fb3533ce6bf64daebc62f78fbaa1a59e
@@ -1774,6 +1774,13 @@ void purple_contact_invalidate_priority_
contact->priority_valid = FALSE;
}
+int purple_contact_get_contact_size(PurpleContact *contact, gboolean offline)
+{
+ g_return_val_if_fail(contact != NULL, 0);
+
+ return offline ? contact->totalsize : contact->currentsize;
+}
+
PurpleGroup *purple_group_new(const char *name)
{
PurpleBlistUiOps *ops = purple_blist_get_ui_ops();
============================================================
--- libpurple/blist.h 111ff10b88666876e5c2407e406f07ef9ce6f631
+++ libpurple/blist.h e8112c0978fc5773f75801df4caf016b417b7eea
@@ -756,6 +756,15 @@ void purple_contact_invalidate_priority_
void purple_contact_invalidate_priority_buddy(PurpleContact *contact);
/**
+ * Determines the total size of a contact.
+ *
+ * @param contact The contact
+ * @param offline Count buddies in offline accounts
+ * @return The number of buddies in the contact
+ */
+int purple_contact_get_contact_size(PurpleContact *contact, gboolean offline);
+
+/**
* Removes a buddy from the buddy list and frees the memory allocated to it.
* This doesn't actually try to remove the buddy from the server list.
*
============================================================
--- ChangeLog.API a8a03881601760c6a306c90bb85965d7b7454103
+++ ChangeLog.API 6fce763da0852ce469c31bdd043f41fdc2bd7d92
@@ -18,6 +18,7 @@ version 3.0.0 (??/??/????):
* purple_conversation_set_ui_data
* purple_conversation_message_get_alias
* purple_conversation_message_get_conv
+ * purple_contact_get_contact_size
* purple_notify_searchresult_column_get_title
* purple_notify_searchresult_column_is_visible
* purple_notify_searchresult_column_set_visible
============================================================
--- pidgin/gtkdialogs.c d3eb8153e75bbf8edc44c26abca1a4e7d7dc9dbd
+++ pidgin/gtkdialogs.c 7167c02a23b1d82457e82c80127a93b823f849c4
@@ -1195,8 +1195,8 @@ pidgin_dialogs_remove_contact(PurpleCont
"want to continue?",
"You are about to remove the contact containing %s "
"and %d other buddies from your buddy list. Do you "
- "want to continue?", contact->totalsize - 1),
- purple_buddy_get_name(buddy), contact->totalsize - 1);
+ "want to continue?", purple_contact_get_contact_size(contact, TRUE) - 1),
+ purple_buddy_get_name(buddy), purple_contact_get_contact_size(contact, TRUE) - 1);
purple_request_action(contact, NULL, _("Remove Contact"), text, 0,
NULL, purple_contact_get_alias(contact), NULL,
============================================================
--- finch/gntblist.c d46b9027ee0fcf8d20d25e4f35a3611689edcc4e
+++ finch/gntblist.c 7b8217186c45988d367383f323edcaff89698033
@@ -1561,7 +1561,7 @@ finch_blist_remove_node_cb(PurpleBlistNo
if (PURPLE_BLIST_NODE_IS_CONTACT(node)) {
PurpleContact *c = (PurpleContact*)node;
name = purple_contact_get_alias(c);
- if (c->totalsize > 1)
+ if (purple_contact_get_contact_size(c, TRUE) > 1)
sec = _("Removing this contact will also remove all the buddies in the contact");
} else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
name = purple_buddy_get_name((PurpleBuddy*)node);
============================================================
--- finch/plugins/grouping.c 979625bb2b146dc972de28aac70f1b7e6ab0f1e0
+++ finch/plugins/grouping.c 3c36b74b7ffb1115158c9c4e4ee86e0d548a3ca9
@@ -54,7 +54,7 @@ static gboolean on_offline_can_add_node(
case PURPLE_BLIST_CONTACT_NODE:
{
PurpleContact *contact = (PurpleContact*)node;
- if (contact->currentsize > 0)
+ if (purple_contact_get_contact_size(contact, FALSE) > 0)
return TRUE;
return FALSE;
}
More information about the Commits
mailing list