Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wishlist] Differentiate between public and private channels #488

Open
kot0dama opened this issue Nov 2, 2022 · 9 comments
Open

[wishlist] Differentiate between public and private channels #488

kot0dama opened this issue Nov 2, 2022 · 9 comments

Comments

@kot0dama
Copy link

kot0dama commented Nov 2, 2022

Hi!

I'm not sure if that's for matteircd to handle, but would there be a way to differentiate between public and private channels ?
For example private ones could be prefixed with ## or something similar ?

Thank you!

@kot0dama
Copy link
Author

kot0dama commented Nov 2, 2022

From the RFC:

   Channels names are strings (beginning with a '&' or '#' character) of
   length up to 200 characters.  Apart from the the requirement that the
   first character being either '&' or '#'; the only restriction on a
   channel name is that it may not contain any spaces (' '), a control G
   (^G or ASCII 7), or a comma (',' which is used as a list item
   separator by the protocol).

@kot0dama
Copy link
Author

kot0dama commented Nov 2, 2022

I'm not sure if MatterMost allows for channels starting with a #, in any case we could also use & instead to avoid any confusion with a real public channel starting with a #.

@42wim
Copy link
Owner

42wim commented Nov 2, 2022

This is already done using the +p irc flags. You should see this in your irc client.

image

@kot0dama
Copy link
Author

kot0dama commented Nov 2, 2022

Ah I see, I'm using hexchat and that one doesn't display modes sadly.
I should switch to irssi soon enough though.

Maybe that's something worth revisiting though, for more visibility and for folks using hexchat or similar clients ?

Freenode used to use ## for non official channels, and I think some networks use & for private ones.
Unless matterircd already uses & for something else ?

@42wim
Copy link
Owner

42wim commented Nov 2, 2022

https://hexchat.readthedocs.io/en/latest/settings.html has an option to show it.

& is already used for special channels
as the irc modes are the "irc" way to differentiate different type of channel settings, I'm not really a fan of having another option to do the same.

It should be the responsibility of the irc client to implement it correctly.

@kot0dama
Copy link
Author

kot0dama commented Nov 4, 2022

I see, well I'll need to report a bug to hexchat then as it displays an empty () where I'm guessing channel modes should appear :)
Thanks for the pointers.

As an IRC user from long ago, I understand your point of view on this, but then Mattermost client (desktop and web) is clearly displaying a lock icon in front of private channels, and I thought it would be best to reflect that on IRC, as there are ways to do it.

Mattermost does not allow channels to start with a # (at least not in their channel handle), and if you create a channel like #test, it will be stored by Mattermost with #test as channel name, but that will not be reflected in the channel handle test, stripped of the pound sign.

Could you reconsider your stance on this and allow private channels to be displayed as ##channel_handle, maybe as an option ?

@hloeung
Copy link
Collaborator

hloeung commented Nov 4, 2022

Having more thought on this, I think this creates a bit of confusion though. A user joining a channel would need to guess if it's public or private, so /join #channel or /join ##channel. Or "Hey Bob, can you join ##channel?"

Maybe the IRC client of choice could be made to show private channels differently with the +p mode instead - different colours for status bar etc.

I started a quick patch to play around but aborted due to the reasoning above. You're free to run with it:

diff --git a/mm-go-irckit/channel.go b/mm-go-irckit/channel.go
index 3102fe3..c2b2ad7 100644
--- a/mm-go-irckit/channel.go
+++ b/mm-go-irckit/channel.go
@@ -90,11 +90,15 @@ type channel struct {

 // NewChannel returns a Channel implementation for a given Server.
 func NewChannel(server Server, channelID string, name string, service string, modes map[string]bool) Channel {
+       channel_name := name
+       if modes["p"] {
+               channel_name = "#" + name
+       }
        return &channel{
                created:  time.Now(),
                server:   server,
                id:       channelID,
-               name:     name,
+               name:     channel_name,
                service:  service,
                private:  modes["p"],
                usersIdx: make(map[string]*User),

You'll then need to also update various other places such as ./mm-go-irckit/service.go, ./mm-go-irckit/server_commands.go, ./mm-go-irckit/userbridge.go.

idY7ljQ73E
lzUu3VkRFd

@hloeung
Copy link
Collaborator

hloeung commented Nov 5, 2022

See also #235

@42wim
Copy link
Owner

42wim commented Nov 5, 2022

Nope, not sold on the ## I'm open to adding a 🔒 to the irc-topic though as a compromise ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants