-
查询当前聊天室
<iq to="muc.teemo.com" id="klk5b-401" type="get"> <query xmlns="http://jabber.org/protocol/disco#items"/> </iq>
服务器返回报文
<iq xmlns="jabber:client" to="bbb@teemo.com/DESKTOP-S0OC5N3" from="muc.teemo.com" type="result" id="klk5b-425"> <query xmlns="http://jabber.org/protocol/disco#items"> <item name="aaa" jid="aaa@muc.teemo.com"/> <item name="bbb" jid="bbb@muc.teemo.com"/> </query> </iq>
-
创建聊天室
<iq to="groupname@muc.teemo.com" id="klk5b-526" type="get"> <query xmlns="http://jabber.org/protocol/disco#info"/> </iq>
服务器返回
<iq xmlns="jabber:client" to="bbb@teemo.com/DESKTOP-S0OC5N3" from="groupname@muc.teemo.com" type="error" id="klk5b-528"> <query xmlns="http://jabber.org/protocol/disco#info"/> <error code="404" type="cancel"> <item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> </error> </iq>
客服端发送
<presence to="groupname@muc.teemo.com/bbb" id="klk5b-530"> <x xmlns="http://jabber.org/protocol/muc"/> <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.igniterealtime.org/projects/smack" ver="TJuVIXqTCVfJSthaPu4MtTbaf9A="/> </presence>
服务器返回
<presence to="bbb@teemo.com/DESKTOP-S0OC5N3" xmlns="jabber:client" from="groupname@muc.teemo.com/bbb" id="klk5b-530"> <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" node="http://www.igniterealtime.org/projects/smack" ver="TJuVIXqTCVfJSthaPu4MtTbaf9A="/> <x xmlns="http://jabber.org/protocol/muc#user"><item affiliation="owner" role="moderator" nick="bbb" jid="bbb@teemo.com/DESKTOP-S0OC5N3"/> <status code="110"/> <status code="201"/> </x> </presence>
服务器返回
<message to="bbb@teemo.com/DESKTOP-S0OC5N3" xmlns="jabber:client" from="groupname@muc.teemo.com/bbb" type="groupchat" id="c46dd0b712a678f2335c7976f7b657fe3367783e"> <subject/> <delay xmlns="urn:xmpp:delay" stamp="2018-06-25T06:25:25Z" jid="groupname@muc.teemo.com/bbb"/> <x xmlns="jabber:x:delay" stamp="20180625T06:25:25"/> <req id="263" xmlns="jabber:client"/> </message>
服务器返回
<message xmlns="jabber:client" to="bbb@teemo.com/DESKTOP-S0OC5N3" from="groupname@muc.teemo.com" type="groupchat"> <body>Room is locked. Please configure.</body> <req id="264" xmlns="jabber:client"/> </message>
服务器返回
<message xmlns="jabber:client" to="bbb@teemo.com/DESKTOP-S0OC5N3" from="groupname@muc.teemo.com" type="groupchat"> <body>Welcome! You created new Multi User Chat Room. Room is locked now. Configure it please!</body> <req id="265" xmlns="jabber:client"/> </message>
客户端发送
<iq to="groupname@muc.teemo.com" id="klk5b-535" type="get"> <query xmlns="http://jabber.org/protocol/muc#owner"/> </iq>
服务器返回
<iq to="bbb@teemo.com/DESKTOP-S0OC5N3" xmlns="jabber:client" from="groupname@muc.teemo.com" type="result" id="klk5b-535"><query xmlns="http://jabber.org/protocol/muc#owner"> <x xmlns="jabber:x:data" type="form"> <field label="Natural-Language Room Name" type="text-single" var="muc#roomconfig_roomname"> <value></value> </field> <field label="Short Description of Room" type="text-single" var="muc#roomconfig_roomdesc"> <value></value> </field> <field label="Make Room Persistent?" type="boolean" var="muc#roomconfig_persistentroom"> <value>0</value> </field> <field label="Make Room Publicly Searchable?" type="boolean" var="muc#roomconfig_publicroom"> <value>1</value> </field> <field label="Make Room Moderated?" type="boolean" var="muc#roomconfig_moderatedroom"> <value>0</value> </field> <field label="Make Room Members Only?" type="boolean" var="muc#roomconfig_membersonly"> <value>0</value> </field> <field label="Allow Occupants to Invite Others?" type="boolean" var="muc#roomconfig_allowinvites"> <value>1</value> </field> <field label="Password Required to Enter?" type="boolean" var="muc#roomconfig_passwordprotectedroom"> <value>0</value> </field> <field label="Password" type="text-single" var="muc#roomconfig_roomsecret"> <value></value> </field> <field label="Room anonymity level:" type="list-single" var="muc#roomconfig_anonymity"> <value>semianonymous</value> <option label="Non-Anonymous Room"> <value>nonanonymous</value> </option> <option label="Semi-Anonymous Room"> <value>semianonymous</value> </option> <option label="Fully-Anonymous Room"> <value>fullanonymous</value> </option> </field> <field label="Allow Occupants to Change Subject?" type="boolean" var="muc#roomconfig_changesubject"> <value>0</value> </field> <field label="Enable Public Logging?" type="boolean" var="muc#roomconfig_enablelogging"> <value>0</value> </field> <field label="Logging format:" type="list-single" var="logging_format"> <value>html</value> <option label="HTML"> <value>html</value> </option> <option label="Plain text"> <value>plain</value> </option> </field> <field label="Maximum Number of History Messages Returned by Room" type="text-single" var="muc#maxhistoryfetch"> <value>50</value> </field> <field label="Maximum Number of Occupants" type="list-single" var="muc#roomconfig_maxusers"> <value></value> <option label="10"> <value>10</value> </option> <option label="20"> <value>20</value> </option> <option label="30"> <value>30</value> </option> <option label="50"> <value>50</value> </option> <option label="100"> <value>100</value> </option> <option label="None"> <value/> </option> </field> <field label="Presence delivery logic" type="list-single" var="tigase#presence_delivery_logic"> <value>PREFERE_PRIORITY</value> <option label="PREFERE_LAST"> <value>PREFERE_LAST</value> </option> <option label="PREFERE_PRIORITY"> <value>PREFERE_PRIORITY</value> </option> </field> <field label="Enable filtering of presence (broadcasting presence only between selected groups" type="boolean" var="tigase#presence_filtering"> <value>0</value> </field> <field label="Affiliations for which presence should be delivered" type="list-multi" var="tigase#presence_filtered_affiliations"> <option label="admin"> <value>admin</value> </option> <option label="member"> <value>member</value> </option> <option label="none"> <value>none</value> </option> <option label="outcast"> <value>outcast</value> </option> <option label="owner"> <value>owner</value> </option> </field> <field label="Send welcome messages on room creation" type="boolean" var="tigase#welcome_messages"> <value>1</value> </field> <field label="Full List of Room Admins" type="jid-multi" var="muc#roomconfig_roomadmins"/> </x> </query> </iq> 客户端发送 <iq to="groupname@muc.teemo.com" id="klk5b-679" type="set"> <query xmlns="http://jabber.org/protocol/muc#owner"> <x xmlns="jabber:x:data" type="submit"> <field type="text-single" var="muc#roomconfig_roomname"> <value>1111111</value> </field> <field type="text-single" var="muc#roomconfig_roomdesc"> <value>222222222</value> </field> <field type="boolean" var="muc#roomconfig_persistentroom"> <value>1</value> </field> <field type="boolean" var="muc#roomconfig_publicroom"> <value>1</value> </field> <field type="boolean" var="muc#roomconfig_moderatedroom"> <value>0</value> </field> <field type="boolean" var="muc#roomconfig_membersonly"> <value>0</value> </field> <field type="boolean" var="muc#roomconfig_allowinvites"> <value>1</value> </field> <field type="boolean" var="muc#roomconfig_passwordprotectedroom"><value>0</value></field> <field type="text-single" var="muc#roomconfig_roomsecret"> <value/> </field> <field type="list-single" var="muc#roomconfig_anonymity"> <value>semianonymous</value> </field> <field type="boolean" var="muc#roomconfig_changesubject"> <value>0</value> </field> <field type="boolean" var="muc#roomconfig_enablelogging"> <value>0</value> </field> <field type="list-single" var="logging_format"> <value>html</value> </field> <field type="text-single" var="muc#maxhistoryfetch"> <value>50</value> </field> <field type="list-single" var="muc#roomconfig_maxusers"> <value/> </field> <field type="list-single" var="tigase#presence_delivery_logic"> <value>PREFERE_PRIORITY</value> </field> <field type="boolean" var="tigase#presence_filtering"> <value>0</value> </field> <field type="boolean" var="tigase#welcome_messages"> <value>1</value> </field> <field type="jid-multi" var="muc#roomconfig_roomadmins"> <value>你来了。</value> </field> </x> </query> </iq>
屏蔽用户
<iq to="groupname@muc.teemo.com" id="klk5b-767" type="set"> <query xmlns="http://jabber.org/protocol/muc#admin"> <item affiliation="outcast" jid="aaa@teemo.com"> <reason>你被此聊天室屏蔽了。</reason> </item> </query> </iq>
04-19
06-09
3654
