From ff3f959d52d3920ed9e82e478c49a3f8208b3742 Mon Sep 17 00:00:00 2001 From: Alex Jaspersen Date: Sun, 27 Jun 2021 19:55:47 -0700 Subject: [PATCH] Allow +v users to talk in +R channels. --- docs/MANUAL.md | 2 +- irc/channel.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/MANUAL.md b/docs/MANUAL.md index 82cb04b8..b171a4d2 100644 --- a/docs/MANUAL.md +++ b/docs/MANUAL.md @@ -815,7 +815,7 @@ If this mode is unset, users who aren't on your channel can send messages to it. If this mode is set, only users that have logged into an account will be able to join and speak on the channel. If this is set and a regular, un-logged-in user tries to join, they will be rejected. -Unregistered users already joined to the channel will no longer be able to send messages to it, but they will not be kicked automatically. If they leave, they would not be allowed to rejoin. +Unregistered users already joined to the channel will not be kicked automatically. They will no longer be able to send messages to the channel, unless they have been voiced (+v). If they leave, they would not be allowed to rejoin. To set this mode: diff --git a/irc/channel.go b/irc/channel.go index dc5fdd7a..e45cd8c2 100644 --- a/irc/channel.go +++ b/irc/channel.go @@ -1231,7 +1231,8 @@ func (channel *Channel) CanSpeak(client *Client) (bool, modes.Mode) { if channel.flags.HasMode(modes.Moderated) && clientModes.HighestChannelUserMode() == modes.Mode(0) { return false, modes.Moderated } - if channel.flags.HasMode(modes.RegisteredOnly) && client.Account() == "" { + if channel.flags.HasMode(modes.RegisteredOnly) && client.Account() == "" && + clientModes.HighestChannelUserMode() == modes.Mode(0) { return false, modes.RegisteredOnly } if channel.flags.HasMode(modes.RegisteredOnlySpeak) && client.Account() == "" &&