--- a/libpurple/protocols/novell/nmuserrecord.c Thu Feb 18 07:55:09 2021 -0600
+++ b/libpurple/protocols/novell/nmuserrecord.c Thu Feb 25 03:49:17 2021 -0600
@@ -40,12 +40,6 @@
@@ -454,10 +448,10 @@
nm_user_record_get_property(NMUserRecord * user_record, int index)
- NMProperty *property = NULL;
+ PurpleKeyValuePair *property = NULL; NMField *field = NULL, *fields, *locate;
if (user_record && user_record->fields) {
@@ -469,9 +463,8 @@
if (field && field->tag && field->ptr_value) {
- property = g_new0(NMProperty, 1);
- property->tag = g_strdup(field->tag);
- property->value = _get_attribute_value(field);
+ property = purple_key_value_pair_new_full( + field->tag, _get_attribute_value(field), g_free); @@ -479,33 +472,3 @@
-nm_release_property(NMProperty * property)
- g_free(property->value);
-nm_property_get_tag(NMProperty * property)
-nm_property_get_value(NMProperty * property)
- return property->value;
--- a/libpurple/protocols/novell/nmuserrecord.h Thu Feb 18 07:55:09 2021 -0600
+++ b/libpurple/protocols/novell/nmuserrecord.h Thu Feb 25 03:49:17 2021 -0600
@@ -24,7 +24,6 @@
typedef struct _NMUserRecord NMUserRecord;
-typedef struct _NMProperty NMProperty;
@@ -225,40 +224,14 @@
* Get an info property for the user record. The property must be released
- * by calling nm_release_property()
+ * by calling purple_key_value_pair_free() * @param user_record The user record
* @param index The index of the property to get (zero based)
-NMProperty *nm_user_record_get_property(NMUserRecord * user_record, int index);
- * Release a property object
- * @param property The property
-void nm_release_property(NMProperty * property);
- * Get the tag for the property
- * @param property The property
- * @return The tag of the property (i.e. "Email Address")
-const char *nm_property_get_tag(NMProperty * property);
- * Get the value for the property
- * @param property The property
- * @return The value of the property (i.e. "nobody@nowhere.com")
-const char *nm_property_get_value(NMProperty * property);
+PurpleKeyValuePair *nm_user_record_get_property(NMUserRecord * user_record, int index); * Copy a user record (deep copy). The dest user record must have already been
--- a/libpurple/protocols/novell/novell.c Thu Feb 18 07:55:09 2021 -0600
+++ b/libpurple/protocols/novell/novell.c Thu Feb 25 03:49:17 2021 -0600
@@ -1508,7 +1508,6 @@
PurpleNotifyUserInfo *user_info = purple_notify_user_info_new();
@@ -1529,16 +1528,16 @@
count = nm_user_record_get_property_count(user_record);
for (i = 0; i < count; i++) {
- property = nm_user_record_get_property(user_record, i);
+ PurpleKeyValuePair *property = nm_user_record_get_property(user_record, i); - tag = _map_property_tag(nm_property_get_tag(property));
- value = nm_property_get_value(property);
+ tag = _map_property_tag(property->key); + value = property->value; /* TODO: Check whether it's correct to call add_pair_html,
or if we should be using add_pair_plaintext */
purple_notify_user_info_add_pair_html(user_info, tag, value);
- nm_release_property(property);
+ purple_key_value_pair_free(property);