mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
form_get_field_by_var->form_get_form_type_field
This commit is contained in:
parent
0a4dea55d5
commit
c4b4cb557f
@ -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) {
|
} else if (g_strcmp0(xmpp_stanza_get_name(child), STANZA_NAME_X) == 0) {
|
||||||
if (strcmp(xmpp_stanza_get_ns(child), STANZA_NS_DATA) == 0) {
|
if (strcmp(xmpp_stanza_get_ns(child), STANZA_NS_DATA) == 0) {
|
||||||
form = form_create(child);
|
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);
|
form_names = g_slist_insert_sorted(form_names, g_strdup(form_type), (GCompareFunc)strcmp);
|
||||||
g_hash_table_insert(forms, g_strdup(form_type), form);
|
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;
|
curr = form_names;
|
||||||
while (curr != NULL) {
|
while (curr != NULL) {
|
||||||
form = g_hash_table_lookup(forms, curr->data);
|
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, form_type);
|
||||||
g_string_append(s, "<");
|
g_string_append(s, "<");
|
||||||
|
|
||||||
|
@ -374,12 +374,12 @@ _form_destroy(DataForm *form)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
_form_get_field_by_var(DataForm *form, const char * const var)
|
_form_get_form_type_field(DataForm *form)
|
||||||
{
|
{
|
||||||
GSList *curr = form->fields;
|
GSList *curr = form->fields;
|
||||||
while (curr != NULL) {
|
while (curr != NULL) {
|
||||||
FormField *field = curr->data;
|
FormField *field = curr->data;
|
||||||
if (g_strcmp0(field->var, var) == 0) {
|
if (g_strcmp0(field->var, "FORM_TYPE") == 0) {
|
||||||
return field->values->data;
|
return field->values->data;
|
||||||
}
|
}
|
||||||
curr = g_slist_next(curr);
|
curr = g_slist_next(curr);
|
||||||
@ -428,7 +428,7 @@ void
|
|||||||
form_init_module(void)
|
form_init_module(void)
|
||||||
{
|
{
|
||||||
form_destroy = _form_destroy;
|
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_set_value_by_tag = _form_set_value_by_tag;
|
||||||
form_tag_exists = _form_tag_exists;
|
form_tag_exists = _form_tag_exists;
|
||||||
}
|
}
|
||||||
|
@ -827,7 +827,7 @@ _disco_info_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanz
|
|||||||
DataForm *form = form_create(softwareinfo);
|
DataForm *form = form_create(softwareinfo);
|
||||||
FormField *formField = NULL;
|
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) {
|
if (g_strcmp0(form_type, STANZA_DATAFORM_SOFTWARE) == 0) {
|
||||||
GSList *field = form->fields;
|
GSList *field = form->fields;
|
||||||
while (field != NULL) {
|
while (field != NULL) {
|
||||||
|
@ -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 (*roster_send_remove)(const char * const barejid);
|
||||||
|
|
||||||
void (*form_destroy)(DataForm *form);
|
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);
|
void (*form_set_value_by_tag)(DataForm *form, const char * const tag, char *value);
|
||||||
gboolean (*form_tag_exists)(DataForm *form, const char * const tag);
|
gboolean (*form_tag_exists)(DataForm *form, const char * const tag);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user