Moved nosync message drop into gateway logic.

This commit is contained in:
Patrick Connolly
2018-11-13 17:49:02 +08:00
parent fa2e31ce51
commit 2e3d90ef64
3 changed files with 11 additions and 8 deletions

View File

@@ -269,9 +269,17 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM
// only relay topic change when configured
if msg.Event == config.EventTopicChange && !gw.Bridges[dest.Account].GetBool("ShowTopicChange") {
return brMsgIDs
// don't relay topic/purpose change if disabled
if !gw.Bridges[dest.Account].GetBool("ShowTopicChange") {
return brMsgIDs
}
// don't relay topic/purpose update if sync is enabled, but msg marked as nosync
if gw.Bridges[dest.Account].GetBool("SyncTopicChange") && strings.HasSuffix(msg.Text, "[nosync]") {
return brMsgIDs
}
}
// broadcast to every out channel (irc QUIT)
if msg.Channel == "" && msg.Event != config.EventJoinLeave {
flog.Debug("empty channel")