Hi, I thought I would put together a simple "cookbook" on how to add GEOLOC 
XEP-0080 support to a client. Hopefully it will help someone else out. If 
anyone sees any problems with the steps below, please let me know. BTW, I am 
not sure why Step 1 is needed since Step 2 advertises the same capabilities.
 
STEPS TO ADD GEOLOC SUPPORT:
1) Client should respond to iq query http://jabber.org/protocol/disco#info with 
a stanza like: <iq type='result'...><<query 
xmlns='http://jabber.org/protocol/disco#info'><feature 
var='http://jabber.org/geoloc'/><feature var='http://jabber.org/geoloc+notify'/>
 
2) Client should add <c> stanza to presence stanza with the proper "ver" 
attribute indicating geoloc support. The "ver" attribute is a SHA-1 hash of a 
string like:"client/pc//fooclient 
1.0<http://jabber.org/protcol/geoloc<http://jabber.org/protcol/geoloc+notify<"
 
The stanza looks something like:
<presence from='[EMAIL PROTECTED]/orchard'>  <c 
xmlns='http://jabber.org/protocol/caps'      hash='sha-1'     
node='http://www.chatopus.com'     
ver='zHyEOgxTrkpSdGcQKH8EFPLsriY='/></presence>
 
3) When location changes the client publishes its new location:
<iq type='set' from='[EMAIL PROTECTED]/pda' id='publish1'>  <pubsub 
xmlns='http://jabber.org/protocol/pubsub'>    <publish 
node='http://jabber.org/protocol/geoloc'>      <item>        <geoloc 
xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>          
<country>Italy</country>          <lat>45.44</lat>          
<locality>Venice</locality>          <lon>12.33</lon>        </geoloc>      
</item>    </publish>  </pubsub></iq>
4) Subscribers will receive:<message from='[EMAIL PROTECTED]'          
to='[EMAIL PROTECTED]'>  <event 
xmlns='http://jabber.org/protocol/pubsub#event'>    <items 
node='http://jabber.org/protocol/geoloc'>      <item 
id='d81a52b8-0f9c-11dc-9bc8-001143d5d5db'>        <geoloc 
xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>          
<country>Italy</country>          <lat>45.44</lat>          
<locality>Venice</locality>          <lon>12.33</lon>        </geoloc>      
</item>    </items>  </event></message>
 
_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/
_______________________________________________
JDev mailing list
FAQ: http://www.jabber.org/discussion-lists/jdev-faq
Forum: http://www.jabberforum.org/forumdisplay.php?f=20
Info: http://mail.jabber.org/mailman/listinfo/jdev
Unsubscribe: [EMAIL PROTECTED]
_______________________________________________

Reply via email to