gobjectification: e0ccd2c4: Apply some changes to the new split comp...

qulogic at pidgin.im qulogic at pidgin.im
Wed Jun 9 01:32:26 EDT 2010


-----------------------------------------------------------------
Revision: e0ccd2c4dace88a2dc380f76343b7770b2965f6b
Ancestor: 111ec6a77e9e523e8d77c5950d77a3019caa65cf
Author: qulogic at pidgin.im
Date: 2010-06-08T08:32:52
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/e0ccd2c4dace88a2dc380f76343b7770b2965f6b

Modified files:
        libpurple/blist.c libpurple/buddy.c libpurple/buddy.h
        libpurple/contact.c libpurple/contact.h

ChangeLog: 

Apply some changes to the new split components from blist.c.

-------------- next part --------------
============================================================
--- libpurple/blist.c	ab7bf3a43ef917b0f8825d95914c0fa5b38e4faf
+++ libpurple/blist.c	3089c7d58e583a7d5a822e1dfbc952adb248e1dd
@@ -1543,6 +1543,13 @@ purple_blist_class_init(PurpleBuddyListC
 										PURPLE_SUBTYPE_BLIST_NODE),
 						 purple_value_new(PURPLE_TYPE_STRING));
 
+	purple_signal_register(handle, "buddy-caps-changed",
+			purple_marshal_VOID__POINTER_INT_INT, NULL,
+			3, purple_value_new(PURPLE_TYPE_SUBTYPE,
+				PURPLE_SUBTYPE_BLIST_BUDDY),
+			purple_value_new(PURPLE_TYPE_INT),
+			purple_value_new(PURPLE_TYPE_INT));
+
 	purple_signal_connect(purple_accounts_get_handle(), "account-created",
 			handle,
 			PURPLE_CALLBACK(purple_blist_buddies_cache_add_account),
============================================================
--- libpurple/buddy.c	0a9c1dbf8aea8e6e3cd5dee999da3dd66c825b4d
+++ libpurple/buddy.c	ce6153ac11fcd41cf2aaea25c5528b8a907e8f81
@@ -40,9 +40,10 @@ struct _PurpleBuddyPrivate {
 	char *alias;                            /**< The user-set alias of the buddy */
 	char *server_alias;                     /**< The server-specified alias of the buddy.  (i.e. MSN "Friendly Names") */
 	void *proto_data;                       /**< This allows the prpl to associate whatever data it wants with a buddy */
-	PurpleBuddyIcon *icon;                    /**< The buddy icon. */
+	PurpleBuddyIcon *icon;                  /**< The buddy icon. */
 	PurpleAccount *account;					/**< the account this buddy belongs to */
 	PurplePresence *presence;
+	PurpleMediaCaps media_caps;             /**< The media capabilities of the buddy. */
 };
 
 void
@@ -429,6 +430,23 @@ PurplePresence *purple_buddy_get_presenc
 	return priv->presence;
 }
 
+PurpleMediaCaps purple_buddy_get_media_caps(const PurpleBuddy *buddy)
+{
+	PurpleBuddyPrivate *priv;
+	g_return_val_if_fail(buddy != NULL, 0);
+	priv = PURPLE_BUDDY_GET_PRIVATE(buddy);
+	return priv->media_caps;
+}
+
+void purple_buddy_set_media_caps(PurpleBuddy *buddy, PurpleMediaCaps media_caps)
+{
+	PurpleBuddyPrivate *priv;
+	g_return_if_fail(buddy != NULL);
+	priv = PURPLE_BUDDY_GET_PRIVATE(buddy);
+
+	priv->media_caps = media_caps;
+}
+
 xmlnode *
 buddy_to_xmlnode(PurpleBlistNode *bnode)
 {
============================================================
--- libpurple/buddy.h	67daa5de3d6958fa8a30943b169b3db50db329c5
+++ libpurple/buddy.h	6729830918de6ce3b5d4ce3d89b0b129e22bf5e3
@@ -35,6 +35,7 @@ typedef struct _PurpleBuddyClass PurpleB
 typedef struct _PurpleBuddyClass PurpleBuddyClass;
 
 #include "buddyicon.h"
+#include "media.h"
 #include "status.h"
 #include "group.h"
 
@@ -210,6 +211,24 @@ PurplePresence *purple_buddy_get_presenc
 PurplePresence *purple_buddy_get_presence(const PurpleBuddy *buddy);
 
 /**
+ * Gets the media caps from a buddy.
+ *
+ * @param buddy The buddy.
+ * @return      The media caps.
+ *
+ * @since 2.7.0
+ */
+PurpleMediaCaps purple_buddy_get_media_caps(const PurpleBuddy *buddy);
+
+/**
+ * Sets the media caps for a buddy.
+ *
+ * @param buddy      The PurpleBuddy.
+ * @param media_caps The PurpleMediaCaps.
+ */
+void purple_buddy_set_media_caps(PurpleBuddy *buddy, PurpleMediaCaps media_caps);
+
+/**
  * Get the GType for PurpleBuddy
  */
 GType purple_buddy_get_type(void);
============================================================
--- libpurple/contact.c	8d0ca9ba03589ec400d1f670e38fbc74974c1f4f
+++ libpurple/contact.c	4f5b91cc1efda96505a9075f0a539af516c9b152
@@ -303,6 +303,14 @@ purple_contact_destroy(PurpleContact *co
 	g_object_unref(G_OBJECT(contact));
 }
 
+PurpleGroup *
+purple_contact_get_group(const PurpleContact *contact)
+{
+	g_return_val_if_fail(contact, NULL);
+
+	return (PurpleGroup *)(((PurpleBlistNode *)contact)->parent);
+}
+
 const char *purple_contact_get_alias(PurpleContact* contact)
 {
 	PurpleContactPrivate *priv;
============================================================
--- libpurple/contact.h	ac6beea113177a8c9eebf9335d280152fd5555f8
+++ libpurple/contact.h	c13d6ad0b458b179a9a01d06f8967e4c7a2a3533
@@ -92,6 +92,16 @@ void purple_contact_destroy(PurpleContac
  */
 void purple_contact_destroy(PurpleContact *contact);
 
+/**
+ * Gets the PurpleGroup from a PurpleContact
+ *
+ * @param contact  The contact
+ * @return         The group
+ *
+ * @since 2.7.0
+ */
+PurpleGroup *purple_contact_get_group(const PurpleContact *contact);
+
 xmlnode *contact_to_xmlnode(PurpleBlistNode *cnode);
 void parse_contact(PurpleGroup *group, xmlnode *cnode);
 void purple_contact_compute_priority_buddy(PurpleContact *contact);


More information about the Commits mailing list