Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XEP-0227: Add support for MUC export, and clean up examples #1320

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
253 changes: 201 additions & 52 deletions xep-0227.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
<approver>Council</approver>
<dependencies>
<spec>XMPP IM</spec>
<spec>XEP-0004</spec>
<spec>XEP-0045</spec>
<spec>XEP-0049</spec>
<spec>XEP-0054</spec>
<spec>XEP-0068</spec>
</dependencies>
<supersedes/>
<supersededby/>
Expand All @@ -38,6 +41,15 @@
<jid>[email protected]</jid>
</author>
&mwild;
<revision>
<version>1.2.0</version>
<date>2023-12-15</date>
<initials>egp</initials>
<remark><ul>
<li>Reformat examples to fix indentation.</li>
<li>Add MUC support, with configuration, affiliations, MAM and vCard-temp support.</li>
</ul></remark>
</revision>
<revision>
<version>1.1</version>
<date>2021-06-02</date>
Expand Down Expand Up @@ -94,12 +106,16 @@
<li>
<p>All user data is stored, but no server configuration data.</p>
<p>User data has similar form throughout the XMPP world, but server configuration is implementation-specific. Therefore this specification does not attempt to transfer any aspects of the server configuration from one server to another.</p>
<p>Furthermore, the contents of MUC, Pubsub and other services are out of scope for this specification.</p>
<p>Furthermore, the contents of Pubsub and other services are out of scope for this specification.</p>
</li>
<li>
<p>Multiple virtual hosts are supported.</p>
<p>Many server implementations can serve several hostnames in a single server instance. Thus this specification allows storing data from several virtual hosts.</p>
</li>
<li>
<p>&xep0045; rooms are supported.</p>
<p>Many servers offer a service for storing persistent rooms. This specification allows them to be defined in any virtual host, but some server software might apply additional restrictions.</p>
</li>
</ul>
</section1>

Expand Down Expand Up @@ -234,16 +250,16 @@
<user name='juliet'>
<offline-messages>
<message xmlns='jabber:client'
from='[email protected]/orchard'
to='[email protected]/balcony'
type='chat'>
<body>Neither, fair saint, if either thee dislike.</body>
<delay xmlns='urn:xmpp:delay'
from='capulet.com'
stamp='1469-07-21T00:32:29Z'>
Offline Storage
</delay>
</message>
from='[email protected]/orchard'
to='[email protected]/balcony'
type='chat'>
<body>Neither, fair saint, if either thee dislike.</body>
<delay xmlns='urn:xmpp:delay'
from='capulet.com'
stamp='1469-07-21T00:32:29Z'>
Offline Storage
</delay>
</message>
</offline-messages>
</user>
</host>
Expand All @@ -260,9 +276,9 @@
<host jid='shakespeare.lit'>
<user name='hamlet'>
<query xmlns="jabber:iq:private">
<exodus xmlns="exodus:prefs">
<defaultnick>Hamlet</defaultnick>
</exodus>
<exodus xmlns="exodus:prefs">
<defaultnick>Hamlet</defaultnick>
</exodus>
</query>
</user>
</host>
Expand Down Expand Up @@ -403,15 +419,15 @@
<items node='urn:xmpp:bookmarks:1'>
<item id='[email protected]'>
<conference xmlns='urn:xmpp:bookmarks:1'
name='The Play&apos;s the Thing'
autojoin='true'>
name='The Play&apos;s the Thing'
autojoin='true'>
<nick>Romeo</nick>
</conference>
</item>
<item id='[email protected]'>
<conference xmlns='urn:xmpp:bookmarks:1'
name='The Orchard'
autojoin='1'>
name='The Orchard'
autojoin='1'>
<nick>Romeo</nick>
</conference>
</item>
Expand All @@ -438,34 +454,157 @@
<user name='juliet'>
<archive xmlns='urn:xmpp:pie:0#mam'>
<result xmlns='urn:xmpp:mam:2' id='28482-98726-73623'>
<forwarded xmlns='urn:xmpp:forward:0'>
<delay xmlns='urn:xmpp:delay' stamp='2010-07-10T23:08:25Z'/>
<message xmlns='jabber:client'
to='[email protected]/balcony'
from='[email protected]/orchard'
type='chat'>
<body>Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.</body>
</message>
</forwarded>
</result>
<result xmlns='urn:xmpp:mam:2' id='5d398-28273-f7382'>
<forwarded xmlns='urn:xmpp:forward:0'>
<delay xmlns='urn:xmpp:delay' stamp='2010-07-10T23:09:32Z'/>
<message xmlns='jabber:client'
to='[email protected]/orchard'
from='[email protected]/balcony'
type='chat' id='8a54s'>
<body>What man art thou that thus bescreen'd in night so stumblest on my counsel?</body>
</message>
</forwarded>
</result>
<forwarded xmlns='urn:xmpp:forward:0'>
<delay xmlns='urn:xmpp:delay' stamp='2010-07-10T23:08:25Z'/>
<message xmlns='jabber:client'
to='[email protected]/balcony'
from='[email protected]/orchard'
type='chat'>
<body>Call me but love, and I'll be new baptized; Henceforth I never will be Romeo.</body>
</message>
</forwarded>
</result>
<result xmlns='urn:xmpp:mam:2' id='5d398-28273-f7382'>
<forwarded xmlns='urn:xmpp:forward:0'>
<delay xmlns='urn:xmpp:delay' stamp='2010-07-10T23:09:32Z'/>
<message xmlns='jabber:client'
to='[email protected]/orchard'
from='[email protected]/balcony'
type='chat' id='8a54s'>
<body>What man art thou that thus bescreen'd in night so stumblest on my counsel?</body>
</message>
</forwarded>
</result>
</archive>
</user>
</host>
</server-data>
]]></example>

</section2>

<section2 topic='Chat rooms' anchor='muc'>
<p>A server MAY host a &xep0045; service, in which case it SHOULD be included in an export.</p>
<p>This specification defines the &lt;room/&gt; element, with currently four extension points:</p>
<ul>
<li>The &lt;x/&gt; element, qualified by the 'http://jabber.org/protocol/muc#user' namespace, contains the affiliations of this room.</li>
<li>The &lt;query/&gt; element, qualified by the 'http://jabber.org/protocol/muc#owner' namespace, contains the configuration of this room, in a data form (see &xep0004;) qualified by the 'http://jabber.org/protocol/muc#roomconfig' FORM_TYPE (see &xep0068;).</li>
<li>The &lt;archive/&gt; element, qualified by the 'urn:xmpp:pie:0#mam' namespace, contains the archives of this room, as defined in <link url='#archive'>the previous section</link>.</li>
<li>The &lt;vCard/&gt; element, qualified by the 'vcard-temp' namespace, contains exclusively the avatar of this room and its Content-Type, as defined in <link url='#vcards'>a previous section</link>.</li>
</ul>

<example caption='The [email protected] room export'><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
<server-data xmlns='urn:xmpp:pie:0'>
<host jid='chat.shakespeare.lit'>
<room name='coven'>
<x xmlns='http://jabber.org/protocol/muc#user'>
<item jid='[email protected]' nick='firstwitch' affiliation='owner'/>
<item jid='[email protected]' nick='secondwitch' affiliation='admin'/>
</x>
<query xmlns='http://jabber.org/protocol/muc#owner'>
<x xmlns='jabber:x:data' type='submit'>
<field var='FORM_TYPE'>
<value>http://jabber.org/protocol/muc#roomconfig</value>
</field>
<field var='muc#roomconfig_roomname'>
<value>A Dark Cave</value>
</field>
<field var='muc#roomconfig_roomdesc'>
<value>The place for all good witches!</value>
</field>
<field var='muc#roomconfig_enablelogging'>
<value>0</value>
</field>
<field var='muc#roomconfig_changesubject'>
<value>1</value>
</field>
<field var='muc#roomconfig_allowinvites'>
<value>0</value>
</field>
<field var='muc#roomconfig_allowpm'>
<value>anyone</value>
</field>
<field var='muc#roomconfig_maxusers'>
<value>10</value>
</field>
<field var='muc#roomconfig_publicroom'>
<value>0</value>
</field>
<field var='muc#roomconfig_persistentroom'>
<value>0</value>
</field>
<field var='muc#roomconfig_moderatedroom'>
<value>0</value>
</field>
<field var='muc#roomconfig_membersonly'>
<value>0</value>
</field>
<field var='muc#roomconfig_passwordprotectedroom'>
<value>1</value>
</field>
<field var='muc#roomconfig_roomsecret'>
<value>cauldronburn</value>
</field>
<field var='muc#roomconfig_whois'>
<value>moderators</value>
</field>
<field var='muc#maxhistoryfetch'>
<value>50</value>
</field>
<field var='muc#roomconfig_roomadmins'>
<value>[email protected]</value>
<value>[email protected]</value>
</field>
</x>
</query>
<archive xmlns='urn:xmpp:pie:0#mam'>
<result xmlns='urn:xmpp:mam:2' id='78527-06716-51603'>
<forwarded xmlns='urn:xmpp:forward:0'>
<delay xmlns='urn:xmpp:delay' stamp='2002-10-13T23:58:37Z'/>
<message xmlns="jabber:client"
from='[email protected]/firstwitch'
id='162BEBB1-F6DB-4D9A-9BD8-CFDCC801A0B2'
type='groupchat'>
<body>Thrice the brinded cat hath mew'd.</body>
<x xmlns='http://jabber.org/protocol/muc#user'>
<item affiliation='owner'
jid='[email protected]'
role='participant' />
</x>
</message>
</forwarded>
</result>
<result xmlns='urn:xmpp:mam:2' id='34482-21985-73620'>
<forwarded xmlns='urn:xmpp:forward:0'>
<delay xmlns='urn:xmpp:delay' stamp='2002-10-13T23:58:43Z'/>
<message xmlns="jabber:client"
from='[email protected]/secondwitch'
id='90057840-30FD-4141-AA44-103EEDF218FC'
type='groupchat'>
<body>Thrice and once the hedge-pig whined.</body>
<x xmlns='http://jabber.org/protocol/muc#user'>
<item affiliation='admin'
jid='[email protected]'
role='participant' />
</x>
</message>
</forwarded>
</result>
</archive>
<vCard xmlns='vcard-temp'>
<PHOTO>
<TYPE>image/png</TYPE>
<BINVAL>
Base64-encoded-avatar-file-here!
</BINVAL>
</PHOTO>
</vCard>
</room>
</host>
</server-data>
]]></example>
</section2>
</section1>

<section1 topic='Use of XInclude' anchor='xinclude'>
Expand Down Expand Up @@ -506,8 +645,8 @@
name='juliet'>
<query xmlns='jabber:iq:roster'>
<item jid='[email protected]'
name='Romeo'
subscription='both'>
name='Romeo'
subscription='both'>
<group>Friends</group>
</item>
</query>
Expand All @@ -516,14 +655,14 @@
</vCard>
<offline-messages>
<message xmlns='jabber:client'
from='[email protected]/orchard'
to='[email protected]/balcony'
type='chat'>
from='[email protected]/orchard'
to='[email protected]/balcony'
type='chat'>
<body>Neither, fair saint, if either thee dislike.</body>
<delay xmlns='urn:xmpp:delay'
from='capulet.com'
stamp='1469-07-21T00:32:29Z'>
Offline Storage
from='capulet.com'
stamp='1469-07-21T00:32:29Z'>
Offline Storage
</delay>
</message>
</offline-messages>
Expand Down Expand Up @@ -588,8 +727,9 @@
<xs:element name='host'>
<xs:complexType>
<xs:sequence>
<xs:element ref='user' maxOccurs='unbounded'/>
<xs:any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
<xs:element ref='user' maxOccurs='unbounded'/>
<xs:element ref='room' maxOccurs='unbounded'/>
<xs:any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attribute name='jid' type='xs:string' use='required'/>
</xs:complexType>
Expand All @@ -598,8 +738,8 @@
<xs:element name='user'>
<xs:complexType>
<xs:sequence>
<xs:element ref='offline-messages' minOccurs='0' maxOccurs='1'/>
<xs:any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
<xs:element ref='offline-messages' minOccurs='0' maxOccurs='1'/>
<xs:any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attribute name='name' type='xs:string' use='required'/>
<xs:attribute name='password' type='xs:string' use='optional'/>
Expand All @@ -609,11 +749,20 @@
<xs:element name='offline-messages'>
<xs:complexType>
<xs:sequence>
<xs:any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
<xs:any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name='room'>
<xs:complexType>
<xs:sequence>
<xs:any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
</xs:sequence>
<xs:attribute name='name' type='xs:string' use='required'/>
</xs:complexType>
</xs:element>

</xs:schema>
]]></code>
</section1>
Expand Down
Loading