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
}
// only relay topic change when configured
if msg.Event == config.EventTopicChange && !gw.Bridges[dest.Account].GetBool("ShowTopicChange") {
// 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
if gw.Bridges[dest.Account].GetBool("SyncTopic") {
return brMsgIDs
}
// only relay topic change when used in some way on other side
if msg.Event == config.EventTopicChange &&
!gw.Bridges[dest.Account].GetBool("ShowTopicChange") &&
!gw.Bridges[dest.Account].GetBool("SyncTopic") {
return brMsgIDs
}
// broadcast to every out channel (irc QUIT)