Hi,
On 8 February 2015 at 10:58, <
karma.some...@gmail.com> wrote:
> Hi,
>
> We're currently testing Prosody because we're looking for an IM platform in
> order to establish it in our company, and we've made a compilation of
> questions about the console capabilities and Prosody in general:
>
> 1) Is it possible to list all users in a chatroom?
Hmm, from the console? There's not currently an easy way. We'll have to add it!
But for now, you could take this block of code:
function prosody.muc_users(room_jid)
local jid = require "util.jid";
room_jid = jid.prep(room_jid);
local room_name, room_host = jid.split(room_jid);
if not hosts[room_host] or not hosts[room_host].modules.muc then
return nil, "Not a MUC host: "..room_host;
end
if not hosts[room_host].modules.muc.rooms[room_jid] then
return nil, "No such room: "..room_jid;
end
local out = {"\n"};
for k, v in
pairs(hosts[room_host].modules.muc.rooms[room_jid]._occupants) do
out[#out+1] = v.jid.."\t"..select(3, jid.split(k));
end
return table.concat(out, "\n");
end
and put it in a module, or even in your config file. Then in the
telnet console run:
> prosody.muc_users("room@servername")
> 2) Assuming we want to allow free account registration, is it possible to
> forbid the registration of a certain account (the jupe equivalent on IRC)?
See
https://code.google.com/p/prosody-modules/wiki/mod_block_registrations
> 3) Is it possible to deny joining a channel with a certain name on a MUC?
You mean you want to prevent users using certain nicknames? I don't
think we currently have anything for this, but it could be done with a
plugin.
If you're coming from IRC and you are talking about bans... in XMPP
they are based on the user's JID, rather than nickname (or IP, but see
below...).
> 4) Is it possible to avoid users with a certain IP address to connect to the
> Prosody server (the G-Line equivalent on IRC)?
Generally XMPP is quite a different architecture to IRC and, since
there is the ability for users to join from remote servers we don't
know, we don't always have the user's IP to ban in this way.
Specifically XMPP makes a distinction between the place you log in to
the network (and authenticate) and the place where rooms are hosted.
However I think you're probably planning a closed system, so this
won't be a problem. If you want to stop IP addresses from accessing
the server (because of abuse), the best way is always to use your
system's firewall - that is it's primary purpose, and it is designed
to be very efficient at it's job.
For IP banning from particular rooms, you can load mod_muc_ban_ip:
https://code.google.com/p/prosody-modules/wiki/mod_muc_ban_ip
Still, if for some reason you really wanted to ban an IP address at
the Prosody level, this could again be done as a plugin.
Hope this helps! Let me know if you still have any questions.
Regards,
Matthew