1. create room
(1) attain unique name for room that will be created
<iq
id='unique1'
to='muc.test-d'
type='get'>
<unique xmlns='http://jabber.org/protocol/muc#unique'/>
</iq>
(2) use the unique name from step 1 to get the form of room and set some values in the form and send the form by iq
<iq id='create1'
to='testroom@muc.test-d'
type='get'>
<query xmlns='http://jabber.org/protocol/muc#owner'/>
</iq>
<iq type="set" id="create1" to="test006@muc.mml">
<query xmlns="http://jabber.org/protocol/muc#owner">
<x xmlns="jabber:x:data" type="submit">
<field var="muc#roomconfig_persistentroom">
<value>1</value>
</field>
<field var='muc#roomconfig_roomname'>
<value>test006</value>
</field>
<field var="muc#roomconfig_membersonly">
<value>1</value>
</field>
<field var="muc#roomconfig_changesubject">
<value>1</value>
</field>
</x>
</query>
</iq>
(3) add members into room that is created just now
<iq id='member1'
to='testroom1@muc.test-d'
type='set'>
<query xmlns='http://jabber.org/protocol/muc#admin'>
<item affiliation='admin'
jid='132@test-d' nick='kevin'/>
</query>
</iq>
tigase muc 协议
未经允许不得转载:搜云库技术团队 » tigase muc 协议