about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-09-04 22:41:10 +0100
committerJames Booth <boothj5@gmail.com>2014-09-04 22:41:10 +0100
commit763356464ad35b3d6823341604eeefffec741584 (patch)
tree4537d5aa967be7274de275114a79611dd480040e /src
parent1e0e5597c21ae745d9c3a90d012b5afcf0dda630 (diff)
downloadprofani-tty-763356464ad35b3d6823341604eeefffec741584.tar.gz
Added ID handler for room config form
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/iq.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index 9e1bf759..5c954b53 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -75,6 +75,8 @@ static int _disco_items_get_handler(xmpp_conn_t * const conn,
     xmpp_stanza_t * const stanza, void * const userdata);
 static int _destroy_room_result_handler(xmpp_conn_t * const conn,
     xmpp_stanza_t * const stanza, void * const userdata);
+static int _room_config_handler(xmpp_conn_t * const conn,
+    xmpp_stanza_t * const stanza, void * const userdata);
 static int _manual_pong_handler(xmpp_conn_t *const conn,
     xmpp_stanza_t * const stanza, void * const userdata);
 static int _ping_timed_handler(xmpp_conn_t * const conn,
@@ -99,8 +101,6 @@ iq_add_handlers(void)
 
     HANDLE(STANZA_NS_PING,      STANZA_TYPE_GET,    _ping_get_handler);
 
-    HANDLE(NULL,                STANZA_TYPE_RESULT, _destroy_room_result_handler);
-
     if (prefs_get_autoping() != 0) {
         int millis = prefs_get_autoping() * 1000;
         xmpp_timed_handler_add(conn, _ping_timed_handler, millis, ctx);
@@ -194,6 +194,10 @@ _iq_request_room_config_form(const char * const room_jid)
     xmpp_conn_t * const conn = connection_get_conn();
     xmpp_ctx_t * const ctx = connection_get_ctx();
     xmpp_stanza_t *iq = stanza_create_room_config_request_iq(ctx, room_jid);
+
+    char *id = xmpp_stanza_get_id(iq);
+    xmpp_id_handler_add(conn, _room_config_handler, id, NULL);
+
     xmpp_send(conn, iq);
     xmpp_stanza_release(iq);
 }
@@ -571,6 +575,32 @@ _destroy_room_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const sta
     return 0;
 }
 
+static int
+_room_config_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
+    void * const userdata)
+{
+    const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
+
+    if (id != NULL) {
+        log_debug("IQ room config handler fired, id: %s.", id);
+    } else {
+        log_debug("IQ room config handler fired.");
+    }
+
+    const char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM);
+    if (from == NULL) {
+        log_error("No from attribute for IQ destroy room result");
+    } else {
+        // get form
+
+
+
+//        handle_room_configure(from);
+    }
+
+    return 0;
+}
+
 static void
 _identity_destroy(DiscoIdentity *identity)
 {
a>
f6ca1ba1 ^
2519e450 ^
d2035496 ^

e504c030 ^

a16c53f5 ^

d2035496 ^
dcccfacb ^
3ceb9b0d ^

dcccfacb ^
0cdbfecb ^
dcccfacb ^
0cdbfecb ^

dcccfacb ^


0cdbfecb ^



dcccfacb ^










0cdbfecb ^

dcccfacb ^
0cdbfecb ^
f1bd3505 ^


dcccfacb ^

0cdbfecb ^

2519e450 ^

0cdbfecb ^




2519e450 ^

dcccfacb ^
2519e450 ^
dcccfacb ^
2519e450 ^
bc8a871a ^
1588106e ^
5b734156 ^
2519e450 ^

72c35553 ^
2519e450 ^

768df4d7 ^













2c976d35 ^
7fa9ecc7 ^

dcccfacb ^
0cdbfecb ^




72c35553 ^
b5171cb0 ^





















dcccfacb ^

d2035496 ^

78841f2e ^
dcccfacb ^

d2035496 ^


dcccfacb ^
78841f2e ^
bd1c1394 ^
78841f2e ^
fa89e2aa ^
7e4b1b1d ^
fa89e2aa ^
e504c030 ^
50afe736 ^
fa89e2aa ^











bd1c1394 ^

50afe736 ^
fa89e2aa ^











4d00f788 ^
d2035496 ^

3ceb9b0d ^








2519e450 ^

dcccfacb ^

28f5cdf7 ^
2519e450 ^
d28930ea ^
8e0d8d2a ^
11066f20 ^
2519e450 ^
4cb302ab ^
dcccfacb ^

0cdbfecb ^
aa6e2284 ^
0cdbfecb ^
3c062438 ^



2519e450 ^
2b3d6451 ^
8014e902 ^
2655d9e8 ^


dcccfacb ^

b5171cb0 ^
dcccfacb ^




3ceb9b0d ^

dcccfacb ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243