Tigase报文

muc报文

#新建持久房间:发送类型为“get”包含一个遵循http://jabber.org/protocol/muc#owner名字空间的<query/>元素的IQ节给该房间请求房间配置
<iq id='create1'
    to='bkizmugw73skorc28kxi94wjfnsy6q@muc.mml'
    type='get'>
  <query xmlns='http://jabber.org/protocol/muc#owner'/>
</iq>

#房间所有者填写完成表单返回提交给服务。名称为 test聊天室 ,roomjid为 bkizmugw73skorc28kxi94wjfnsy6q
<iq to='bkizmugw73skorc28kxi94wjfnsy6q@muc.mml' id='IC1Ws-15' type='set'>
<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>test聊天室</value></field>
<field var='muc#roomconfig_membersonly'><value>1</value></field>
<field var='muc#roomconfig_changesubject'><value>1</value></field>
</x></query></iq>




#systemmucuser用户加入
<iq to='bkizmugw73skorc28kxi94wjfnsy6q@muc.mml' id='IC1Ws-17' type='set'><query xmlns='http://jabber.org/protocol/muc#admin'><item affiliation='admin' jid='15011120562@mml' nick='15011120562'/></query></iq>




#普通成员用户加入(目前,老板也是普通成员)
<iq to='83-48-106-55@muc.mml' id='WA7e2-10' type='set'>
<query xmlns='http://jabber.org/protocol/muc#admin'>
	<item affiliation='admin' jid='1000002767@mml' nick='1000002767'/>
</query>
</iq>




#移除员工(或员工退出)
<iq to='bkizmugw73skorc28kxi94wjfnsy6q@muc.mml' id='5V9Iw-10' type='set'><query xmlns='http://jabber.org/protocol/muc#admin'><item affiliation='none' jid='13000000043@mml' nick='dddaad'/></query></iq>





#聊天室消息:C to S
<message to='bws45jao32gpe34g0276dvh4vcw9em@muc.mml' id='BMppz-10' type='groupchat'><body>欢迎caoyuan加入本机构</body></message>


#聊天室消息:S to C
<message type="groupchat" id="ab46a" to="3000003737@mml" from="169_165717_165716_241_240@muc.mml/3000003737">
<body>test</body>
<delay xmlns="urn:xmpp:delay" stamp="2018-01-19T00:41:23Z"/>
</message>


#1.获取所有历史消息
<presence to="7e2d0e643a22424995b60a3af26efec1579@muc.mml/1000002497">
<priority>50</priority>
<c xmlns="http://jabber.org/protocol/caps" node="http://psi-im.org" hash="sha-1" ver="zeIgZSHkBRJHk6AyDoj5TpSsnVo="/>
<x xmlns="http://jabber.org/protocol/muc"/>
</presence>


#2.获取指定时间历史消息,单位秒
<presence to='7e2d0e643a22424995b60a3af26efec1579@muc.mml/1000002497'>
  <x xmlns='http://jabber.org/protocol/muc'>
    <history seconds='180000'/>
  </x>
</presence>



#3.1.获取房间所有的成员
<iq
    id='member3'
    to='unipei_2_c8da714ef3f54fc98e3d0cdfb43f75e8aaa@muc.mml'
    type='get'>
  <query xmlns='http://jabber.org/protocol/muc#admin'>
    <item affiliation='admin'/>
  </query>
</iq>

#3.2.官方获取房间所有的成员
<iq type="get" id="aad0a" to="test008@muc.mml">
<query xmlns="http://jabber.org/protocol/disco#items"/>
</iq>


#4.获取所有的房间
<iq id="v8C48-4" to="muc.test-d" type="get"><query xmlns="http://jabber.org/protocol/disco#items"></query></iq>


#5.用户查询自己所在些房间
<iq 
    from='15011120561@mml'
    id='disco2'
    to='muc.mml'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>

pubsub报文

=================================离线的格式======================================

<message to="3000003771@mml" xmlns="jabber:client" id="111" from="pubsub.mml"><amp xmlns="http://jabber.org/protocol/amp"><rule value="2017-12-07T00:00:00Z" condition="expire-at" action="drop"/></amp><event xmlns="http://jabber.org/protocol/pubsub#event"><items node="/MML/1/1000000000"><item id="12142eef-6205-4060-80b2-648f56cf59fe" expire-at="2017-12-07T00:00:00Z"><content>{"seq":"N1510037525666","type":"1","busiType":"5001","title":"\u8054\u76DF\u7BA1\u7406\u6D88\u606F","content":"mu\u6709\u8D27\u5DF2\u5C06\u60A8\u6DFB\u52A0\u4E3A\u8054\u76DF\u6210\u5458","params":{"unionID":89},"createTime":"2017-11-07 14:52:05"}</content></item></items></event><delay stamp="2017-11-07T06:50:50.223Z" xmlns="urn:xmpp:delay" from="mml">Offline Storage</delay></message>


<message to="3000003747@mml" xmlns="jabber:client" id="332" from="pubsub.mml"><amp xmlns="http://jabber.org/protocol/amp"><rule value="2017-12-07T00:00:00Z" condition="expire-at" action="drop"/></amp><event xmlns="http://jabber.org/protocol/pubsub#event"><items node="/MML/1/1000000000"><item id="9b571715-0777-4aa6-a6fb-093efb5185c0" expire-at="2017-12-07T00:00:00Z"><content>{"seq":"N1510046909987","type":"1","busiType":"4002","title":"\u793E\u4EA4\u6D88\u606F","content":"\u4E00\u4E03\u4E94\u4E8C\u96F6\u4E09\u6D4B\u8BD5\u4F01\u4E1A\u901A\u8FC7\u4E86\u60A8\u7684\u4F01\u4E1A\u597D\u53CB\u7533\u8BF7","params":{},"createTime":"2017-11-07 17:28:29"}</content></item></items></event><delay stamp="2017-11-07T09:27:14.531Z" xmlns="urn:xmpp:delay" from="mml">Offline Storage</delay></message>



<message to="3000002098@mml" xmlns="jabber:client" id="373" from="pubsub.mml"><amp xmlns="http://jabber.org/protocol/amp"><rule value="2017-12-07T00:00:00Z" condition="expire-at" action="drop"/></amp><event xmlns="http://jabber.org/protocol/pubsub#event"><items node="/MML/1/1000000000"><item id="cb7f46d4-8b04-45b1-b78e-b95aefd5ab39" expire-at="2017-12-07T00:00:00Z"><content>{"seq":"N1510052375450","type":"1","busiType":"6001","title":"\u5458\u5DE5\u7BA1\u7406\u6D88\u606F","content":"\u60A8\u5DF2\u6210\u4E3A\u4E00\u4E03\u4E94\u4E8C\u96F6\u4E09\u6D4B\u8BD5\u4F01\u4E1A\u7684\u8001\u677F","params":{},"createTime":"2017-11-07 18:59:35"}</content></item></items></event><delay stamp="2017-11-07T10:58:19.985Z" xmlns="urn:xmpp:delay" from="mml">Offline Storage</delay></message>



<message to="3000002098@mml" xmlns="jabber:client" id="399" from="pubsub.mml"><amp xmlns="http://jabber.org/protocol/amp"><rule value="2017-12-07T00:00:00Z" condition="expire-at" action="drop"/></amp><event xmlns="http://jabber.org/protocol/pubsub#event"><items node="/MML/1/1000000000"><item id="5266f9a9-3d6e-4eba-8616-287c9cd6d01b" expire-at="2017-12-07T00:00:00Z"><content>{"seq":"N1510053663552","type":"1","busiType":"6001","title":"\u5458\u5DE5\u7BA1\u7406\u6D88\u606F","content":"\u60A8\u5DF2\u6210\u4E3A\u4E00\u4E03\u4E94\u4E8C\u96F6\u4E09\u6D4B\u8BD5\u4F01\u4E1A\u7684\u8001\u677F","params":{},"createTime":"2017-11-07 19:21:03"}</content></item></items></event><delay stamp="2017-11-07T11:19:48.082Z" xmlns="urn:xmpp:delay" from="mml">Offline Storage</delay></message>



<message to="3000003782@mml" xmlns="jabber:client" id="430" from="pubsub.mml"><amp xmlns="http://jabber.org/protocol/amp"><rule value="2017-12-07T00:00:00Z" condition="expire-at" action="drop"/></amp><event xmlns="http://jabber.org/protocol/pubsub#event"><items node="/MML/1/1000000000"><item id="d348616c-2821-4ff3-94c6-aca7425869ed" expire-at="2017-12-07T00:00:00Z"><content>{"seq":"N1510055223071","type":"1","busiType":"4002","title":"\u793E\u4EA4\u6D88\u606F","content":"\u7ED9\u4F60\u4E00\u5206\u949F\u4FEE\u7406\u5382\u901A\u8FC7\u4E86\u60A8\u7684\u4F01\u4E1A\u597D\u53CB\u7533\u8BF7","params":{},"createTime":"2017-11-07 19:47:03"}</content></item></items></event><delay stamp="2017-11-07T11:45:47.603Z" xmlns="urn:xmpp:delay" from="mml">Offline Storage</delay></message>



<message to="3000002746@mml" xmlns="jabber:client" id="539" from="pubsub.mml"><amp xmlns="http://jabber.org/protocol/amp"><rule value="2017-12-08T00:00:00Z" condition="expire-at" action="drop"/></amp><event xmlns="http://jabber.org/protocol/pubsub#event"><items node="/MML/1/1000000000"><item id="4b827f4b-b70c-4472-862c-3fa00607e588" expire-at="2017-12-08T00:00:00Z"><content>{"seq":"N1510108761059","type":"1","busiType":"5002","title":"\u8054\u76DF\u7BA1\u7406\u6D88\u606F","content":"\u6B66\u6C49\u6C7D\u8F66\u7ECF\u9500\u5546\u8054\u76DF\u5411\u60A8\u53D1\u8D77\u597D\u53CB\u7533\u8BF7\uFF0C\u8BF7\u5C3D\u5FEB\u5904\u7406","params":{"applyID":98,"unionID":68},"createTime":"2017-11-08 10:39:21"}</content></item></items></event><delay stamp="2017-11-08T02:38:05.516Z" xmlns="urn:xmpp:delay" from="mml">Offline Storage</delay></message>





============================在线的格式===============================
<message to="1000002497@mml" id="528" from="pubsub.mml">
<amp xmlns="http://jabber.org/protocol/amp">
<rule action="drop" condition="expire-at" value="2018-01-07T00:00:00Z"/>
</amp>
<event xmlns="http://jabber.org/protocol/pubsub#event">
<items node="/MML/1/1000000000">
<item expire-at="2018-01-07T00:00:00Z" id="d9671451-c7a6-441c-9e63-4a5b9863f593">
<content>ffffffffffffffffffffffff</content>
</item>
</items>
</event>
</message>

作者:被禁言文章转简书了
链接:https://juejin.cn/post/6844904194579628039
来源:掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!
XMPP协议
0 条回复 A 作者 M 管理员
    所有的伟大,都源于一个勇敢的开始!
欢迎您,新朋友,感谢参与互动!欢迎您 {{author}},您在本站有{{commentsCount}}条评论