comparison mcabber/src/xmpp_muc.c @ 1664:2f6bdfa0cb01

Fix room unlocking
author Myhailo Danylenko <isbear@ukrpost.net>
date Sat, 30 Jan 2010 17:54:58 +0200
parents 351427ef0b4b
children 1a4890514eb9
comparison
equal deleted inserted replaced
1663:dcb0b4522ded 1664:2f6bdfa0cb01
230 230
231 // Unlock a MUC room 231 // Unlock a MUC room
232 // room syntax: "room@server" 232 // room syntax: "room@server"
233 void xmpp_room_unlock(const char *room) 233 void xmpp_room_unlock(const char *room)
234 { 234 {
235 LmMessageNode *y, *z; 235 LmMessageNode *node;
236 LmMessage *iq; 236 LmMessage *iq;
237 237
238 if (!lm_connection_is_authenticated(lconnection) || !room) return; 238 if (!lm_connection_is_authenticated(lconnection) || !room) return;
239 239
240 iq = lm_message_new_with_sub_type(room, LM_MESSAGE_TYPE_IQ, 240 iq = lm_message_new_with_sub_type(room, LM_MESSAGE_TYPE_IQ,
241 LM_MESSAGE_SUB_TYPE_SET); 241 LM_MESSAGE_SUB_TYPE_SET);
242 lm_message_node_set_attribute(iq->node, "xmlns", 242
243 node = lm_message_node_add_child(iq->node, "query", NULL);
244 lm_message_node_set_attribute(node, "xmlns",
243 "http://jabber.org/protocol/muc#owner"); 245 "http://jabber.org/protocol/muc#owner");
244 246 node = lm_message_node_add_child(node, "x", NULL);
245 247 lm_message_node_set_attributes(node, "xmlns", "jabber:x:data",
246 y = lm_message_node_add_child(iq->node, "query", NULL); 248 "type", "submit", NULL);
247 z = lm_message_node_add_child(y, "x", NULL);
248 lm_message_node_set_attribute(z, "xmlns", "jabber:x:data");
249 lm_message_node_set_attribute(z, "type", "submit");
250 249
251 lm_connection_send(lconnection, iq, NULL); 250 lm_connection_send(lconnection, iq, NULL);
252 lm_message_unref(iq); 251 lm_message_unref(iq);
253 } 252 }
254 253