[jdev] GEOLOC Support
Stephen Pendleton
stephenpendleton at hotmail.com
Thu Oct 30 12:59:45 CDT 2008
Thanks for the reply.
> From: hildjj at gmail.com> To: jdev at jabber.org> Date: Thu, 11 Sep 2008 16:26:44 -0600> Subject: Re: [jdev] GEOLOC Support> > > On Sep 9, 2008, at 10:24 AM, Stephen Pendleton wrote:> > > 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.> > Step 1 is required, because when someone asks what your caps hash > means, you have to be able to answer. It's important that the results > from step 1 match the stuff that is hashed in step 2.
I misunderstood the purpose of the hash. I thought the client was expected to unhash it and use it to determine the capabilities. I didnt realize it was used to compare caps efficiently.
So based on your feedback the correct "cookbook" would be:
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+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+notify<"The stanza looks something like:<presence from='romeo at montague.lit/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='portia at merchantofvenice.lit/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) If a client receives a location update it will be in the form:
<message from='portia at merchantofvenice.lit' to='bassanio at merchantofvenice.lit'> <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> <accuracy>20</accuracy> </geoloc> </item> </items> </event></message>The client then should use the location information in this packet as it sees fit!
Thanks
_________________________________________________________________
Store, manage and share up to 5GB with Windows Live SkyDrive.
http://skydrive.live.com/welcome.aspx?provision=1?ocid=TXT_TAGLM_WL_skydrive_102008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.jabber.org/jdev/attachments/20081030/a3ef4194/attachment-0003.htm>
More information about the JDev
mailing list