Mercurial > pidgin.yaz
comparison src/protocols/jabber/xdata.c @ 8295:bc850664b559
[gaim-migrate @ 9019]
take advantage of chip's new thing
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Thu, 19 Feb 2004 14:52:09 +0000 |
parents | 8f4ce853e685 |
children | 680aa8e0543e |
comparison
equal
deleted
inserted
replaced
8294:d5e59ea083be | 8295:bc850664b559 |
---|---|
28 JABBER_X_DATA_IGNORE = 0, | 28 JABBER_X_DATA_IGNORE = 0, |
29 JABBER_X_DATA_TEXT_SINGLE, | 29 JABBER_X_DATA_TEXT_SINGLE, |
30 JABBER_X_DATA_TEXT_MULTI, | 30 JABBER_X_DATA_TEXT_MULTI, |
31 JABBER_X_DATA_LIST_SINGLE, | 31 JABBER_X_DATA_LIST_SINGLE, |
32 JABBER_X_DATA_LIST_MULTI, | 32 JABBER_X_DATA_LIST_MULTI, |
33 JABBER_X_DATA_BOOLEAN | 33 JABBER_X_DATA_BOOLEAN, |
34 JABBER_X_DATA_JID_SINGLE | |
34 } jabber_x_data_field_type; | 35 } jabber_x_data_field_type; |
35 | 36 |
36 struct jabber_x_data_data { | 37 struct jabber_x_data_data { |
37 GHashTable *fields; | 38 GHashTable *fields; |
38 GSList *values; | 39 GSList *values; |
58 const char *id = gaim_request_field_get_id(field); | 59 const char *id = gaim_request_field_get_id(field); |
59 jabber_x_data_field_type type = GPOINTER_TO_INT(g_hash_table_lookup(data->fields, id)); | 60 jabber_x_data_field_type type = GPOINTER_TO_INT(g_hash_table_lookup(data->fields, id)); |
60 | 61 |
61 switch(type) { | 62 switch(type) { |
62 case JABBER_X_DATA_TEXT_SINGLE: | 63 case JABBER_X_DATA_TEXT_SINGLE: |
64 case JABBER_X_DATA_JID_SINGLE: | |
63 { | 65 { |
64 const char *value = gaim_request_field_string_get_value(field); | 66 const char *value = gaim_request_field_string_get_value(field); |
65 fieldnode = xmlnode_new_child(result, "field"); | 67 fieldnode = xmlnode_new_child(result, "field"); |
66 xmlnode_set_attrib(fieldnode, "var", id); | 68 xmlnode_set_attrib(fieldnode, "var", id); |
67 valuenode = xmlnode_new_child(fieldnode, "value"); | 69 valuenode = xmlnode_new_child(fieldnode, "value"); |
310 | 312 |
311 field = gaim_request_field_string_new(var, label, | 313 field = gaim_request_field_string_new(var, label, |
312 value ? value : "", FALSE); | 314 value ? value : "", FALSE); |
313 gaim_request_field_group_add_field(group, field); | 315 gaim_request_field_group_add_field(group, field); |
314 | 316 |
315 g_hash_table_replace(data->fields, g_strdup(var), GINT_TO_POINTER(JABBER_X_DATA_TEXT_SINGLE)); | 317 if(!strcmp(type, "jid-single")) { |
318 gaim_request_field_set_type_hint(field, "screenname"); | |
319 g_hash_table_replace(data->fields, g_strdup(var), GINT_TO_POINTER(JABBER_X_DATA_JID_SINGLE)); | |
320 } else { | |
321 g_hash_table_replace(data->fields, g_strdup(var), GINT_TO_POINTER(JABBER_X_DATA_TEXT_SINGLE)); | |
322 } | |
316 | 323 |
317 if(value) | 324 if(value) |
318 g_free(value); | 325 g_free(value); |
319 } | 326 } |
320 } | 327 } |