mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-25 13:29:27 +01:00
fix #1178
This commit is contained in:
parent
4737578748
commit
5a9e79f06c
@ -1287,12 +1287,24 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod
|
||||
chname = fmt.Sprintf("%s%s", modes.ChannelModePrefixes[minPrefixMode], chname)
|
||||
}
|
||||
|
||||
if channel.flags.HasMode(modes.OpModerated) {
|
||||
channel.stateMutex.RLock()
|
||||
cuModes := channel.members[client]
|
||||
channel.stateMutex.RUnlock()
|
||||
if cuModes.HighestChannelUserMode() == modes.Mode(0) {
|
||||
// max(statusmsg_minmode, halfop)
|
||||
if minPrefixMode == modes.Mode(0) || minPrefixMode == modes.Voice {
|
||||
minPrefixMode = modes.Halfop
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// send echo-message
|
||||
rb.addEchoMessage(clientOnlyTags, details.nickMask, details.accountName, command, chname, message)
|
||||
|
||||
for _, member := range channel.Members() {
|
||||
if minPrefixMode != modes.Mode(0) && !channel.ClientIsAtLeast(member, minPrefixMode) {
|
||||
// STATUSMSG
|
||||
// STATUSMSG or OpModerated
|
||||
continue
|
||||
}
|
||||
|
||||
@ -1320,7 +1332,7 @@ func (channel *Channel) SendSplitMessage(command string, minPrefixMode modes.Mod
|
||||
}
|
||||
}
|
||||
|
||||
// #959: don't save STATUSMSG
|
||||
// #959: don't save STATUSMSG (or OpModerated)
|
||||
if minPrefixMode == modes.Mode(0) {
|
||||
channel.AddHistoryItem(history.Item{
|
||||
Type: histType,
|
||||
|
@ -56,6 +56,8 @@ Oragono supports the following channel modes:
|
||||
+C | Clients are blocked from sending CTCP messages in the channel.
|
||||
+u | Auditorium mode: JOIN, PART, QUIT, NAMES, and WHO are hidden
|
||||
hidden from unvoiced clients.
|
||||
+U | Op-moderated mode: messages from unprivileged clients are sent
|
||||
only to channel operators.
|
||||
|
||||
= Prefixes =
|
||||
|
||||
|
@ -23,7 +23,7 @@ var (
|
||||
SupportedChannelModes = Modes{
|
||||
BanMask, ChanRoleplaying, ExceptMask, InviteMask, InviteOnly, Key,
|
||||
Moderated, NoOutside, OpOnlyTopic, RegisteredOnly, RegisteredOnlySpeak,
|
||||
Secret, UserLimit, NoCTCP, Auditorium,
|
||||
Secret, UserLimit, NoCTCP, Auditorium, OpModerated,
|
||||
}
|
||||
)
|
||||
|
||||
@ -128,6 +128,7 @@ const (
|
||||
Secret Mode = 's' // flag
|
||||
UserLimit Mode = 'l' // flag arg
|
||||
NoCTCP Mode = 'C' // flag
|
||||
OpModerated Mode = 'U' // flag
|
||||
)
|
||||
|
||||
var (
|
||||
|
Loading…
Reference in New Issue
Block a user