[ejabberd] using mod_xmlrpc with python to add a roster item

Pablo Platt pablo.platt at yahoo.com
Wed Jan 7 17:52:32 MSK 2009


Hi,

I'm using mod_xmlrpc to register users and add roster items.
The python example on the module docs works:

import xmlrpclib

server_url = 'http://www.example.com:4560';
server = xmlrpclib.Server(server_url);

params = {}
params["user"] = "user1"
params["host"] = "example.com"
params["password"] = "user1"

result = server.create_account(params)
print result
but I can't add roster items. I tried this:

import xmlrpclib

server_url = 'http://www.example.com:4560';
server = xmlrpclib.Server(server_url);

params = {}
params["localuser"] = "user1"
params["localserver"] = "example.com"

params["user"] = "user2"
params["server"] = "example.com"
params["nick"] = "user2"
params["group"] = "friends"
params["subs"] = "something"

result = server.create_account(params)
print result

Do I need to create the group and subgroup before populating it or will ejabberd do that automatically?

Thanks



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20090107/86c97ae8/attachment.htm>


More information about the ejabberd mailing list