Week 7 & 8

Hello all,

It has been productive two weeks ! I have added some features to MIX in Swiften. These two weeks, I have added the following features:

1. Registering and setting Nick by a MIX client: This feature allows a MIX user to set and register a nick for a MIX channel by sending IQ stanzas of the following type:
<iq type='set'
    from='hag66@shakespeare.example/UUID-a1j/7533'
    to='coven@mix.shakespeare.example'
    id='7nve413p'>
  <setnick xmlns='urn:xmpp:mix:0'>
    <nick>thirdwitch</nick>
  </setnick>
</iq>
This example shows an IQ stanza from a MIX client to a MIX channel asking to set nick "thirdwitch". Similarly, if a MIX channel supports registering nick (mix_nick_register), then client sends a register nick payload to the channel.

2. Requesting VCard of  a channel participant: A MIX client can now request a VCard of a channel participant by sending  an IQ request to bare proxy JID of the channel participant as follows:
<iq from='hag66@shakespeare.example/UUID-c8y/1573'
    id='lx09df27'
    to='989898#coven@mix.shakespeare.example'
    type='get'>
  <vCard xmlns='vcard-temp'/>
</iq>

3. Sending/Retracting/Receiving Messages: A client sends a message directly to a MIX channel as a standard group chat message, in exactly the same way as for Multi-User Chat. Messages are sent directly to the MIX channel from the user's client as follows:
<message from='hag66@shakespeare.example/UUID-a1j/7533'
         to='coven@mix.shakespeare.example'
         id='92vax143g'
         type='groupchat'>
  <body>Harpier cries: 'tis time, 'tis time.</body>
</message>
Similarly, a client can request to retract a message by sending a retract payload with  message id to the channel. 

4. I've also added a lookup of proxy JID to determine real JID of a channel participant in JID-Visible and JID-Maybe-Visible channels. This is done by sending a PubSub payload to MIX channel with proxy JID as follows:
<iq from='hag66@shakespeare.example/UUID-c8y/1573'
    id='kl2fax27'
    to='coven@mix.shakespeare.lit'
    type='get'>
     <pubsub xlns='http://jabber.org/protocol/pubsub'>
          <items node='urn:xmpp:mix:nodes:jidmap'>
              <item id='123456#coven@mix.shakespeare.example'/>
          </items>
     </pubsub>
</iq>
For JID Maybe Visible rooms the lookup is performed on the JID Maybe Visible Map (jidmap2) node. If a user prefers to not share real JID, the result of this lookup of proxy JID will be the (same) proxy JID.

5. I've added MIXInvite use case which allows a user to send an invite to other user for joining a channel. Initially, a request is sent to MIX channel for requesting a valid token to join the channel. If the channel supports joining by invitation, this token is sent to invitee by inviter. The inviter also received an invitation-ack when invitee has made a decision (Joined/Declined). Following example shows invitee joining a MIX channel by invitation:
<iq type='set'
    from='cat@shakespeare.example'
    to='coven@mix.shakespeare.example'
    id='E6E10350-76CF-40C6-B91B-1EA08C332FC7'>
  <join xmlns='urn:xmpp:mix:0'>
    <subscribe node='urn:xmpp:mix:nodes:messages'/>
    <invitation>
        <inviter>hag66@shakespeare.lit</inviter>
        <invitee>cat@shakespeare.lit</invitee>
        <channel>coven@mix.shakespeare.lit</channel>
        <token>ABCDEF</token>
   </invitation>
  </join>
</iq>
All the above are pull requests now, and will be updated based on feedback by the mentors. 

This week, I'll add presence use case in MIX client which allows the client to share its presence with the local server. Also, I'll add administrative use cases like creating a channel, destroying a channel, etc. I have some queries regarding these features, which I hope to get clarified soon. 

Thats all for now ! Thanks!






Comments

Popular posts from this blog

Week 5 & 6

Week 4