# XEP-proto-olpc1.0: OLPC-specific properties, version 1.0
Properties for the Activity and Buddy abstractions used in the One Laptop per Child's Sugar environment.
Author: Simon McVittie
Date: 2007-10-01

Abstract: | Properties for the Activity and Buddy abstractions used in the One Laptop per Child's Sugar environment.
Author: | Simon McVittie
Copyright: | © 1999 - 2009 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status: | ProtoXEP
Type: | Extension
Version: | 0.0.1
Last Updated: | 2007-10-01

WARNING: This document has not yet been accepted for consideration or approved in any official manner by the XMPP Standards Foundation, and this document is not yet an XMPP Extension Protocol (XEP). If this document is accepted as a XEP by the XMPP Council, it will be published at <http://xmpp.org/extensions/> and announced on the <standards@xmpp.org> mailing list.

## Table of Contents

1. Introduction
2. Requirements
3. Use Cases
3.1. Buddy properties
3.1.1. Buddy properties in link-local XMPP
3.2. Current activity
3.2.1. Current activity in link-local XMPP
3.3. Public activity properties
3.3.1. Activity properties in link-local XMPP
3.4. Private activities
3.4.1. Private activities in link-local XMPP
3.5. Invitations
4. Business Rules
5. Security Considerations
6. IANA Considerations
7. XMPP Registrar Considerations
8. XML Schema

Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History

## 1. Introduction

This document describes the protocol used to transfer OLPC-specific buddy (contact) and activity (chat room) information.

## 2. Requirements

The OLPC Sugar environment has the abstractions of a Buddy (corresponding to a child and/or their laptop (XO), represented in XMPP by a JID and in link-local XMPP by a _presence._tcp record) and an Activity (corresponding to a shared activity, represented in XMPP by a MUC and in link-local XMPP by a llmuc chatroom). The API requires that various properties can be browsed for (without joining any activities or chatrooms).

## 3. Use Cases

### 3.1 Buddy properties

Buddy properties are published in PEP. As currently implemented, all XOs subscribe to the presence and buddy properties of all other XOs on the same server.

The buddy properties currently supported are ip4-address, key and color.

Example 1. Publishing buddy properties

        <iq type="set" id="345265478350"
          from='1111111111111111111111111111111111111111@jabber.laptop.org'>
          <pubsub xmlns="http://jabber.org/protocol/pubsub">
            <publish node="http://laptop.org/xmpp/buddy-properties">
              <item>
                <properties xmlns="http://laptop.org/xmpp/buddy-properties">
                  <property type="str" name="ip4-address">10.0.0.123</property>
                  <property type="bytes" name="key">Base64Base64...</property>
                  <property type="str" name="color">#005FE4,#00A0FF</property>
                </properties>
              </item>
            </publish>
          </pubsub>
        </iq>

Subscribers receive the change notification, as usual for PEP. (For all the other PEP nodes described in this document, the process is the same, and has been omitted from this document for conciseness.)

Example 2. Subscriber receives buddy properties notification

        <message
          from='1111111111111111111111111111111111111111@jabber.laptop.org'
          to='2222222222222222222222222222222222222222@jabber.laptop.org/Telepathy'>
          <event xmlns='http://jabber.org/protocol/pubsub#event'>
            <items node='http://laptop.org/xmpp/current-activity'>
              <item>
                <properties xmlns="http://laptop.org/xmpp/buddy-properties">
                  <property type="str" name="ip4-address">10.0.0.123</property>
                  <property type="bytes" name="key">Base64Base64...</property>
                  <property type="str" name="color">#005FE4,#00A0FF</property>
                </properties>
              </item>
            </items>
          </event>
        </message>

### 3.1.1 Buddy properties in link-local XMPP

In link-local XMPP, none of this happens. Instead, the ip4-address property is implicitly available, and the key and color properties are encoded in the _presence._tcp TXT record.

The 'color' property is mapped to the 'olpc-color' TXT record key:

            11111@xo-12-34-56._presence._tcp.local. IN TXT "olpc-color=#005FE4,#00A0FF"

The 'key' property is mapped to the 'olpc-key-part0', 'olpc-key-part1', ... properties, split as necessary to fit in the 255-byte limit for TXT records. Because mDNS TXT records are 8-bit-clean, the segments contain raw binary rather than the Base64 binary used in XMPP:

            11111@xo-12-34-56._presence._tcp.local. IN TXT "olpc-key-part0=binarybinary..."
            11111@xo-12-34-56._presence._tcp.local. IN TXT "olpc-key-part1=binarybinary..."
            11111@xo-12-34-56._presence._tcp.local. IN TXT "olpc-key-part2=binarybinary..."

(As currently implemented, the "raw binary" is in fact *also* Base64, so the data seen in XMPP is doubly Base64'd. However, this is not guaranteed to remain the case, so the protocols need to assume the underlying byte array for the key can contain anything.)

Implementors must be careful to ensure that there is no key in the TXT record for the key segment 1 greater than the last one they need (in this case, olpc-key-part3 must be removed if present).

### 3.2 Current activity

The Neighbourhood view on the OLPC groups XO icons by their current activity, so XOs must notify each other of current-activity changes.

As currently implemented, this is done for both public and private activities, which represents an information leak. (FIXME)

Note that the 'type' attribute is in fact the activity ID; the name is for historical reasons.

Example 3. Publishing current activity

        <iq type="set" id="364923889843"
          from='1111111111111111111111111111111111111111@jabber.laptop.org'>
          <pubsub xmlns="http://jabber.org/protocol/pubsub">
            <publish node="http://laptop.org/xmpp/current-activity">
              <item>
                <activity xmlns="http://laptop.org/xmpp/current-activity">
                  room="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org"
                  type="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"/>
              </item>
            </publish>
          </pubsub>
        </iq>

### 3.2.1 Current activity in link-local XMPP

In link-local XMPP, the current activity is mapped to a pair of keys in the TXT record: olpc-current-activity (the activity ID) and olpc-current-activity-room (the Salut rMulticast chat room name).

            11111@xo-12-34-56._presence._tcp.local. IN TXT "olpc-current-activity=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
            11111@xo-12-34-56._presence._tcp.local. IN TXT "olpc-current-activity-room=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

### 3.3 Public activity properties

For activities to be handled by the Sugar environment, certain properties are needed. Because there is no server-side storage corresponding to a chat room and accessible by all participants, participants each publish the properties of all their activities.

To keep participants' idea of the activity properties in sync, when the properties change, the participant making the change MUST send a broadcast message to the chatroom, notifying other participants of the new properties.

This <message/> MUST be sent before updating the PEP node with the activity properties.

Example 4. Notifying the chatroom of a properties change

        <message type="groupchat"
          from='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org/1111111111111111111111111111111111111111'>
          to='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org'>
          <properties xmlns="http://laptop.org/xmpp/activity-properties"
            activity="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
            room="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org">
            <property type="str" name="type">org.laptop.Connect</property>
            <property type="str" name="name">Connect Activity</property>
            <property type="str" name="tags"></property>
            <property type="str" name="color">#005FE4,#00A0FF</property>
            <property type="bool" name="private">0</property>
          </properties>
        </message>

For public activities, the participants all announce all their activities and their properties in a PEP node.

When an activity becomes private, the participants all delete it from their activity-properties PEP nodes.

Example 5. Publishing activity properties

        <iq type="set" id="275828931562"
          from='1111111111111111111111111111111111111111@jabber.laptop.org'>
          <pubsub xmlns="http://jabber.org/protocol/pubsub">
            <publish node="http://laptop.org/xmpp/activity-properties">
              <item>
                <activities xmlns="http://laptop.org/xmpp/activity-properties">
                  <properties
                    xmlns="http://laptop.org/xmpp/activity-properties"
                    activity="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                    room="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org">
                    <property type="str" name="type">org.laptop.Connect</property>
                    <property type="str" name="name">Connect Activity</property>
                    <property type="str" name="tags"></property>
                    <property type="str" name="color">#005FE4,#00A0FF</property>
                    <property type="bool" name="private">0</property>
                  </properties>
                  <properties
                    xmlns="http://laptop.org/xmpp/activity-properties"
                    activity="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
                    room="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@conference.jabber.laptop.org">
                    <property type="str" name="type">org.laptop.HelloMesh</property>
                    <property type="str" name="name">Example Activity</property>
                    <property type="str" name="tags"></property>
                    <property type="str" name="color">#005FE4,#00A0FF</property>
                    <property type="bool" name="private">0</property>
                  </properties>
                </activities>
              </item>
            </publish>
          </pubsub>
        </iq>

The participants all announce all their list of activities in yet another PEP node, for backwards compatibility. This mechanism will be removed in a future version of this protocol.

Note that again, the 'type' attribute is in fact the activity ID; the name is for historical reasons.

Example 6. Publishing public activity list

        <iq type="set" id="116108118099">
          <pubsub xmlns="http://jabber.org/protocol/pubsub">
            <publish node="http://laptop.org/xmpp/activities">
              <item>
                <activities xmlns="http://laptop.org/xmpp/activities">
                  <activity
                    room="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org"
                    type="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"/>
                  <activity
                    room="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@conference.jabber.laptop.org"
                    type="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"/>
                </activities>
              </item>
            </publish>
          </pubsub>
        </iq>

### 3.3.1 Activity properties in link-local XMPP

In link-local XMPP, the activity properties are mapped to the _olpc-activity1._udp record. Each participant in each public activity publishes an mDNS service named chatroomname:publishedname@hostname, like so:

            ; Advertised by 11111...
            aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:11111@xo-12-34-56._olpc-activity1._udp.local. IN SRV 0 xo-12-34-56.local.
            _olpc-activity1._udp.local. IN PTR aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:11111@xo-12-34-56._olpc-activity1._udp.local.
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "txtvers=0"
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "room=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "activity-id=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "name=Connect Activity"
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "color=#005FE4,#00A0FF"
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "type=org.laptop.ConnectActivity"
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "tags="
            bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb:11111@xo-12-34-56._olpc-activity1._udp.local. IN SRV 0 xo-12-34-56.local.
            _olpc-activity1._udp.local. IN PTR bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb:11111@xo-12-34-56._olpc-activity1._udp.local.
           bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "txtvers=0"
           bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "room=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
           bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "activity-id=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
           bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "name=Example Activity"
           bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "color=#005FE4,#00A0FF"
           bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "type=org.laptop.HelloMesh"
           bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb:11111@xo-12-34-56._olpc-activity1._udp.local IN TXT "tags="

           ; Advertised by 22222... - suppose here that 22222... is in the activity
           ; aaaaa... but not in bbbbb...
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:22222@xo-22-22-22._olpc-activity1._udp.local. IN SRV 0 xo-22-22-22.local.
           _olpc_activity._udp.local. IN PTR aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:22222@xo-22-22-22._olpc-activity1._udp.local.
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:22222@xo-22-22-22._olpc-activity1._udp.local IN TXT "txtvers=0"
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:22222@xo-22-22-22._olpc-activity1._udp.local IN TXT "room=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:22222@xo-22-22-22._olpc-activity1._udp.local IN TXT "activity-id=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:22222@xo-22-22-22._olpc-activity1._udp.local IN TXT "name=Connect Activity"
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:22222@xo-22-22-22._olpc-activity1._udp.local IN TXT "color=#005FE4,#00A0FF"
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:22222@xo-22-22-22._olpc-activity1._udp.local IN TXT "type=org.laptop.ConnectActivity"
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:22222@xo-22-22-22._olpc-activity1._udp.local IN TXT "tags="

The <message/> sent to the chat room with the updated properties is much the same as for XMPP:

Example 7. Notifying the chatroom of a properties change (link-local)

          <!-- Sent via chatroom aaaaa... using rMulticast -->
          <message type="groupchat"
            from='11111@xo-12-34-56'
            to='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'>
            <properties xmlns="http://laptop.org/xmpp/activity-properties"
              activity="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
              room="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">
              <property type="str" name="type">org.laptop.Connect</property>
              <property type="str" name="name">Connect Activity</property>
              <property type="str" name="tags"></property>
              <property type="str" name="color">#005FE4,#00A0FF</property>
              <property type="bool" name="private">0</property>
            </properties>
          </message>

### 3.4 Private activities

When an activity becomes private, the participants all delete it from their activity-properties and activities PEP nodes. In this example, the XO whose JID starts with 11111 makes the activity whose ID starts with aaaaa private, and removes it from their PEP nodes; the XO whose JID starts with 22222 responds by removing it from their PEP nodes too.

To a third XO observing the PEP nodes, this is indistinguishable from both XOs leaving the activity simultaneously, which is what we want.

Example 8. Making an activity private

        <message type="groupchat"
          from='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org/1111111111111111111111111111111111111111'>
          to='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org'>
          <properties xmlns="http://laptop.org/xmpp/activity-properties"
            activity="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
            room="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org">
            <property type="str" name="type">org.laptop.Connect</property>
            <property type="str" name="name">Connect Activity</property>
            <property type="str" name="tags"></property>
            <property type="str" name="color">#005FE4,#00A0FF</property>
            <property type="bool" name="private">1</property>
          </properties>
        </message>

        <iq type="set" id="275828931562"
          from='1111111111111111111111111111111111111111@jabber.laptop.org'>
          <pubsub xmlns="http://jabber.org/protocol/pubsub">
            <publish node="http://laptop.org/xmpp/activity-properties">
              <item>
                <activities xmlns="http://laptop.org/xmpp/activity-properties">
                  <properties
                    xmlns="http://laptop.org/xmpp/activity-properties"
                    activity="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
                    room="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@conference.jabber.laptop.org">
                    <property type="str" name="type">org.laptop.HelloMesh</property>
                    <property type="str" name="name">Example Activity</property>
                    <property type="str" name="tags"></property>
                    <property type="str" name="color">#005FE4,#00A0FF</property>
                    <property type="bool" name="private">0</property>
                  </properties>
                </activities>
              </item>
            </publish>
          </pubsub>
        </iq>

        <iq type="set" id="116108118099">
          <pubsub xmlns="http://jabber.org/protocol/pubsub">
            <publish node="http://laptop.org/xmpp/activities">
              <item>
                <activities xmlns="http://laptop.org/xmpp/activities">
                  <activity
                    room="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb@conference.jabber.laptop.org"
                    type="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"/>
                </activities>
              </item>
            </publish>
          </pubsub>
        </iq>

        <!-- 22222... receives the above <message/>, and responds by deleting
        activity aaaaa... from their PEP records. We assume here that 22222
        is not in any other public activity. -->

        <iq type="set" id="103874931562"
          from='2222222222222222222222222222222222222222@jabber.laptop.org'>
          <pubsub xmlns="http://jabber.org/protocol/pubsub">
            <publish node="http://laptop.org/xmpp/activity-properties">
              <item>
                <activities xmlns="http://laptop.org/xmpp/activity-properties">
                </activities>
              </item>
            </publish>
          </pubsub>
        </iq>

        <iq type="set" id="116108239899">
          <pubsub xmlns="http://jabber.org/protocol/pubsub">
            <publish node="http://laptop.org/xmpp/activities">
              <item>
                <activities xmlns="http://laptop.org/xmpp/activities">
                </activities>
              </item>
            </publish>
          </pubsub>
        </iq>

### 3.4.1 Private activities in link-local XMPP

Instead of deleting activities from their PEP records, link-local peers delete them from their mDNS records.

The <message/> sent to the chat room with the updated properties is, again, much the same as for XMPP.

### 3.5 Invitations

Before inviting a buddy to an activity, OLPC users are expected to send them the activity properties. These are sent in a <message/> stanza referred to as a "pseudo-invitation". If the activity is private, then this is the only opportunity the invitee has to get the activity properties.

Example 9. Inviting a buddy to an activity

        <!-- 11111 sends pseudo-invitation directly to 33333 -->
        <message
          from='1111111111111111111111111111111111111111@jabber.laptop.org/Telepathy'
          to='3333333333333333333333333333333333333333@jabber.laptop.org'>
          <properties xmlns='http://laptop.org/xmpp/activity-properties'
            activity='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
            room='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org'>
            <property type='str' name='type'>org.laptop.Connect</property>
            <property type='str' name='name'>Connect Activity</property>
            <property type='str' name='tags'/>
            <property type='str' name='color'>#0d1c38,#49bce4</property>
            <property type='bool' name='private'>1</property>
          </properties>
        </message>

        <!-- 11111 sends invitation to 33333 via MUC service -->
        <message
          to='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org'>
          <x xmlns="http://jabber.org/protocol/muc#user">
            <invite to="3333333333333333333333333333333333333333@jabber.laptop.org"/>
          </x>
        </message>

        <!-- MUC service relays invitation to 33333 -->
        <message type='normal'
          from='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org'
          to='3333333333333333333333333333333333333333@jabber.laptop.org'>
          <x xmlns='http://jabber.org/protocol/muc#user'>
            <invite from='1111111111111111111111111111111111111111@jabber.laptop.org/Telepathy'>
              <reason/>
            </invite>
          </x>
          <x xmlns='jabber:x:conference' jid='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org'/>
        </message>

If the activity properties change before the invitee joins the activity, the inviter must notify the invitee by re-sending the pseudo-invitation (only).

Example 10. Updating a buddy on activity properties

        <message
          from='1111111111111111111111111111111111111111@jabber.laptop.org/Telepathy'
          to='3333333333333333333333333333333333333333@jabber.laptop.org'>
          <properties xmlns='http://laptop.org/xmpp/activity-properties'
            activity='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
            room='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org'>
            <property type='str' name='type'>org.laptop.Connect</property>
            <property type='str' name='name'>this name changed</property>
            <property type='str' name='tags'/>
            <property type='str' name='color'>#0d1c38,#49bce4</property>
            <property type='bool' name='private'>1</property>
          </properties>
        </message>

If the inviter leaves the activity before the invitee joins, the invitee can no longer rely on being notified about any changes; if the activity was private, the invitee can't even rely on being able to see whether it exists. Accordingly, the inviter should cancel their invitation; if all invitations to a private activity have been cancelled, the invitee should assume that the activity has disappeared.

Example 11. Cancelling an invitation

        <message
          from='1111111111111111111111111111111111111111@jabber.laptop.org/Telepathy'
          to='3333333333333333333333333333333333333333@jabber.laptop.org'>
          <uninvite xmlns='http://laptop.org/xmpp/activity-properties'
            id='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
            room='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@conference.jabber.laptop.org'/>
        </message>

### 3..1 Invitations in link-local XMPP

There isn't the concept of sending an invitation via the MUC service in link-local XMPP, so the process can be made somewhat simpler.

Example 12. Inviting a buddy to an activity (link-local)

          <!-- Sent over unicast TCP connection between xo-12-34-56.local.
          and xo-33-33-33.local. -->
          <message from='11111@xo-12-34-56' to='33333@xo-33-33-33'>
            <x xmlns='http://collabora.co.uk/protocol/llmuc'>
              <invite protocol='rmulticast'>
                <roomname>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</roomname>
                <address>224.0.0.1</address>
                <port>23453</port>
                <properties xmlns='http://laptop.org/xmpp/activity-properties'
                  activity='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
                  room='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'>
                  <property type='str' name='type'>org.laptop.Connect</property>
                  <property type='str' name='name'>Connect Activity</property>
                  <property type='str' name='tags'/>
                  <property type='str' name='color'>#0d1c38,#49bce4</property>
                  <property type='bool' name='private'>1</property>
                </properties>
              </invite>
            </x>
          </message>

Example 13. Updating a buddy on activity properties (link-local)

          <!-- Sent over unicast TCP connection between xo-12-34-56.local.
          and xo-33-33-33.local. We just re-send the invitation. -->

          <message from='11111@xo-12-34-56' to='33333@xo-33-33-33'>
            <x xmlns='http://collabora.co.uk/protocol/llmuc'>
              <invite protocol='rmulticast'>
                <roomname>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</roomname>
                <address>224.0.0.1</address>
                <port>23453</port>
                <properties xmlns='http://laptop.org/xmpp/activity-properties'
                  activity='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
                  room='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'>
                  <property type='str' name='type'>org.laptop.Connect</property>
                  <property type='str' name='name'>The name changed</property>
                  <property type='str' name='tags'/>
                  <property type='str' name='color'>#0d1c38,#49bce4</property>
                  <property type='bool' name='private'>1</property>
                </properties>
              </invite>
            </x>
          </message>

Example 14. Cancelling an invitation (link-local)

          <!-- Sent over unicast TCP connection between xo-12-34-56.local.
          and xo-33-33-33.local. -->
          <message from='11111@xo-12-34-56' to='33333@xo-33-33-33'>
            <uninvite xmlns='http://laptop.org/xmpp/activity-properties'
              id='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
              room='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'/>
          </message>

## 4. Business Rules

Properties have the same syntax and semantics as the "parameters" in XEP-proto-tubes.

## 5. Security Considerations

Putting the current activity in a PEP node, even if it's private, leaks the room name.

## 6. IANA Considerations

None.

## 7. XMPP Registrar Considerations

None.

## 8. XML Schema

        <!-- Buddy properties -->
        <xs:schema
          xmlns:xs='http://www.w3.org/2001/XMLSchema'
          targetNamespace='http://laptop.org/xmpp/buddy-properties'
          xmlns='http://laptop.org/xmpp/buddy-properties'
          elementFormDefault='qualified'>

          <!-- Published in the PEP node of the same namespace -->
          <xs:element name='properties'>
            <xs:complexType>
              <xs:sequence>
                <xs:element name='property' minOccurs='0' maxOccurs='unbounded'
                  type='name-value-pair'/>
              </xs:sequence>
            </xs:complexType>
          </xs:element>

          <!-- A name-value pair (the same format as Tubes parameters, as it
          happens) -->
          <xs:complexType name='name-value-pair'>
            <xs:simpleContent>
              <xs:extension base='xs:string'>
                <xs:attribute name='name' type='xs:string'/>
                <xs:attribute name='type'>
                  <xs:simpleType>
                    <xs:restriction base='xs:NCName'>
                      <xs:enumeration value='bool'/>
                      <xs:enumeration value='str'/>
                      <xs:enumeration value='bytes'/>
                      <xs:enumeration value='int'/>
                      <xs:enumeration value='uint'/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:attribute>
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:schema>

        <!-- Activity properties -->
        <xs:schema
          xmlns:xs='http://www.w3.org/2001/XMLSchema'
          targetNamespace='http://laptop.org/xmpp/activity-properties'
          xmlns='http://laptop.org/xmpp/activity-properties'
          elementFormDefault='qualified'>

          <!-- Sent in pseudo-invitations, published in the PEP node
          of the same namespace, and sent in chatrooms -->
          <xs:element name='properties'>
            <xs:complexType>
              <!-- XMPP MUC's (bare) JID -->
              <xs:attribute name='room' use='required' type='xs:string'/>
              <!-- OLPC Activity ID (a 40-character hex string, as of Trial-3) -->
              <xs:attribute name='activity' use='required' type='xs:string'/>

              <xs:element name='property' minOccurs='0' maxOccurs='unbounded'
                type='name-value-pair'/>
            </xs:complexType>
          </xs:element>

          <!-- Sent to cancel invitations -->
          <xs:element name='uninvite'>
            <xs:complexType>
              <xs:attribute name='room' use='required' type='xs:string'/>
              <xs:attribute name='id' use='required' type='xs:string'/>
            </xs:complexType>
          </xs:element>

          <!-- A name-value pair (the same format as Tubes parameters, as it
          happens) -->
          <xs:complexType name='name-value-pair'>
            <xs:simpleContent>
              <xs:extension base='xs:string'>
                <xs:attribute name='name' type='xs:string'/>
                <xs:attribute name='type'>
                  <xs:simpleType>
                    <xs:restriction base='xs:NCName'>
                      <xs:enumeration value='bool'/>
                      <xs:enumeration value='str'/>
                      <xs:enumeration value='bytes'/>
                      <xs:enumeration value='int'/>
                      <xs:enumeration value='uint'/>
                    </xs:restriction>
                  </xs:simpleType>
                </xs:attribute>
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>

          <xs:simpleType name='empty'>
            <xs:restriction base='xs:string'>
              <xs:enumeration value=''/>
            </xs:restriction>
          </xs:simpleType>
        </xs:schema>

        <!-- Buddy's Activities list -->
        <xs:schema
          xmlns:xs='http://www.w3.org/2001/XMLSchema'
          targetNamespace='http://laptop.org/xmpp/activities'
          xmlns='http://laptop.org/xmpp/activities'
          elementFormDefault='qualified'>

          <!-- Published in the PEP node of the same namespace -->
          <xs:element name='activities'>
            <xs:complexType>
              <xs:sequence>
                <xs:element name='activity'>
                  <xs:complexType>
                    <!-- Despite its name, this attribute is actually the
                    OLPC activity ID! Historical reasons... -->
                    <xs:attribute name='type' type='xs:string'/>
                    <!-- XMPP MUC (bare) JID -->
                    <xs:attribute name='room' type='xs:string'/>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>

          <xs:simpleType name='empty'>
            <xs:restriction base='xs:string'>
              <xs:enumeration value=''/>
            </xs:restriction>
          </xs:simpleType>
        </xs:schema>

        <!-- Buddy's current activity -->
        <xs:schema
          xmlns:xs='http://www.w3.org/2001/XMLSchema'
          targetNamespace='http://laptop.org/xmpp/current-activity'
          xmlns='http://laptop.org/xmpp/current-activity'
          elementFormDefault='qualified'>

          <!-- Published in the PEP node of the same namespace -->
          <xs:element name='activity'>
            <xs:complexType>
              <!-- Despite its name, this attribute is actually the
              OLPC activity ID! Historical reasons...
              Empty if no current activity. -->
              <xs:attribute name='type' type='xs:string'/>
              <!-- XMPP MUC (bare) JID, or empty if no current activity -->
              <xs:attribute name='room' type='xs:string'/>
            </xs:complexType>
          </xs:element>

          <xs:simpleType name='empty'>
            <xs:restriction base='xs:string'>
              <xs:enumeration value=''/>
            </xs:restriction>
          </xs:simpleType>
        </xs:schema>

## Appendices

### Appendix A: Document Information

Series: XEP
Number: proto-olpc1.0
Publisher: XMPP Standards Foundation
Status: ProtoXEP
Type: Extension
Version: 0.0.1
Last Updated: 2007-10-01
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0045, XEP-proto-clique
Supersedes: None
Superseded By: None
Short Name: NOT YET ASSIGNED

### Appendix B: Author Information

### Simon McVittie

Email: simon.mcvittie@collabora.co.uk
JabberID: simon.mcvittie@collabora.co.uk

### Appendix C: Legal Notices

#### Copyright

#### Permissions

#### Disclaimer of Warranty

#### Limitation of Liability

#### IPR Conformance

### Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

### Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.

Errata can be sent to <editor@xmpp.org>.

### Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".

### Appendix G: Notes

### Appendix H: Revision History

Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/

#### Version 0.0.1 (2007-10-01)

First draft.

(smcv)

END