[jadmin] Adding buddies en masse
Felipe Vasconcellos
fbvasconcellos at gmail.com
Mon Nov 20 13:28:22 CST 2006
I add them using SQL commands and nothing wrong has happend (until now!! :)
got more than 16000 rows in table roster-items.
Acctually, I have written up a jadmin software that I'm going to publish in
the list.
It generates SQL commands to add users in mass, delete users, change users'
nicknames or names, move users from one group to another, and so on.
It's written in c++, but can be easily ported to php.
The logics is quite simple:
Supose you have user A, B and C. (think A,B and C as username at domain)
To add them to everybody's contact list, add this lines to roster-items
INSERT INTO `roster-items`
(`collection-owner`,`jid`,`name`,`to`,`from`,`ask`) VALUES ("A","B","B
name","1","1","0");
(`collection-owner`,`jid`,`name`,`to`,`from`,`ask`) VALUES ("B","A","A
name","1","1","0");
this two ones above do the proccess of A adding B and B -> A.
now, add {A,C} {C,A}
(`collection-owner`,`jid`,`name`,`to`,`from`,`ask`) VALUES ("A","C","C
name","1","1","0");
(`collection-owner`,`jid`,`name`,`to`,`from`,`ask`) VALUES ("C","A","A
name","1","1","0");
finally, add {B,C} {C,B}
(`collection-owner`,`jid`,`name`,`to`,`from`,`ask`) VALUES ("B","C","C
name","1","1","0");
(`collection-owner`,`jid`,`name`,`to`,`from`,`ask`) VALUES ("C","B","B
name","1","1","0");
I promise I will publish the software soon.
On 11/7/06, Praveen K <praveen_k_81 at yahoo.com> wrote:
>
> Hi all,
> I have an IM application which supports jabber protocol. To test my
> application, I installed my own jabber server (jabberd2) and created 1000
> users using mysql script. Now I want to add 100s of friends to each of those
> 1000 users. Is there a way to do it using mysql scripts. I see that the
> mysql table `roster-items' and `roster-groups', which hold this information,
> have a field `object-sequence' which could screw up if I were to add buddies
> scriptologically.
> Thanks in advance.
> Praveen
>
>
> ----
> I'll be more enthusiastic about encouraging thinking outside the box when
> there's evidence of any thinking going on inside it.
> - Terry Pratchett
>
>
>
>
> _______________________________________________
> JAdmin mailing list
> JAdmin at jabber.org
> http://mail.jabber.org/mailman/listinfo/jadmin
> FAQ: http://www.jabber.org/about/jadminfaq.shtml
> _______________________________________________
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.jabber.org/pipermail/jadmin/attachments/20061120/10653534/attachment-0004.html
More information about the JAdmin
mailing list