# HG changeset patch
# Node ID 722405fbc49515ad2842da666997bab8dafc97be
# Parent  bcd046ee00edf3652560401c269be0664b1d0eff
diff --git a/libpurple/purpleconversationmember.c b/libpurple/purpleconversationmember.c
--- a/libpurple/purpleconversationmember.c
+++ b/libpurple/purpleconversationmember.c
@@ -28,6 +28,7 @@
 struct _PurpleConversationMember {
 	GObject parent;
 
+	PurpleBadges *badges;
 	PurpleContactInfo *contact_info;
 	PurpleTags *tags;
 
@@ -38,6 +39,7 @@
 
 enum {
 	PROP_0,
+	PROP_BADGES,
 	PROP_CONTACT_INFO,
 	PROP_TAGS,
 	PROP_TYPING_STATE,
@@ -120,6 +122,10 @@
 	PurpleConversationMember *member = PURPLE_CONVERSATION_MEMBER(obj);
 
 	switch(param_id) {
+	case PROP_BADGES:
+		g_value_set_object(value,
+		                   purple_conversation_member_get_badges(member));
+		break;
 	case PROP_CONTACT_INFO:
 		g_value_set_object(value,
 		                   purple_conversation_member_get_contact_info(member));
@@ -187,6 +193,7 @@
 purple_conversation_member_finalize(GObject *obj) {
 	PurpleConversationMember *member = PURPLE_CONVERSATION_MEMBER(obj);
 
+	g_clear_object(&member->badges);
 	g_clear_object(&member->tags);
 	g_clear_pointer(&member->nickname, g_free);
 
@@ -195,6 +202,7 @@
 
 static void
 purple_conversation_member_init(PurpleConversationMember *member) {
+	member->badges = purple_badges_new();
 	member->tags = purple_tags_new();
 }
 
@@ -208,6 +216,18 @@
 	obj_class->set_property = purple_conversation_member_set_property;
 
 	/**
+	 * PurpleConversationMember:badges:
+	 *
+	 * The badges for the member.
+	 *
+	 * Since: 3.0
+	 */
+	properties[PROP_BADGES] = g_param_spec_object(
+		"badges", NULL, NULL,
+		PURPLE_TYPE_BADGES,
+		G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
+	/**
 	 * PurpleConversationMember:contact-info:
 	 *
 	 * The contact info that this member is for.
@@ -289,6 +309,13 @@
 		NULL);
 }
 
+PurpleBadges *
+purple_conversation_member_get_badges(PurpleConversationMember *member) {
+	g_return_val_if_fail(PURPLE_IS_CONVERSATION_MEMBER(member), NULL);
+
+	return member->badges;
+}
+
 PurpleContactInfo *
 purple_conversation_member_get_contact_info(PurpleConversationMember *member) {
 	g_return_val_if_fail(PURPLE_IS_CONVERSATION_MEMBER(member), NULL);
diff --git a/libpurple/purpleconversationmember.h b/libpurple/purpleconversationmember.h
--- a/libpurple/purpleconversationmember.h
+++ b/libpurple/purpleconversationmember.h
@@ -30,6 +30,7 @@
 #include <glib.h>
 #include <glib-object.h>
 
+#include "purplebadges.h"
 #include "purplecontactinfo.h"
 #include "purpletags.h"
 #include "purpletyping.h"
@@ -74,6 +75,23 @@
 PurpleConversationMember *purple_conversation_member_new(PurpleContactInfo *info);
 
 /**
+ * purple_conversation_member_get_badges:
+ * @member: The instance.
+ *
+ * Gets the [class@Badges] from @conversation_member.
+ *
+ * This is generally used by user interfaces to display the badges, and
+ * protocols will update the badges as necessary. That said, nothing is
+ * stopping plugins from adding their own.
+ *
+ * Returns: (transfer none): The badges.
+ *
+ * Since: 3.0
+ */
+PURPLE_AVAILABLE_IN_3_0
+PurpleBadges *purple_conversation_member_get_badges(PurpleConversationMember *member);
+
+/**
  * purple_conversation_member_get_contact_info:
  * @conversation_member: The instance.
  *
diff --git a/libpurple/tests/test_conversation_member.c b/libpurple/tests/test_conversation_member.c
--- a/libpurple/tests/test_conversation_member.c
+++ b/libpurple/tests/test_conversation_member.c
@@ -55,6 +55,7 @@
 
 static void
 test_purple_conversation_member_properties(void) {
+	PurpleBadges *badges = NULL;
 	PurpleContactInfo *info = NULL;
 	PurpleContactInfo *info1 = NULL;
 	PurpleConversationMember *member = NULL;
@@ -78,6 +79,7 @@
 
 	/* Now use g_object_get to read all of the properties. */
 	g_object_get(member,
+		"badges", &badges,
 		"contact-info", &info1,
 		"name-for-display", &name_for_display,
 		"nickname", &nickname,
@@ -85,6 +87,9 @@
 		"typing-state", &typing_state,
 		NULL);
 
+	g_assert_true(PURPLE_IS_BADGES(badges));
+	g_clear_object(&badges);
+
 	g_assert_true(info1 == info);
 	g_clear_object(&info1);
 
