From c4b4cb557fa97a1dcafe6894e9d6cfb059d37548 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sat, 13 Sep 2014 21:55:46 +0100 Subject: [PATCH] form_get_field_by_var->form_get_form_type_field --- src/xmpp/capabilities.c | 4 ++-- src/xmpp/form.c | 6 +++--- src/xmpp/iq.c | 2 +- src/xmpp/xmpp.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/xmpp/capabilities.c b/src/xmpp/capabilities.c index 942d0697..606bd64b 100644 --- a/src/xmpp/capabilities.c +++ b/src/xmpp/capabilities.c @@ -172,7 +172,7 @@ caps_create_sha1_str(xmpp_stanza_t * const query) } 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 = form_create(child); - char *form_type = form_get_field_by_var(form, "FORM_TYPE"); + char *form_type = form_get_form_type_field(form); form_names = g_slist_insert_sorted(form_names, g_strdup(form_type), (GCompareFunc)strcmp); g_hash_table_insert(forms, g_strdup(form_type), form); } @@ -196,7 +196,7 @@ caps_create_sha1_str(xmpp_stanza_t * const query) curr = form_names; while (curr != NULL) { form = g_hash_table_lookup(forms, curr->data); - char *form_type = form_get_field_by_var(form, "FORM_TYPE"); + char *form_type = form_get_form_type_field(form); g_string_append(s, form_type); g_string_append(s, "<"); diff --git a/src/xmpp/form.c b/src/xmpp/form.c index ad4ffa3e..b07e51ef 100644 --- a/src/xmpp/form.c +++ b/src/xmpp/form.c @@ -374,12 +374,12 @@ _form_destroy(DataForm *form) } static char * -_form_get_field_by_var(DataForm *form, const char * const var) +_form_get_form_type_field(DataForm *form) { GSList *curr = form->fields; while (curr != NULL) { FormField *field = curr->data; - if (g_strcmp0(field->var, var) == 0) { + if (g_strcmp0(field->var, "FORM_TYPE") == 0) { return field->values->data; } curr = g_slist_next(curr); @@ -428,7 +428,7 @@ void form_init_module(void) { form_destroy = _form_destroy; - form_get_field_by_var = _form_get_field_by_var; + form_get_form_type_field = _form_get_form_type_field; form_set_value_by_tag = _form_set_value_by_tag; form_tag_exists = _form_tag_exists; } diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index 39d8908b..62dfd64a 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -827,7 +827,7 @@ _disco_info_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanz DataForm *form = form_create(softwareinfo); FormField *formField = NULL; - char *form_type = form_get_field_by_var(form, "FORM_TYPE"); + char *form_type = form_get_form_type_field(form); if (g_strcmp0(form_type, STANZA_DATAFORM_SOFTWARE) == 0) { GSList *field = form->fields; while (field != NULL) { diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h index aaa8bbd2..75a67285 100644 --- a/src/xmpp/xmpp.h +++ b/src/xmpp/xmpp.h @@ -207,7 +207,7 @@ void (*roster_send_add_new)(const char * const barejid, const char * const name) void (*roster_send_remove)(const char * const barejid); void (*form_destroy)(DataForm *form); -char * (*form_get_field_by_var)(DataForm *form, const char * const var); +char * (*form_get_form_type_field)(DataForm *form); void (*form_set_value_by_tag)(DataForm *form, const char * const tag, char *value); gboolean (*form_tag_exists)(DataForm *form, const char * const tag);