comparison mcabber/src/jabglue.c @ 449:e08b0c2d0e54

Add "/room unlock"
author Mikael Berthe <mikael@lilotux.net>
date Sun, 25 Sep 2005 23:45:34 +0200
parents 03bb57383cea
children 1d8f5b3a5f2b
comparison
equal deleted inserted replaced
448:39a28cb59af3 449:e08b0c2d0e54
481 x = jutil_presnew(JPACKET__UNKNOWN, 0, 0); 481 x = jutil_presnew(JPACKET__UNKNOWN, 0, 0);
482 xmlnode_put_attrib(x, "from", jid_full(jc->user)); 482 xmlnode_put_attrib(x, "from", jid_full(jc->user));
483 xmlnode_put_attrib(x, "to", room); 483 xmlnode_put_attrib(x, "to", room);
484 y = xmlnode_insert_tag(x, "x"); 484 y = xmlnode_insert_tag(x, "x");
485 xmlnode_put_attrib(y, "xmlns", "http://jabber.org/protocol/muc"); 485 xmlnode_put_attrib(y, "xmlns", "http://jabber.org/protocol/muc");
486
487 jab_send(jc, x);
488 xmlnode_free(x);
489 jb_reset_keepalive();
490 }
491
492 // Unlock a MUC room
493 // room syntax: "room@server"
494 void jb_room_unlock(const char *room)
495 {
496 xmlnode x, y, z;
497
498 if (!online) return;
499 if (!room) return;
500
501 x = jutil_iqnew(JPACKET__SET, "http://jabber.org/protocol/muc#owner");
502 xmlnode_put_attrib(x, "id", "unlock1"); // XXX
503 xmlnode_put_attrib(x, "to", room);
504 y = xmlnode_get_tag(x, "query");
505 z = xmlnode_insert_tag(y, "x");
506 xmlnode_put_attrib(z, "xmlns", "jabber:x:data");
507 xmlnode_put_attrib(z, "type", "submit");
486 508
487 jab_send(jc, x); 509 jab_send(jc, x);
488 xmlnode_free(x); 510 xmlnode_free(x);
489 jb_reset_keepalive(); 511 jb_reset_keepalive();
490 } 512 }