[JDEV] Can I get roster of certain group?

Ru-Shan Cheng minamy at pchome.com.tw
Mon Jul 21 21:28:27 CDT 2003


hi ,

	I had tried to get roster of certain group.
	
	The client send : 
		<iq id="get_group_roster" type="get">
  		  <query xmlns="jabber:iq:roster">
                                     <limit group='AAAA'/>
  		  </query>
		</iq>
	
	The server can accept this xml packet, and return all roster in user's spool file.
	
	So I tried to add some behavior in mod_roster_out_iq() in /jsm/modules/mod_roster.c.
	All I want to do in mod_roster_out_iq() is :
	
	  1. Get the group name in client's xml packet.
	  2. Get the temporary roster got from xdb : (xmlnode_t*) roster.  (line 253 in mod_roster.c)
	  3. Check each item's group name in roster.
  	       If item's group name is the same as client's request, we have to keep the item in roster.
	       Otherwise, we have to remove this item in roster .
	  4. Then roster will keep the contact list of certain group.
	  5. Do the same operation as line 255 in mod_roster.c.
	  
	But I had a question about the item deletion in xmlnode_t.
	I had look up the xmlnode.c, but I can't find how to remove a child node from parent.
	Can Anyony show me how to remove an xmlnode appropriately?
	
	Thanks a lot!!

-----Original Message-----
From: jdev-admin at jabber.org [mailto:jdev-admin at jabber.org]On Behalf Of Matthias Wimmer
Sent: Wednesday, July 16, 2003 3:25 PM
To: jdev at jabber.org
Subject: Re: [JDEV] Can I get roster of certain group?

Tot kijk Matthias schrieb pm 2003-07-16 03:25:

> > What kind of solutions will cost less efforts or form better architecture?

> Setting the type of an iq to "group_roster" is not allowed. Using your
> own namespaces for queries is, but you are not allowed to build your own
> namespaces that start with "jabber:". But your company (or you as a
> private person) for sure has a http address, that can be used to build
> namespaces. You could even use your email-adress with the "mailto:"
> prefix as a namespaces.

> Therefore the following queries would not break any rules:

> <iq type='get'>
>     <query xmlns='http://yourcompany.example.com/xmlns/limitedroster'>
>         <limit group='A'/>
>     </query>
> </iq>

> But you could even extend the normal query. This would make your client
> compatible with servers that don't implement your extension:

> <iq type='get'>
>     <query xmlns='jabber:iq:roster'>
>         <limit
> 	xmlns='http://yourcompany.example.com/xmlns/limitedroster'
> 	group='A'/>
>     </query>
> </iq>
ÿÿÝýRÿÿôÿþm§ÿÿyÙÿ¦¸ÿz–©z¿Ü¢oíÃ÷%‰Éÿ¦ÿißÜ¡×מ¹
&{ûÿ[ÿÿÿøÿÿüÿÿÿOÿÿ5ÿÿÿÿzm§ÿÿ²)¦)àþ—!¢gÿr‰ÿ·



More information about the JDev mailing list