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

Fix #1911 +s channels don't appear in /list even though on the channel #1923

Merged
merged 2 commits into from
Mar 1, 2022

Conversation

FiskFan1999
Copy link
Contributor

As discussed in #1911 this replicates the intended behavior in which the daemon does list a channel with mode +s in quote list if the user is joined to that channel.

irc/handlers.go Outdated
clientIsOp := client.HasRoleCapabs("sajoin")
if len(channels) == 0 {
for _, channel := range server.channels.Channels() {
if !clientIsOp && channel.flags.HasMode(modes.Secret) {
if !clientIsOp && channel.flags.HasMode(modes.Secret) && !isUserInThisChannel(clientChannels, channel) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just check channel.hasClient(client) here and below. It does a lock acquisition, but so does rplList, so that seems fine.

@FiskFan1999
Copy link
Contributor Author

Thanks @slingamn, I switched to channel.HasClient. As it stands now this branch only diffs from the master branch on two lines. Let me know if you would like me to resubmit this PR squashing the commits together.

@slingamn slingamn merged commit 4010f3f into ergochat:master Mar 1, 2022
@FiskFan1999 FiskFan1999 deleted the fflist2 branch March 1, 2022 04:40
slingamn pushed a commit that referenced this pull request Jun 9, 2022
#1923)

* Fix #1911 +s channels don't appear in /list even though on the channel

* use channel.HasClient instead of custom iterative checker
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

Successfully merging this pull request may close these issues.

2 participants