Tue, 21 Mar 2023 02:07:16 -0500
Remove libsoup2 code
Soup 3 has been required since /r/2068.
Testing Done:
Compiled only.
Reviewed at https://reviews.imfreedom.org/r/2375/
| 7923 | 1 | /* |
| 15884 | 2 | * purple - Jabber Protocol Plugin |
| 7923 | 3 | * |
|
28322
ac8fec1d2234
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents:
26565
diff
changeset
|
4 | * Purple is the legal property of its developers, whose names are too numerous |
|
ac8fec1d2234
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents:
26565
diff
changeset
|
5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
ac8fec1d2234
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents:
26565
diff
changeset
|
6 | * source distribution. |
| 7923 | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19051
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 7923 | 21 | * |
| 22 | */ | |
|
40441
f23c7e772667
Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
23 | |
|
f23c7e772667
Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
24 | #include <glib/gi18n-lib.h> |
|
f23c7e772667
Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
25 | |
|
40358
e6fe6fc1f516
move all protocols, purple plugins, and purple tests to use purple.h instead of including files individually
Gary Kramlich <grim@reaperworld.com>
parents:
40062
diff
changeset
|
26 | #include <purple.h> |
| 7923 | 27 | |
| 28 | #include "xdata.h" | |
| 29 | ||
| 30 | typedef enum { | |
| 31 | JABBER_X_DATA_IGNORE = 0, | |
| 32 | JABBER_X_DATA_TEXT_SINGLE, | |
| 33 | JABBER_X_DATA_TEXT_MULTI, | |
| 34 | JABBER_X_DATA_LIST_SINGLE, | |
| 35 | JABBER_X_DATA_LIST_MULTI, | |
| 8295 | 36 | JABBER_X_DATA_BOOLEAN, |
| 37 | JABBER_X_DATA_JID_SINGLE | |
| 7923 | 38 | } jabber_x_data_field_type; |
| 39 | ||
| 40 | struct jabber_x_data_data { | |
| 41 | GHashTable *fields; | |
| 42 | GSList *values; | |
|
41967
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
43 | GCallback cb; |
| 7923 | 44 | gpointer user_data; |
| 45 | JabberStream *js; | |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
46 | GList *actions; |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41967
diff
changeset
|
47 | PurpleRequestGroup *actiongroup; |
| 7923 | 48 | }; |
| 49 | ||
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
50 | static void |
|
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
51 | jabber_x_data_ok_cb(struct jabber_x_data_data *data, PurpleRequestPage *page) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
52 | PurpleXmlNode *result = purple_xmlnode_new("x"); |
|
41967
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
53 | GCallback cb = data->cb; |
| 7923 | 54 | gpointer user_data = data->user_data; |
| 55 | JabberStream *js = data->js; | |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
56 | char *actionhandle = NULL; |
|
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
57 | gboolean hasActions = (data->actions != NULL); |
|
42156
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
58 | guint n_groups; |
| 7923 | 59 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
60 | purple_xmlnode_set_namespace(result, "jabber:x:data"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
61 | purple_xmlnode_set_attrib(result, "type", "submit"); |
| 7923 | 62 | |
|
42156
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
63 | n_groups = g_list_model_get_n_items(G_LIST_MODEL(page)); |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
64 | for(guint group_index = 0; group_index < n_groups; group_index++) { |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
65 | PurpleRequestGroup *group = NULL; |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
66 | guint n_fields; |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
67 | |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
68 | group = g_list_model_get_item(G_LIST_MODEL(page), group_index); |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
69 | n_fields = g_list_model_get_n_items(G_LIST_MODEL(group)); |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
70 | |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
71 | if(group == data->actiongroup) { |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
72 | for(guint field_index = 0; field_index < n_fields; field_index++) { |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
73 | PurpleRequestField *field = NULL; |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
74 | PurpleRequestFieldChoice *choice = NULL; |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
75 | const char *id = NULL; |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
76 | int handleindex; |
|
42156
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
77 | |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
78 | field = g_list_model_get_item(G_LIST_MODEL(group), field_index); |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
79 | choice = PURPLE_REQUEST_FIELD_CHOICE(field); |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
80 | id = purple_request_field_get_id(field); |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
81 | |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
82 | if(!purple_strequal(id, "libpurple:jabber:xdata:actions")) { |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
83 | g_object_unref(field); |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
84 | continue; |
|
42156
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
85 | } |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
86 | |
|
42139
c053558f1236
Make PurpleRequestFieldChoice into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42136
diff
changeset
|
87 | handleindex = GPOINTER_TO_INT(purple_request_field_choice_get_value(choice)); |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
88 | actionhandle = g_strdup(g_list_nth_data(data->actions, handleindex)); |
|
42156
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
89 | g_object_unref(field); |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
90 | break; |
|
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
91 | } |
|
42156
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
92 | |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
93 | g_object_unref(group); |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
94 | continue; |
|
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
95 | } |
|
42156
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
96 | |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
97 | for(guint field_index = 0; field_index < n_fields; field_index++) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
98 | PurpleXmlNode *fieldnode, *valuenode; |
|
42156
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
99 | PurpleRequestField *field = NULL; |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
100 | const char *id = NULL; |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
101 | jabber_x_data_field_type type; |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
102 | |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
103 | field = g_list_model_get_item(G_LIST_MODEL(group), field_index); |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
104 | id = purple_request_field_get_id(field); |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
105 | type = GPOINTER_TO_INT(g_hash_table_lookup(data->fields, id)); |
| 7923 | 106 | |
| 107 | switch(type) { | |
| 108 | case JABBER_X_DATA_TEXT_SINGLE: | |
| 8295 | 109 | case JABBER_X_DATA_JID_SINGLE: |
| 7923 | 110 | { |
|
42135
1a89a067a0d5
Add a PurpleRequestFieldString subclass
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42128
diff
changeset
|
111 | PurpleRequestFieldString *sfield = PURPLE_REQUEST_FIELD_STRING(field); |
|
1a89a067a0d5
Add a PurpleRequestFieldString subclass
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42128
diff
changeset
|
112 | const char *value = purple_request_field_string_get_value(sfield); |
|
16398
a895aca0a7ce
Ok I couldn't resist. For iChat and Adium buddies who are advertising
Mark Doliner <markdoliner@pidgin.im>
parents:
16136
diff
changeset
|
113 | if (value == NULL) |
|
a895aca0a7ce
Ok I couldn't resist. For iChat and Adium buddies who are advertising
Mark Doliner <markdoliner@pidgin.im>
parents:
16136
diff
changeset
|
114 | break; |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
115 | fieldnode = purple_xmlnode_new_child(result, "field"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
116 | purple_xmlnode_set_attrib(fieldnode, "var", id); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
117 | valuenode = purple_xmlnode_new_child(fieldnode, "value"); |
|
39913
ce96d4639dc7
Remove redundant conditions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38358
diff
changeset
|
118 | purple_xmlnode_insert_data(valuenode, value, -1); |
| 7923 | 119 | break; |
| 120 | } | |
| 121 | case JABBER_X_DATA_TEXT_MULTI: | |
| 122 | { | |
|
42135
1a89a067a0d5
Add a PurpleRequestFieldString subclass
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42128
diff
changeset
|
123 | PurpleRequestFieldString *sfield = PURPLE_REQUEST_FIELD_STRING(field); |
|
1a89a067a0d5
Add a PurpleRequestFieldString subclass
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42128
diff
changeset
|
124 | const char *value = purple_request_field_string_get_value(sfield); |
| 7923 | 125 | char **pieces, **p; |
|
16398
a895aca0a7ce
Ok I couldn't resist. For iChat and Adium buddies who are advertising
Mark Doliner <markdoliner@pidgin.im>
parents:
16136
diff
changeset
|
126 | if (value == NULL) |
|
a895aca0a7ce
Ok I couldn't resist. For iChat and Adium buddies who are advertising
Mark Doliner <markdoliner@pidgin.im>
parents:
16136
diff
changeset
|
127 | break; |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
128 | fieldnode = purple_xmlnode_new_child(result, "field"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
129 | purple_xmlnode_set_attrib(fieldnode, "var", id); |
| 7923 | 130 | |
| 131 | pieces = g_strsplit(value, "\n", -1); | |
| 132 | for(p = pieces; *p != NULL; p++) { | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
133 | valuenode = purple_xmlnode_new_child(fieldnode, "value"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
134 | purple_xmlnode_insert_data(valuenode, *p, -1); |
| 7923 | 135 | } |
| 136 | g_strfreev(pieces); | |
| 137 | } | |
| 138 | break; | |
| 139 | case JABBER_X_DATA_LIST_SINGLE: | |
| 140 | case JABBER_X_DATA_LIST_MULTI: | |
| 141 | { | |
|
42140
beba61bbdf19
Convert PurpleRequestFieldList into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42139
diff
changeset
|
142 | PurpleRequestFieldList *lfield = PURPLE_REQUEST_FIELD_LIST(field); |
|
beba61bbdf19
Convert PurpleRequestFieldList into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42139
diff
changeset
|
143 | GList *selected = purple_request_field_list_get_selected(lfield); |
| 7923 | 144 | char *value; |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
145 | fieldnode = purple_xmlnode_new_child(result, "field"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
146 | purple_xmlnode_set_attrib(fieldnode, "var", id); |
| 7923 | 147 | |
| 148 | while(selected) { | |
|
42140
beba61bbdf19
Convert PurpleRequestFieldList into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42139
diff
changeset
|
149 | value = purple_request_field_list_get_data(lfield, selected->data); |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
150 | valuenode = purple_xmlnode_new_child(fieldnode, "value"); |
| 7923 | 151 | if(value) |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
152 | purple_xmlnode_insert_data(valuenode, value, -1); |
| 7923 | 153 | selected = selected->next; |
| 154 | } | |
| 155 | } | |
| 156 | break; | |
| 157 | case JABBER_X_DATA_BOOLEAN: | |
|
42136
cfa707dcda7d
Make PurpleRequestFieldBool into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42135
diff
changeset
|
158 | { |
|
cfa707dcda7d
Make PurpleRequestFieldBool into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42135
diff
changeset
|
159 | PurpleRequestFieldBool *bfield = PURPLE_REQUEST_FIELD_BOOL(field); |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
160 | fieldnode = purple_xmlnode_new_child(result, "field"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
161 | purple_xmlnode_set_attrib(fieldnode, "var", id); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
162 | valuenode = purple_xmlnode_new_child(fieldnode, "value"); |
|
42136
cfa707dcda7d
Make PurpleRequestFieldBool into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42135
diff
changeset
|
163 | if(purple_request_field_bool_get_value(bfield)) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
164 | purple_xmlnode_insert_data(valuenode, "1", -1); |
|
42136
cfa707dcda7d
Make PurpleRequestFieldBool into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42135
diff
changeset
|
165 | } else { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
166 | purple_xmlnode_insert_data(valuenode, "0", -1); |
|
42136
cfa707dcda7d
Make PurpleRequestFieldBool into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42135
diff
changeset
|
167 | } |
|
cfa707dcda7d
Make PurpleRequestFieldBool into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42135
diff
changeset
|
168 | } |
| 7923 | 169 | break; |
| 170 | case JABBER_X_DATA_IGNORE: | |
| 171 | break; | |
| 172 | } | |
|
42156
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
173 | |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
174 | g_object_unref(field); |
| 7923 | 175 | } |
|
42156
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
176 | |
|
c1327ee3d0c0
Use GListModel API for request fields in XMPP
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42140
diff
changeset
|
177 | g_object_unref(group); |
| 7923 | 178 | } |
| 179 | ||
| 180 | g_hash_table_destroy(data->fields); | |
|
40052
cc03b5af25ea
Use GSList functions instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
40049
diff
changeset
|
181 | g_slist_free_full(data->values, g_free); |
| 40047 | 182 | g_list_free_full(data->actions, g_free); |
| 7923 | 183 | g_free(data); |
| 184 | ||
|
41967
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
185 | if(hasActions) { |
|
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
186 | ((jabber_x_data_action_cb)cb)(js, result, actionhandle, user_data); |
|
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
187 | } else { |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
188 | ((jabber_x_data_cb)cb)(js, result, user_data); |
|
41967
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
189 | } |
|
26565
94071f2569f2
Fix a potential memleak by freeing this regardless of whether hasActions
Mark Doliner <markdoliner@pidgin.im>
parents:
26042
diff
changeset
|
190 | |
|
94071f2569f2
Fix a potential memleak by freeing this regardless of whether hasActions
Mark Doliner <markdoliner@pidgin.im>
parents:
26042
diff
changeset
|
191 | g_free(actionhandle); |
| 7923 | 192 | } |
| 193 | ||
|
41967
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
194 | static void |
|
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
195 | jabber_x_data_cancel_cb(struct jabber_x_data_data *data, |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
196 | G_GNUC_UNUSED PurpleRequestPage *page) |
|
41967
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
197 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
198 | PurpleXmlNode *result = purple_xmlnode_new("x"); |
|
41967
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
199 | GCallback cb = data->cb; |
| 7923 | 200 | gpointer user_data = data->user_data; |
| 201 | JabberStream *js = data->js; | |
| 40049 | 202 | gboolean hasActions = (data->actions != NULL); |
| 7923 | 203 | g_hash_table_destroy(data->fields); |
|
40052
cc03b5af25ea
Use GSList functions instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
40049
diff
changeset
|
204 | g_slist_free_full(data->values, g_free); |
| 40049 | 205 | g_list_free_full(data->actions, g_free); |
| 7923 | 206 | g_free(data); |
| 207 | ||
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
208 | purple_xmlnode_set_namespace(result, "jabber:x:data"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
209 | purple_xmlnode_set_attrib(result, "type", "cancel"); |
| 7923 | 210 | |
|
41967
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
211 | if(hasActions) { |
|
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
212 | ((jabber_x_data_action_cb)cb)(js, result, NULL, user_data); |
|
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
213 | } else { |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
214 | ((jabber_x_data_cb)cb)(js, result, user_data); |
|
41967
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
215 | } |
| 7923 | 216 | } |
| 217 | ||
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
218 | void *jabber_x_data_request(JabberStream *js, PurpleXmlNode *packet, jabber_x_data_cb cb, gpointer user_data) |
| 7923 | 219 | { |
|
41967
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
220 | return jabber_x_data_request_with_actions(js, packet, NULL, 0, |
|
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
221 | (jabber_x_data_action_cb)(GCallback)cb, |
|
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
222 | user_data); |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
223 | } |
|
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
224 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
225 | void *jabber_x_data_request_with_actions(JabberStream *js, PurpleXmlNode *packet, GList *actions, int defaultaction, jabber_x_data_action_cb cb, gpointer user_data) |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
226 | { |
| 8396 | 227 | void *handle; |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
228 | PurpleXmlNode *fn, *x; |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
229 | PurpleRequestPage *page; |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41967
diff
changeset
|
230 | PurpleRequestGroup *group; |
|
23493
e04778a3d29a
Kill the warning 'field' may be used uninitialized in this function
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
23176
diff
changeset
|
231 | PurpleRequestField *field = NULL; |
| 7923 | 232 | |
| 233 | char *title = NULL; | |
| 234 | char *instructions = NULL; | |
| 235 | ||
| 236 | struct jabber_x_data_data *data = g_new0(struct jabber_x_data_data, 1); | |
| 237 | ||
| 238 | data->fields = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); | |
| 239 | data->user_data = user_data; | |
|
41967
025eee9e6f1d
Bump C standard to C99 for XMPP and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40817
diff
changeset
|
240 | data->cb = G_CALLBACK(cb); |
| 7923 | 241 | data->js = js; |
| 242 | ||
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
243 | page = purple_request_page_new(); |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41967
diff
changeset
|
244 | group = purple_request_group_new(NULL); |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
245 | purple_request_page_add_group(page, group); |
| 7923 | 246 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
247 | for(fn = purple_xmlnode_get_child(packet, "field"); fn; fn = purple_xmlnode_get_next_twin(fn)) { |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
248 | PurpleXmlNode *valuenode; |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
249 | const char *type = purple_xmlnode_get_attrib(fn, "type"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
250 | const char *label = purple_xmlnode_get_attrib(fn, "label"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
251 | const char *var = purple_xmlnode_get_attrib(fn, "var"); |
| 8135 | 252 | char *value = NULL; |
| 253 | ||
| 254 | if(!type) | |
|
17837
a9c447447c06
XEP-0004 says that if no field type is specified, text-single should be assumed.
Andreas Monitzer <am@adiumx.com>
parents:
17805
diff
changeset
|
255 | type = "text-single"; |
| 8135 | 256 | |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38258
diff
changeset
|
257 | if(!var && !purple_strequal(type, "fixed")) |
| 8135 | 258 | continue; |
| 259 | if(!label) | |
| 260 | label = var; | |
| 261 | ||
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
30511
diff
changeset
|
262 | if(purple_strequal(type, "text-private")) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
263 | if((valuenode = purple_xmlnode_get_child(fn, "value"))) |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
264 | value = purple_xmlnode_get_data(valuenode); |
| 8135 | 265 | |
| 15884 | 266 | field = purple_request_field_string_new(var, label, |
| 8135 | 267 | value ? value : "", FALSE); |
|
42135
1a89a067a0d5
Add a PurpleRequestFieldString subclass
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42128
diff
changeset
|
268 | purple_request_field_string_set_masked(PURPLE_REQUEST_FIELD_STRING(field), |
|
1a89a067a0d5
Add a PurpleRequestFieldString subclass
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42128
diff
changeset
|
269 | TRUE); |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41967
diff
changeset
|
270 | purple_request_group_add_field(group, field); |
| 8135 | 271 | |
| 272 | g_hash_table_replace(data->fields, g_strdup(var), GINT_TO_POINTER(JABBER_X_DATA_TEXT_SINGLE)); | |
| 273 | ||
|
16136
49ddb8f06d96
I noticed some places where we were doing the whole
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
274 | g_free(value); |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
30511
diff
changeset
|
275 | } else if(purple_strequal(type, "text-multi") || purple_strequal(type, "jid-multi")) { |
| 8135 | 276 | GString *str = g_string_new(""); |
| 277 | ||
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
278 | for(valuenode = purple_xmlnode_get_child(fn, "value"); valuenode; |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
279 | valuenode = purple_xmlnode_get_next_twin(valuenode)) { |
| 8135 | 280 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
281 | if(!(value = purple_xmlnode_get_data(valuenode))) |
| 8135 | 282 | continue; |
| 283 | ||
| 284 | g_string_append_printf(str, "%s\n", value); | |
| 285 | g_free(value); | |
| 286 | } | |
| 287 | ||
| 15884 | 288 | field = purple_request_field_string_new(var, label, |
| 8135 | 289 | str->str, TRUE); |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41967
diff
changeset
|
290 | purple_request_group_add_field(group, field); |
| 7923 | 291 | |
| 8135 | 292 | g_hash_table_replace(data->fields, g_strdup(var), GINT_TO_POINTER(JABBER_X_DATA_TEXT_MULTI)); |
| 293 | ||
| 294 | g_string_free(str, TRUE); | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
30511
diff
changeset
|
295 | } else if(purple_strequal(type, "list-single") || purple_strequal(type, "list-multi")) { |
|
42140
beba61bbdf19
Convert PurpleRequestFieldList into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42139
diff
changeset
|
296 | PurpleRequestFieldList *list_field = NULL; |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
297 | PurpleXmlNode *optnode; |
| 8135 | 298 | GList *selected = NULL; |
| 299 | ||
| 15884 | 300 | field = purple_request_field_list_new(var, label); |
|
42140
beba61bbdf19
Convert PurpleRequestFieldList into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42139
diff
changeset
|
301 | list_field = PURPLE_REQUEST_FIELD_LIST(field); |
| 8135 | 302 | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
30511
diff
changeset
|
303 | if(purple_strequal(type, "list-multi")) { |
|
42140
beba61bbdf19
Convert PurpleRequestFieldList into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42139
diff
changeset
|
304 | purple_request_field_list_set_multi_select(list_field, TRUE); |
| 8135 | 305 | g_hash_table_replace(data->fields, g_strdup(var), |
| 306 | GINT_TO_POINTER(JABBER_X_DATA_LIST_MULTI)); | |
| 307 | } else { | |
| 308 | g_hash_table_replace(data->fields, g_strdup(var), | |
| 309 | GINT_TO_POINTER(JABBER_X_DATA_LIST_SINGLE)); | |
| 310 | } | |
| 311 | ||
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
312 | for(valuenode = purple_xmlnode_get_child(fn, "value"); valuenode; |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
313 | valuenode = purple_xmlnode_get_next_twin(valuenode)) { |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
314 | char *data = purple_xmlnode_get_data(valuenode); |
|
22664
d2e81c1408ae
If the default value of a list-single or list-multi data forms field is NULL
Etan Reisner <deryni@pidgin.im>
parents:
21653
diff
changeset
|
315 | if (data != NULL) { |
|
d2e81c1408ae
If the default value of a list-single or list-multi data forms field is NULL
Etan Reisner <deryni@pidgin.im>
parents:
21653
diff
changeset
|
316 | selected = g_list_prepend(selected, data); |
|
d2e81c1408ae
If the default value of a list-single or list-multi data forms field is NULL
Etan Reisner <deryni@pidgin.im>
parents:
21653
diff
changeset
|
317 | } |
| 8135 | 318 | } |
| 7923 | 319 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
320 | for(optnode = purple_xmlnode_get_child(fn, "option"); optnode; |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
321 | optnode = purple_xmlnode_get_next_twin(optnode)) { |
| 8135 | 322 | const char *lbl; |
| 323 | ||
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
324 | if(!(valuenode = purple_xmlnode_get_child(optnode, "value"))) |
| 8135 | 325 | continue; |
| 326 | ||
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
327 | if(!(value = purple_xmlnode_get_data(valuenode))) |
| 8135 | 328 | continue; |
| 329 | ||
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
330 | if(!(lbl = purple_xmlnode_get_attrib(optnode, "label"))) |
|
19051
b932fc2e28cd
For XMPP multi-selection lists in generic data forms, the intent here
Mark Doliner <markdoliner@pidgin.im>
parents:
18190
diff
changeset
|
331 | lbl = value; |
| 8135 | 332 | |
| 333 | data->values = g_slist_prepend(data->values, value); | |
| 334 | ||
|
42140
beba61bbdf19
Convert PurpleRequestFieldList into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42139
diff
changeset
|
335 | purple_request_field_list_add_icon(list_field, lbl, NULL, value); |
|
beba61bbdf19
Convert PurpleRequestFieldList into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42139
diff
changeset
|
336 | if(g_list_find_custom(selected, value, (GCompareFunc)strcmp)) { |
|
beba61bbdf19
Convert PurpleRequestFieldList into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42139
diff
changeset
|
337 | purple_request_field_list_add_selected(list_field, lbl); |
|
beba61bbdf19
Convert PurpleRequestFieldList into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42139
diff
changeset
|
338 | } |
| 8135 | 339 | } |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41967
diff
changeset
|
340 | purple_request_group_add_field(group, field); |
| 8135 | 341 | |
|
40062
d25228fc7b8e
Use g_list_free_full instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
40052
diff
changeset
|
342 | g_list_free_full(selected, g_free); |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
30511
diff
changeset
|
343 | } else if(purple_strequal(type, "boolean")) { |
| 8135 | 344 | gboolean def = FALSE; |
| 7923 | 345 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
346 | if((valuenode = purple_xmlnode_get_child(fn, "value"))) |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
347 | value = purple_xmlnode_get_data(valuenode); |
| 7923 | 348 | |
|
8390
13e1ff9b2850
[gaim-migrate @ 9119]
Mark Doliner <markdoliner@pidgin.im>
parents:
8385
diff
changeset
|
349 | if(value && (!g_ascii_strcasecmp(value, "yes") || |
|
13e1ff9b2850
[gaim-migrate @ 9119]
Mark Doliner <markdoliner@pidgin.im>
parents:
8385
diff
changeset
|
350 | !g_ascii_strcasecmp(value, "true") || !g_ascii_strcasecmp(value, "1"))) |
| 8135 | 351 | def = TRUE; |
| 7923 | 352 | |
| 15884 | 353 | field = purple_request_field_bool_new(var, label, def); |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41967
diff
changeset
|
354 | purple_request_group_add_field(group, field); |
| 7923 | 355 | |
| 8135 | 356 | g_hash_table_replace(data->fields, g_strdup(var), GINT_TO_POINTER(JABBER_X_DATA_BOOLEAN)); |
| 7923 | 357 | |
|
16136
49ddb8f06d96
I noticed some places where we were doing the whole
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
358 | g_free(value); |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
30511
diff
changeset
|
359 | } else if(purple_strequal(type, "fixed")) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
360 | if((valuenode = purple_xmlnode_get_child(fn, "value"))) |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
361 | value = purple_xmlnode_get_data(valuenode); |
| 7923 | 362 | |
|
23176
90f6226370cb
applied changes from 069f197178d158cdd308687095c14d49d8eee0ed
Daniel Atallah <datallah@pidgin.im>
parents:
22664
diff
changeset
|
363 | if(value != NULL) { |
|
90f6226370cb
applied changes from 069f197178d158cdd308687095c14d49d8eee0ed
Daniel Atallah <datallah@pidgin.im>
parents:
22664
diff
changeset
|
364 | field = purple_request_field_label_new("", value); |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41967
diff
changeset
|
365 | purple_request_group_add_field(group, field); |
| 7923 | 366 | |
|
23176
90f6226370cb
applied changes from 069f197178d158cdd308687095c14d49d8eee0ed
Daniel Atallah <datallah@pidgin.im>
parents:
22664
diff
changeset
|
367 | g_free(value); |
|
90f6226370cb
applied changes from 069f197178d158cdd308687095c14d49d8eee0ed
Daniel Atallah <datallah@pidgin.im>
parents:
22664
diff
changeset
|
368 | } |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
30511
diff
changeset
|
369 | } else if(purple_strequal(type, "hidden")) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
370 | if((valuenode = purple_xmlnode_get_child(fn, "value"))) |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
371 | value = purple_xmlnode_get_data(valuenode); |
| 7923 | 372 | |
| 15884 | 373 | field = purple_request_field_string_new(var, "", value ? value : "", |
| 8135 | 374 | FALSE); |
| 15884 | 375 | purple_request_field_set_visible(field, FALSE); |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41967
diff
changeset
|
376 | purple_request_group_add_field(group, field); |
| 7923 | 377 | |
| 8135 | 378 | g_hash_table_replace(data->fields, g_strdup(var), GINT_TO_POINTER(JABBER_X_DATA_TEXT_SINGLE)); |
| 7923 | 379 | |
|
16136
49ddb8f06d96
I noticed some places where we were doing the whole
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
380 | g_free(value); |
| 8135 | 381 | } else { /* text-single, jid-single, and the default */ |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
382 | if((valuenode = purple_xmlnode_get_child(fn, "value"))) |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
383 | value = purple_xmlnode_get_data(valuenode); |
| 7923 | 384 | |
| 15884 | 385 | field = purple_request_field_string_new(var, label, |
| 8135 | 386 | value ? value : "", FALSE); |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41967
diff
changeset
|
387 | purple_request_group_add_field(group, field); |
| 7923 | 388 | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
30511
diff
changeset
|
389 | if(purple_strequal(type, "jid-single")) { |
| 15884 | 390 | purple_request_field_set_type_hint(field, "screenname"); |
| 8295 | 391 | g_hash_table_replace(data->fields, g_strdup(var), GINT_TO_POINTER(JABBER_X_DATA_JID_SINGLE)); |
| 392 | } else { | |
| 393 | g_hash_table_replace(data->fields, g_strdup(var), GINT_TO_POINTER(JABBER_X_DATA_TEXT_SINGLE)); | |
| 394 | } | |
| 7923 | 395 | |
|
16136
49ddb8f06d96
I noticed some places where we were doing the whole
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
396 | g_free(value); |
| 7923 | 397 | } |
|
19894
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
19203
diff
changeset
|
398 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
399 | if(field && purple_xmlnode_get_child(fn, "required")) |
|
19894
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
19203
diff
changeset
|
400 | purple_request_field_set_required(field,TRUE); |
| 7923 | 401 | } |
|
26042
4dabdb5fe213
Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23493
diff
changeset
|
402 | |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
403 | if(actions != NULL) { |
|
42139
c053558f1236
Make PurpleRequestFieldChoice into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42136
diff
changeset
|
404 | PurpleRequestField *field = NULL; |
|
c053558f1236
Make PurpleRequestFieldChoice into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42136
diff
changeset
|
405 | PurpleRequestFieldChoice *choice = NULL; |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
406 | GList *action; |
|
34338
c652670afac5
Request API refactoring: custom PURPLE_REQUEST_CHOICE values, instead of indexes
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
407 | int i; |
|
c652670afac5
Request API refactoring: custom PURPLE_REQUEST_CHOICE values, instead of indexes
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
408 | |
|
42127
18acb99a0fa6
Convert PurpleRequestGroup into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41967
diff
changeset
|
409 | data->actiongroup = group = purple_request_group_new(_("Actions")); |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
410 | purple_request_page_add_group(page, group); |
|
42139
c053558f1236
Make PurpleRequestFieldChoice into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42136
diff
changeset
|
411 | field = purple_request_field_choice_new("libpurple:jabber:xdata:actions", |
|
c053558f1236
Make PurpleRequestFieldChoice into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42136
diff
changeset
|
412 | _("Select an action"), |
|
c053558f1236
Make PurpleRequestFieldChoice into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42136
diff
changeset
|
413 | GINT_TO_POINTER(defaultaction)); |
|
c053558f1236
Make PurpleRequestFieldChoice into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42136
diff
changeset
|
414 | choice = PURPLE_REQUEST_FIELD_CHOICE(field); |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
415 | |
|
34338
c652670afac5
Request API refactoring: custom PURPLE_REQUEST_CHOICE values, instead of indexes
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34332
diff
changeset
|
416 | for(i = 0, action = actions; action; action = g_list_next(action), i++) { |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
417 | JabberXDataAction *a = action->data; |
|
26042
4dabdb5fe213
Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
23493
diff
changeset
|
418 | |
|
42139
c053558f1236
Make PurpleRequestFieldChoice into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42136
diff
changeset
|
419 | purple_request_field_choice_add(choice, a->name, GINT_TO_POINTER(i)); |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
420 | data->actions = g_list_append(data->actions, g_strdup(a->handle)); |
|
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17774
diff
changeset
|
421 | } |
|
42139
c053558f1236
Make PurpleRequestFieldChoice into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42136
diff
changeset
|
422 | purple_request_field_set_required(field, TRUE); |
|
c053558f1236
Make PurpleRequestFieldChoice into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42136
diff
changeset
|
423 | purple_request_group_add_field(group, field); |
| 7923 | 424 | } |
| 425 | ||
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
426 | if((x = purple_xmlnode_get_child(packet, "title"))) |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
427 | title = purple_xmlnode_get_data(x); |
| 7923 | 428 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
429 | if((x = purple_xmlnode_get_child(packet, "instructions"))) |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
430 | instructions = purple_xmlnode_get_data(x); |
| 7923 | 431 | |
|
42128
118067ca0367
Convert PurpleRequestPage into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42127
diff
changeset
|
432 | handle = purple_request_fields(js->gc, title, title, instructions, page, |
| 8396 | 433 | _("OK"), G_CALLBACK(jabber_x_data_ok_cb), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16398
diff
changeset
|
434 | _("Cancel"), G_CALLBACK(jabber_x_data_cancel_cb), |
|
34332
876483829700
Request API refactoring: switch purple_request_fields to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
30511
diff
changeset
|
435 | purple_request_cpar_from_connection(js->gc), |
|
21653
621c47778132
merge of '73ae9aeda3c58fbf8437421da68d19d06f93e686'
Evan Schoenberg <evands@pidgin.im>
parents:
21233
diff
changeset
|
436 | data); |
| 7923 | 437 | |
|
16136
49ddb8f06d96
I noticed some places where we were doing the whole
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
438 | g_free(title); |
|
49ddb8f06d96
I noticed some places where we were doing the whole
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
439 | g_free(instructions); |
| 7923 | 440 | |
| 8396 | 441 | return handle; |
| 7923 | 442 | } |
| 443 | ||
|
30511
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
444 | gchar * |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
445 | jabber_x_data_get_formtype(const PurpleXmlNode *form) |
|
30511
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
446 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
447 | PurpleXmlNode *field; |
| 7923 | 448 | |
|
30511
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
449 | g_return_val_if_fail(form != NULL, NULL); |
|
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
450 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
451 | for (field = purple_xmlnode_get_child((PurpleXmlNode *)form, "field"); field; |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
452 | field = purple_xmlnode_get_next_twin(field)) { |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
453 | const char *var = purple_xmlnode_get_attrib(field, "var"); |
|
30511
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
454 | if (purple_strequal(var, "FORM_TYPE")) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
455 | PurpleXmlNode *value = purple_xmlnode_get_child(field, "value"); |
|
30511
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
456 | if (value) |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
30511
diff
changeset
|
457 | return purple_xmlnode_get_data(value); |
|
30511
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
458 | else |
|
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
459 | /* An interesting corner case... Looking for a second |
|
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
460 | * FORM_TYPE would be more considerate, but I'm in favor |
|
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
461 | * of not helping broken clients. |
|
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
462 | */ |
|
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
463 | return NULL; |
|
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
464 | } |
|
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
465 | } |
|
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
466 | |
|
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
467 | /* Erm, none found :( */ |
|
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
468 | return NULL; |
|
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
469 | } |
|
3e43438dbd72
jabber: Move (and harden) a function to xdata.c
Paul Aurich <darkrain42@pidgin.im>
parents:
29304
diff
changeset
|
470 |