Have been using the mod_xmlrpc for a while but the situation required that some more functionality was required in order to meet our growing needs.
Have added the following two commands to the mod_xmlrpc:
- delete_account struct[{user, String}, {host, String}, {password, String}] Integer
- delete_rosteritem struct[{localuser, String}, {localserver, String}, {user, String}, {server, String}] String
I am wondering if they will be of any use to anyone regarding the module.
On another node, i am trying to add the following functionality to the module but have so far came up with nothing:
1. Creating a new MUC group on the server.
2. Destroying an MUC group on the server.
3. Adding a JID to the whitelist of an MUC.
4. Removing a JID from the whitelist of an MUC.
Would anyone know how to implement these regarding the mod_xmlrpc??
If someone can point me in the right direction i would be grateful. Below is how i tried to destroy the MUC but it did not seem to take because from what i gather the muc room is in the table muc_online_room however i might be reading it wrong.
Any advice appreciated.
%% delete_muc_room struct[{room, String}, {server, String}] String
handler(_State, {call, delete_muc_room, [{struct, AttrL}]}) ->
[Room, Server] = get_attrs([room, server], AttrL),
R = case mod_muc:forget_room(Server, Room) of
{atomic, ok} ->
0;
{error, Reason} ->
io:format("Can't delete muc room ~p on ~p for ~p~n", [Room, Server, Reason]);
{badrpc, Reason} ->
io:format("Can't delete muc room ~p on ~p for ~p~n", [Room, Server, Reason])
end,
{false, {response, [R]}};
darren.ferguson wrote: I am
I am wondering if they will be of any use to anyone regarding the module.
If you publish the code, I will include in SVN.
On another node, i am trying to add the following functionality to the module but have so far came up with nothing:
1. Creating a new MUC group on the server.
2. Destroying an MUC group on the server.
I recently implemented a similar thing in mod_muc_admin. In my case the purpose was to define rooms to create or destroy in a text file and to be called with a shell command. You can use the code as example.
The functions are:
1. muc_create_file(Filename)
2. muc_destroy_file(Filename)
I don't remember if it's required to restart mod_muc in some case for the changes to take effect.
3. Adding a JID to the whitelist of an MUC.
4. Removing a JID from the whitelist of an MUC.
In mod_muc_room.erl I see get_config and change_config, but I don't remember using this, so I don't have example code to show you. And it would take too much time to explain how to use them.
Badlop, thank you
Thank you for the answers that is very helpful, if you wish i can send you the diff files for the code i have created for the mod_xmlrpc if you wish in order that it can be put into the svn for the module. If not, please let me know how you wish me to publish and i will do that.
For the other pieces thank you for the information i will check those out and determine how to implement into the mod_xmlrpc portions.
For the change_config and get_config i will check through these functions and determine how they work and how too get what is needed for the white list.
Thanks again for the information, will await your reply for the module information regarding the mod_xmlrpc changes.
mod_xmlrpc additions
Badlop, thanks again for pointing me in the right direction, i have the add group and remove group working in the server per virtual host.
If you can let me know how you wish the code changes i can make that, currently i put them as an svn diff patch based off r554 of the current ejabberd modules.
Will now look into the other piece of having users added to the whitelist etc.
You can upload the file or
You can upload the file or files anywhere you want, and tell here the link. Or you can put the content in a comment.
Mod_xmlrpc svn patch and full file
Badlop per our discussion the svn diff file can be found for the mod_xmlrpc here
The full mod_xmlrcp file i was working on can be found here.
I changed the way the group chat muc was added so that we do not need to restart the mod_muc in order for the new room to be displayed.
I am working on some more commands that can be utilized over xmlrpc and will post the diffs and files once i have them working correctly.
Patch committed to mod_xmlrpc and mod_muc_admin SVN
Hi, thanks for the patch. I finally decided how to apply it.
I made some changes:
I noticed that the mod_xmlrpc.erl file is in DOS format, and has ugly character at the end of lines. I would like to fix that file, but I prefer to wait until you finish modidying it, so your patches apply cleanly.