Simplify handleMessage logic in gateway for topic sync.

This commit is contained in:
Patrick Connolly
2018-11-21 00:55:39 +08:00
parent bc0d0efe66
commit 5b8a338409

View File

@@ -267,16 +267,11 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM
return brMsgIDs return brMsgIDs
} }
// only relay topic change when configured // only relay topic change when used in some way on other side
if msg.Event == config.EventTopicChange && !gw.Bridges[dest.Account].GetBool("ShowTopicChange") { if msg.Event == config.EventTopicChange &&
// don't relay topic/purpose change if disabled !gw.Bridges[dest.Account].GetBool("ShowTopicChange") &&
if !gw.Bridges[dest.Account].GetBool("ShowTopicChange") { !gw.Bridges[dest.Account].GetBool("SyncTopic") {
return brMsgIDs return brMsgIDs
}
// don't relay topic/purpose update if sync is enabled
if gw.Bridges[dest.Account].GetBool("SyncTopic") {
return brMsgIDs
}
} }
// broadcast to every out channel (irc QUIT) // broadcast to every out channel (irc QUIT)