jabber:iq:private
The jabber:iq:private namespace is traditionally
a way of storing user-defined data that should be kept private. Persistency across sessions
is achieved by storing the data in the user’s records on the server.
The data is, of course, formatted in XML.
Warning
Private data stored by a user is accessible only to that user. Remember, however, that the private data is stored on the server. Unencrypted. If you’re paranoid, encrypt it before storing it.
A typical use of the jabber:iq:private namespace is shown
in Example 6-1. The JIM client stores countless user preferences on a per-user
basis using this namespace. Once a user has connected and authenticated
with a Jabber server, those user preferences are retrieved and used by
the client to customize the settings.
SEND: <iq id="jabberim:prefs3860" type="get">
<query xmlns="jabber:iq:private">
<jabberIM xmlns="jabberim:prefs"/>
</query>
</iq>
RECV: <iq id='jabberim:prefs3860' type='result' from='dj@yak/Work'>
<query xmlns='jabber:iq:private'>
<jabberim xmlns='jabberim:prefs'
UseAutoAway='true'
AwayTime='5'
XATime='30'
AwayStatus='Away (auto)'
XAStatus='Ext. Away (auto)'
WizardShown='false'
... >
</jabberim>
</query>
</iq>
In this example, you can see that a private namespace is used to qualify
the particular chunk of stored data, jabberim:prefs.
Also of interest is the difference between the tags—<jabberIM/> in the retrieval request ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access