nioc / xmpp-web

Lightweight web chat client for XMPP server
GNU Affero General Public License v3.0
143 stars 20 forks source link

Room listing lobby for logged in users same as guest #85

Closed singpolyma closed 6 months ago

singpolyma commented 1 year ago

Describe the solution you'd like

It would be nice if, just like guests, logged in users could be taken to a grid of rooms in a configured MUC service. There is now the "public rooms" but that is on their server, not my configured defaultMuc and it's in a compact table not the nice grid.

nioc commented 1 year ago

but that is on their server, not my configured defaultMuc

I'm not sure to understand your use case, you set a defaultMuc which is not on your server? And it works? 😆

singpolyma commented 1 year ago

This is related to my request #84 I'd like to get that lobby view that guest sees right now, I'd like it to list MUCs based on a setting instead of based on what server the user or anon happens to be on, and I'd like it to work for registered users and guests both.

Does that sufficiently summarize the pieces?

nioc commented 1 year ago

If you can send me a prosody.cfg.lua example file which run in the staging env, it could help me to understand better 😉

singpolyma commented 1 year ago

It would be the same no matter what server or server config. The whole point is it shouldn't matter how the server is configured.

nioc commented 1 year ago

Both guest and registered use the same this.$xmpp.getPublicMuc() function. This function request an iq disco#items to find the MUC services on the host:

With the following prosody.cfg.lua:

VirtualHost "localhost"
    name = "XMPP server"
    enabled = true
    -- notice that there is no disco_items as components are subdomains of virtual host

VirtualHost "anon.localhost"
    authentication = "anonymous"
    disco_items = {
        { "upload.localhost", "File upload" };
        { "anon-conference.localhost", "Multi users chat" };
}

Component "conference.localhost" "muc"
    modules_enabled = {
        "muc_mam";
        "vcard_muc";
    }
    name = "Private conferences server"
    restrict_room_creation = "local"
    max_history_messages = 50

Component "anon-conference.localhost" "muc"
    modules_enabled = {
        "muc_mam";
        "vcard_muc";
    }
    name = "Conferences server"
    restrict_room_creation = "local"
    max_history_messages = 50

We got the public rooms of the 2 MUC (conference.localhost and anon-conference.localhost) for registered users: image

And guests, only see the public rooms of the advertised MUC (anon-conference.localhost): image

So, YES, server-side configuration matters.

If your request is only UI related, please do not mention the configuration, and just say "It would be nice if, just like guests, logged in users could be taken to a grid of rooms. There is now the "public rooms" but it's in a compact table not the nice grid."

The guest grid was made after the registered table, they were not designed for the same type of use and integration (registered have the sidebar and navbar). I have to think how the grid could fit to the reduced space without losing room attributes information.