publish subscribe - Autojoin option of xmpp bookmark does not work -


i trying auto-join rooms using xep-0048 - bookmarks (http://xmpp.org/extensions/xep-0048.html).

i using robbiehanson xmppframework, ejabberd v13.x far, have been able add bookmark room using following code :

-(void) createbookmarkforroom:(nsstring *)roomjid {     nsxmlelement *nick = [nsxmlelement elementwithname:@"nick" stringvalue:@"marge"];      nsxmlelement *conference = [ddxmlnode elementwithname:@"conference"];     [conference addattributewithname:@"name" stringvalue:@"bookmarkname"];     [conference addattributewithname:@"autojoin" stringvalue:@"true"];     [conference addattributewithname:@"jid" stringvalue:roomjid];      [conference addchild:nick];      nsxmlelement *storage =[ddxmlnode elementwithname:@"storage"];     [storage addattributewithname:@"xmlns" stringvalue:@"storage:bookmarks"];      [storage addchild:conference];      nsdictionary *options = [nsdictionary dictionarywithobjects:@[@"pubsub#persist_items",@"pubsub#access_model"]                                                     forkeys:@[@"true",@"whitelist"]];      [self.publishsubscribemodule publishtonode:@"storage:bookmarks"                                      entry:(nsxmlelement *)storage                                 withitemid:(nsstring *)@"current"                                    options:(nsdictionary *)options];  } 

the following xml sent :

<iq type="set" id="2749368b-e365-45d6-a4b0-2f79dc6f4747">    <pubsub xmlns="http://jabber.org/protocol/pubsub">       <publish node="storage:bookmarks">          <item id="current">             <storage xmlns="storage:bookmarks">                <conference name="bookmarkname" autojoin="true" jid="testroom@conference.mydomain.com">                   <nick>marge</nick>                </conference>             </storage>          </item>       </publish>       <publish-options>          <x xmlns="jabber:x:data" type="submit">             <field var="form_type" type="hidden">                <value>http://jabber.org/protocol/pubsub#publish-options</value>             </field>             <field var="true">                <value>pubsub#persist_items</value>             </field>             <field var="whitelist">                <value>pubsub#access_model</value>             </field>          </x>       </publish-options>    </pubsub> </iq> 

and receive :

<iq xmlns="jabber:client" from="marge@mydomain.com" to="marge@mydomain.com/41045582821403862604272126" id="2749368b-e365-45d6-a4b0-2f79dc6f4747" type="result">    <pubsub xmlns="http://jabber.org/protocol/pubsub">       <publish node="storage:bookmarks">          <item id="current" />       </publish>    </pubsub> </iq> 

when try fetch bookmarks using following code :

-(void)requestbookmarks {     ddxmlelement *pubsub = [ddxmlelement elementwithname:@"pubsub" xmlns:@"http://jabber.org/protocol/pubsub"];      ddxmlelement *items = [ddxmlelement elementwithname:@"items"];     [items addattributewithname:@"node" stringvalue:@"storage:bookmarks"];      [pubsub addchild:items];      xmppiq *iqbookmark = [xmppiq iqwithtype:@"get" elementid:@"retrievebookmark10" child:pubsub];     [self.stream sendelement:iqbookmark]; } 

it sends following xml :

<iq type="get" id="retrievebookmark10">     <pubsub xmlns="http://jabber.org/protocol/pubsub">         <items node="storage:bookmarks"/>     </pubsub> </iq> 

and receive :

<iq xmlns="jabber:client" from="marge@mydomain.com" to="marge@mydomain.com/41045582821403862604272126" id="retrievebookmark10" type="result">     <pubsub xmlns="http://jabber.org/protocol/pubsub">         <items node="storage:bookmarks">             <item id="current">                 <storage xmlns="storage:bookmarks">                     <conference name="bookmarkname" autojoin="true" jid="testroom@conference.mydomain.com">                         <nick>marge</nick>                     </conference>                 </storage>             </item>         </items>     </pubsub> </iq> 

so seems can store bookmarks , retrieve them. but, when try talk in room testroom@conference.mydomain.com without manually joining error saying have join room before can talk in room. if join room (manually), every things works fine.

on server-side, used mod_pubsub module following options :

  mod_pubsub:    access_createnode: pubsub_createnode     ## reduces resource comsumption, xep incompliant    ignore_pep_from_offline: true     ## xep compliant, increases resource comsumption     ## ignore_pep_from_offline: false    last_item_cache: false    plugins:      - "flat"      - "hometree"      - "pep" # pep requires mod_caps 

i wondering why have manually join bookmarked "auto-join = true" rooms. clue ?

autojoining bookmarked rooms entirely client-side feature - client supposed retrieve bookmarks @ startup, , explicitly join rooms marked "auto-join".


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -