XMPP Component Protocol: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
Line 77: Line 77:
</iq>
</iq>


Announce that somebody has joined an activity.
Component tells XO that somebody has joined an activity.


<message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
<message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">

Revision as of 20:52, 30 November 2007

Information about the protocol for the OLPC-specific XMPP server component.

Protocol Overview

Laptops query the server about activities and buddies. For both kinds of query, there is at most one result set active at any given time. Result sets are managed using the Result Set Management (RSM) XMPP extension, as described in XEP-0059.

The component sends notifications to clients based on their current result sets.

Activity Protocol

Namespace: http://laptop.org/xmpp/activity

Query

Return all activities matching the properties given.

Example: XO searches for all instances of the "Connect" activity.

 <iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
   <query xmlns="...">
     <activity>
       <property type="str" name="type">org.laptop.Connect</property>
     </activity>
   </query>
 </iq>

Example: XO searches for an activity by ID.

 <iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
   <query xmlns="...">
     <activity id="abcde123" />
   </query>
 </iq>

Search results can contain information about the buddies in them.

Example: server replies to query.

 <iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
   <query xmlns="...">
     <activity activity="...">
       <property type="str" name="type">org.laptop.Connect</property>
       <buddy jid="bob@jabber.laptop.org">
         <property type="str" name="color">#005FE4,#00A0FF</property>
         ...
         </property>
       </buddy>
       ...
     </activity>
   </query>
 </iq>

Change announcement

Example: server notifies client about change in activity properties:

 <message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
   <change xmlns="...">
     <properties xmlns="..." activity="abcde123">
       <property type="str" name="tags">news, france</property>
     </properties>
   </change>
 </message>

Join announcement

Example: XO tells the component that it has joined an activity.

 <message type="notice" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
   <activity xmlns="...">
      <joined />
   </activity>
 </iq>

Component tells XO that somebody has joined an activity.

 <message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
   <activity xmlns="..." activity="abcde123"">
     <joined jid="bob@jabber.laptop.org" />
   </activity>
 </message>

Departure announcement

Announce that someone has departed an actvitiy.

 <message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
   <activity xmlns="..." activity="abcde123"">
     <left jid="bob@jabber.laptop.org" />
   </activity>
 </message>

Closed

Announce that all participants have departed an activity.

 <message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
   <activity xmlns="..." activity="abcde123"">
     <closed/>
   </activity>
 </message>

Buddy Protocol

Namespace: http://laptop.org/xmpp/buddy

Query

Fetch information about buddies. Similar to activity querying.

By JID:

 <iq type="get" from="joe@jabber.laptop.org" to="index.jabber.laptop.org">
   <buddy jid="bob@jabber.laptop.org" />
 </iq>

Changed

 <message type="notice" from="index.jabber.laptop.org" to="joe@jabber.laptop.org">
   <change xmlns="..." jid="bob@jabber.laptop.org">
     <properties>
       <property type="str" name="color">#005FE4,#00A0FF</property>
     </properties>
   </change>
 </message>