On 2015-08-26 15:18, Kim Alvefur wrote:
> On 2015-08-25 08:40, Gauri Padbidri wrote:
>> The problem is when I query Prosody to give me a list of Chat rooms for
>> the given user, it will return me the PUBLIC Chat rooms but NOT the
>> PRIVATE Chat rooms I created...Is it because I have set
>> "muc#roomconfig_publicroom" to FALSE, which makes them hidden publicly ?
>> Also, what configuration can I do on Prosody Config to fetch Private
>> Rooms as well.
> This is the bit that generates the list of rooms:
> http://hg.prosody.im/0.10/file/8b4c8e957211/plugins/muc/mod_muc.lua#l129
> It only checks if the room is hidden, so it would need to become more
> complicated in order to also show private/hidden rooms to those who
> would be allowed to see it.  And who would be allowed to see it?
> Owners?  Any members?

Try the attached patch. :)

Kim "Zash" Alvefur

You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To post to this group, send email to prosody-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# User shelve@localhost
# Date 1440595846 -7200
#      Wed Aug 26 15:30:46 2015 +0200
# Node ID 5e9506d3cdc91f99e116fdbe73e61508d7c19ba5
# Parent  442019e955dc8e69371a81c53b888cc422a63ebd
Show hidden rooms to people with an affiliation

diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -128,9 +128,12 @@
 module:hook("host-disco-items", function(event)
 	local reply = event.reply;
+	local sender = event.stanza.attr.from;
 	module:log("debug", "host-disco-items called");
 	for jid, room in pairs(rooms) do
-		if not room:get_hidden() then
+		local affiliation = room:get_affiliation(sender);
+		if affiliation == "outcast" then affiliation = nil; end
+		if not (room:get_hidden() and affiliation == nil) then
 			reply:tag("item", {jid=jid, name=room:get_name()}):up();

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to