Mercurial > pidgin.yaz
diff src/protocols/jabber/chat.c @ 7895:ddd80ffd3815
[gaim-migrate @ 8555]
wanted to get this committed before I went home
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Fri, 19 Dec 2003 08:33:03 +0000 |
parents | 0555e59dfba9 |
children | e87e7d9d0132 |
line wrap: on
line diff
--- a/src/protocols/jabber/chat.c Fri Dec 19 08:31:06 2003 +0000 +++ b/src/protocols/jabber/chat.c Fri Dec 19 08:33:03 2003 +0000 @@ -24,6 +24,7 @@ #include "notify.h" #include "chat.h" +#include "iq.h" #include "message.h" #include "presence.h" @@ -264,3 +265,36 @@ return g_strdup_printf("%s@%s/%s", chat->room, chat->server, who); } + +void jabber_chat_start_room_configure(JabberChat *chat) { + if(!chat) + return; + + /* XXX: implement me! */ + + /* XXX: for now... */ + jabber_chat_create_instant_room(chat); +} + +void jabber_chat_create_instant_room(JabberChat *chat) { + JabberIq *iq; + xmlnode *query, *x; + char *room_jid; + + if(!chat) + return; + + iq = jabber_iq_new_query(chat->js, JABBER_IQ_SET, + "http://jabber.org/protocol/muc#owner"); + query = xmlnode_get_child(iq->node, "query"); + x = xmlnode_new_child(query, "x"); + room_jid = g_strdup_printf("%s@%s", chat->room, chat->server); + + xmlnode_set_attrib(iq->node, "to", room_jid); + xmlnode_set_attrib(x, "xmlns", "jabber:x:data"); + xmlnode_set_attrib(x, "type", "submit"); + + jabber_iq_send(iq); + + g_free(room_jid); +}