Mercurial > pidgin.yaz
changeset 7629:778624d3fced
[gaim-migrate @ 8253]
if we create a MUC room, we need to set it up
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Tue, 25 Nov 2003 05:26:17 +0000 |
parents | e293d0c42ccb |
children | 2df4d470c12a |
files | src/protocols/jabber/presence.c |
diffstat | 1 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/jabber/presence.c Tue Nov 25 03:30:59 2003 +0000 +++ b/src/protocols/jabber/presence.c Tue Nov 25 05:26:17 2003 +0000 @@ -231,7 +231,25 @@ /* this is where we'd normally get the "op" status of the * user, but since we don't have a good way to show that yet * we'll ignore it */ + xmlnode *z; + muc = TRUE; + if((z = xmlnode_get_child(y, "status"))) { + const char *code = xmlnode_get_attrib(z, "code"); + if(code && !strcmp(code, "201")) { + /* we created the room. for now, we'll make it + * an instant room. XXX: allow fancy room creation */ + JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_SET, + "http://jabber.org/protocol/muc#owner"); + xmlnode *query = xmlnode_get_child(iq->node, "query"); + + xmlnode *x = xmlnode_new_child(query, "x"); + xmlnode_set_attrib(x, "xmlns", "jabber:x:data"); + xmlnode_set_attrib(x, "type", "submit"); + + jabber_iq_send(iq); + } + } } } }