diff options
author | James Booth <boothj5@gmail.com> | 2013-08-26 14:52:14 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-08-26 14:52:14 +0100 |
commit | 080515fe85090d1fb1d7bbeec049755e228df790 (patch) | |
tree | 9db06e49352e275de151b22353644450ad03bd3a /src/xmpp | |
parent | 550071afded1464dc04cba856bed4687a8a968a4 (diff) | |
parent | 70bbc2e34474d9a466707d90c5d56666cf27b3ae (diff) | |
download | profani-tty-080515fe85090d1fb1d7bbeec049755e228df790.tar.gz |
Merge branch 'master' into otr
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/bookmark.c | 4 | ||||
-rw-r--r-- | src/xmpp/capabilities.c | 6 | ||||
-rw-r--r-- | src/xmpp/iq.c | 2 | ||||
-rw-r--r-- | src/xmpp/presence.c | 2 | ||||
-rw-r--r-- | src/xmpp/roster.c | 12 | ||||
-rw-r--r-- | src/xmpp/stanza.c | 4 |
6 files changed, 15 insertions, 15 deletions
diff --git a/src/xmpp/bookmark.c b/src/xmpp/bookmark.c index 92e6d7e8..0818f9ee 100644 --- a/src/xmpp/bookmark.c +++ b/src/xmpp/bookmark.c @@ -69,7 +69,7 @@ bookmark_add(const char *jid, const char *nick, gboolean autojoin) /* this may be command for modifying */ autocomplete_remove(bookmark_ac, jid); - autocomplete_add(bookmark_ac, strdup(jid)); + autocomplete_add(bookmark_ac, jid); } void @@ -174,7 +174,7 @@ _bookmark_handle_result(xmpp_conn_t * const conn, autojoin_val = FALSE; } - autocomplete_add(bookmark_ac, strdup(jid)); + autocomplete_add(bookmark_ac, jid); item = malloc(sizeof(*item)); item->jid = strdup(jid); item->nick = name; diff --git a/src/xmpp/capabilities.c b/src/xmpp/capabilities.c index 2b0a12e5..f38a2749 100644 --- a/src/xmpp/capabilities.c +++ b/src/xmpp/capabilities.c @@ -148,15 +148,15 @@ caps_create_sha1_str(xmpp_stanza_t * const query) g_string_append(identity_str, name); } g_string_append(identity_str, "<"); - identities = g_slist_insert_sorted(identities, g_strdup(identity_str->str), (GCompareFunc)octet_compare); + identities = g_slist_insert_sorted(identities, g_strdup(identity_str->str), (GCompareFunc)strcmp); g_string_free(identity_str, TRUE); } else if (g_strcmp0(xmpp_stanza_get_name(child), STANZA_NAME_FEATURE) == 0) { feature_str = xmpp_stanza_get_attribute(child, "var"); - features = g_slist_insert_sorted(features, g_strdup(feature_str), (GCompareFunc)octet_compare); + features = g_slist_insert_sorted(features, g_strdup(feature_str), (GCompareFunc)strcmp); } else if (g_strcmp0(xmpp_stanza_get_name(child), STANZA_NAME_X) == 0) { if (strcmp(xmpp_stanza_get_ns(child), STANZA_NS_DATA) == 0) { form = stanza_create_form(child); - form_names = g_slist_insert_sorted(form_names, g_strdup(form->form_type), (GCompareFunc)octet_compare); + form_names = g_slist_insert_sorted(form_names, g_strdup(form->form_type), (GCompareFunc)strcmp); g_hash_table_insert(forms, g_strdup(form->form_type), form); } } diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index 5de84056..8eb4d99e 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -247,7 +247,7 @@ _iq_handle_version_get(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, xmpp_send(conn, response); - g_free(version_str); + g_string_free(version_str, TRUE); xmpp_stanza_release(name_txt); xmpp_stanza_release(version_txt); xmpp_stanza_release(name); diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c index ec439871..607bb02b 100644 --- a/src/xmpp/presence.c +++ b/src/xmpp/presence.c @@ -372,7 +372,7 @@ _subscribe_handler(xmpp_conn_t * const conn, } prof_handle_subscription(from_jid->barejid, PRESENCE_SUBSCRIBE); - autocomplete_add(sub_requests_ac, strdup(from_jid->barejid)); + autocomplete_add(sub_requests_ac, from_jid->barejid); jid_destroy(from_jid); diff --git a/src/xmpp/roster.c b/src/xmpp/roster.c index b31a2725..c073464d 100644 --- a/src/xmpp/roster.c +++ b/src/xmpp/roster.c @@ -184,12 +184,12 @@ roster_add(const char * const barejid, const char * const name, GSList *groups, // add groups while (groups != NULL) { - autocomplete_add(groups_ac, strdup(groups->data)); + autocomplete_add(groups_ac, groups->data); groups = g_slist_next(groups); } g_hash_table_insert(contacts, strdup(barejid), contact); - autocomplete_add(barejid_ac, strdup(barejid)); + autocomplete_add(barejid_ac, barejid); _add_name_and_barejid(name, barejid); if (!from_initial) { @@ -226,7 +226,7 @@ roster_update(const char * const barejid, const char * const name, // add groups while (groups != NULL) { - autocomplete_add(groups_ac, strdup(groups->data)); + autocomplete_add(groups_ac, groups->data); groups = g_slist_next(groups); } } @@ -248,7 +248,7 @@ roster_update_presence(const char * const barejid, Resource *resource, } p_contact_set_presence(contact, resource); Jid *jid = jid_create_from_bare_and_resource(barejid, resource->name); - autocomplete_add(fulljid_ac, strdup(jid->fulljid)); + autocomplete_add(fulljid_ac, jid->fulljid); jid_destroy(jid); return TRUE; @@ -646,10 +646,10 @@ static void _add_name_and_barejid(const char * const name, const char * const barejid) { if (name != NULL) { - autocomplete_add(name_ac, strdup(name)); + autocomplete_add(name_ac, name); g_hash_table_insert(name_to_barejid, strdup(name), strdup(barejid)); } else { - autocomplete_add(name_ac, strdup(barejid)); + autocomplete_add(name_ac, barejid); g_hash_table_insert(name_to_barejid, strdup(barejid), strdup(barejid)); } } diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 7d7a0949..97cebc73 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -853,7 +853,7 @@ stanza_create_form(xmpp_stanza_t * const stanza) while (value != NULL) { char *text = xmpp_stanza_get_text(value); if (text != NULL) { - field->values = g_slist_insert_sorted(field->values, strdup(text), (GCompareFunc)octet_compare); + field->values = g_slist_insert_sorted(field->values, strdup(text), (GCompareFunc)strcmp); xmpp_free(ctx, text); } value = xmpp_stanza_get_next(value); @@ -997,5 +997,5 @@ stanza_get_presence_string_from_type(resource_presence_t presence_type) static int _field_compare(FormField *f1, FormField *f2) { - return octet_compare((unsigned char *)f1->var, (unsigned char *)f2->var); + return strcmp(f1->var, f2->var); } |