pidgin/pidgin

a836808f9c60
Parents fefb84b37fc4
Children a0108bfcb108
Load the tags for contacts in the demo protocol plugin

This was missed somehow when the demo protocol was converted to contact info.

Testing Done:
This was discovered and fixed while updating /r/2054 as there's no other way to easily check this stuff at the moment.

Reviewed at https://reviews.imfreedom.org/r/2460/
--- a/libpurple/protocols/demo/purpledemocontacts.c Tue May 23 00:23:33 2023 -0500
+++ b/libpurple/protocols/demo/purpledemocontacts.c Tue Jun 13 03:06:51 2023 -0500
@@ -248,6 +248,24 @@
}
}
+ /* Load the tags. */
+ if(json_object_has_member(contact_object, "tags")) {
+ PurpleTags *tags = purple_contact_info_get_tags(info);
+ JsonArray *array = NULL;
+ GList *elements = NULL;
+
+ array = json_object_get_array_member(contact_object, "tags");
+ elements = json_array_get_elements(array);
+ while(elements != NULL) {
+ JsonNode *tag_node = elements->data;
+ const char *tag = json_node_get_string(tag_node);
+
+ purple_tags_add(tags, tag);
+
+ elements = g_list_delete_link(elements, elements);
+ }
+ }
+
/* Load the person. */
if(json_object_has_member(contact_object, "person")) {
JsonObject *person_object = NULL;