Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/jabglue.c @ 900:b41684465283
MUC: join password-protected room
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Fri, 16 Jun 2006 22:38:49 +0200 |
parents | 39aff86d64e7 |
children | a07bd351008b |
comparison
equal
deleted
inserted
replaced
899:a833f3d6119a | 900:b41684465283 |
---|---|
603 g_free(fulljid); | 603 g_free(fulljid); |
604 } | 604 } |
605 } | 605 } |
606 | 606 |
607 // Join a MUC room | 607 // Join a MUC room |
608 void jb_room_join(const char *room, const char *nickname) | 608 void jb_room_join(const char *room, const char *nickname, const char *passwd) |
609 { | 609 { |
610 xmlnode x, y; | 610 xmlnode x, y; |
611 gchar *roomid; | 611 gchar *roomid; |
612 GSList *room_elt; | 612 GSList *room_elt; |
613 | 613 |
638 | 638 |
639 // Send the XML request | 639 // Send the XML request |
640 x = presnew(mystatus, roomid, mystatusmsg); | 640 x = presnew(mystatus, roomid, mystatusmsg); |
641 y = xmlnode_insert_tag(x, "x"); | 641 y = xmlnode_insert_tag(x, "x"); |
642 xmlnode_put_attrib(y, "xmlns", "http://jabber.org/protocol/muc"); | 642 xmlnode_put_attrib(y, "xmlns", "http://jabber.org/protocol/muc"); |
643 if (passwd) { | |
644 xmlnode_insert_cdata(xmlnode_insert_tag(y, "password"), passwd, | |
645 (unsigned) -1); | |
646 } | |
643 | 647 |
644 jab_send(jc, x); | 648 jab_send(jc, x); |
645 xmlnode_free(x); | 649 xmlnode_free(x); |
646 jb_reset_keepalive(); | 650 jb_reset_keepalive(); |
647 g_free(roomid); | 651 g_free(roomid); |