3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-13 07:29:30 +01:00

review fix

This commit is contained in:
Shivaram Lingamneni 2018-04-23 20:03:26 -04:00
parent fad2475c3f
commit abbbd2c899
2 changed files with 4 additions and 4 deletions

View File

@ -690,7 +690,7 @@ func (channel *Channel) applyModeToMember(client *Client, mode modes.Mode, op mo
channel.stateMutex.Lock() channel.stateMutex.Lock()
modeset, exists := channel.members[target] modeset, exists := channel.members[target]
if exists { if exists {
if applied := modeset.SetMode(mode, op == modes.Add); applied { if modeset.SetMode(mode, op == modes.Add) {
result = &modes.ModeChange{ result = &modes.ModeChange{
Op: op, Op: op,
Mode: mode, Mode: mode,

View File

@ -34,7 +34,7 @@ func ApplyUserModeChanges(client *Client, changes modes.ModeChanges, force bool)
continue continue
} }
if changed := client.SetMode(change.Mode, true); changed { if client.SetMode(change.Mode, true) {
if change.Mode == modes.Invisible { if change.Mode == modes.Invisible {
client.server.stats.ChangeInvisible(1) client.server.stats.ChangeInvisible(1)
} else if change.Mode == modes.Operator || change.Mode == modes.LocalOperator { } else if change.Mode == modes.Operator || change.Mode == modes.LocalOperator {
@ -44,7 +44,7 @@ func ApplyUserModeChanges(client *Client, changes modes.ModeChanges, force bool)
} }
case modes.Remove: case modes.Remove:
if changed := client.SetMode(change.Mode, false); changed { if client.SetMode(change.Mode, false) {
if change.Mode == modes.Invisible { if change.Mode == modes.Invisible {
client.server.stats.ChangeInvisible(-1) client.server.stats.ChangeInvisible(-1)
} else if change.Mode == modes.Operator || change.Mode == modes.LocalOperator { } else if change.Mode == modes.Operator || change.Mode == modes.LocalOperator {
@ -216,7 +216,7 @@ func (channel *Channel) ApplyChannelModeChanges(client *Client, isSamode bool, c
continue continue
} }
if changed := channel.flags.SetMode(change.Mode, change.Op == modes.Add); changed { if channel.flags.SetMode(change.Mode, change.Op == modes.Add) {
applied = append(applied, change) applied = append(applied, change)
} }