Page 1 of 1

Pre-populate Buddy List

Posted: 21 Jan 2009, 13:15
by dieffe
Hello,
is it possible to pre populate the buddy list without to user to be online?
I mean i have a pre owned buddy list ( mysql based ) and i wish to import it into SmartFox actual Buddy list ( Buddylist 2.0 ) so that when the user comes online he/she will find his/her buddylist already filled with the record from the html version buddy list.

Is it doable?

Thanks

Posted: 22 Jan 2009, 15:46
by Lapo
Hi,
at the moment we don't have a generic import utility capable of doing this.

Posted: 22 Jan 2009, 16:21
by dieffe
after a lot of thinking i came up with something like this:

Code: Select all

   a=_server.getCurrentZone();
   var sql = "SELECT * FROM amici";
   var queryRes = dbase.executeQuery(sql);  
   n=0;
   for (var i = 0; i < queryRes.size(); i++)
   {
                var tempRow = queryRes.get(i)
                utente=tempRow.getItem("utente");
                buddy=tempRow.getItem("buddy");
                a.addBuddy(utente, buddy);
                n++;
    }
   trace("Buddy Importata per " + n + " utenti");
I run this inside a init() of an extension. I infact menaged to get the buddy list loaded but the first time i relog into the server all the buddy are empty.

Does this make any sense?

Posted: 22 Jan 2009, 20:12
by Lapo
Sure, you can parse your previous data and create a small script that does the translation

Posted: 22 Jan 2009, 20:18
by dieffe
Ok but this script is working only after the first time i load the extension from the admin interface, after the first reload the buddy lists are empty and stays this way till i reload the extension from the admin interface again.

Why?