diff --git a/app/plugins/contactRetry.go b/app/plugins/contactRetry.go index c6f4a70..b36bba0 100644 --- a/app/plugins/contactRetry.go +++ b/app/plugins/contactRetry.go @@ -180,7 +180,7 @@ func (cr *contactRetry) run() { cr.bus.Subscribe(event.ProtocolEngineShutdown, cr.queue) cr.bus.Subscribe(event.ProtocolEngineCreated, cr.queue) cr.bus.Subscribe(event.DeleteContact, cr.queue) - + cr.bus.Subscribe(event.UpdateConversationAuthorization, cr.queue) for { // Only attempt connection if both the ACN and the Protocol Engines are Online... log.Debugf("restartFlow checking state") @@ -234,6 +234,14 @@ func (cr *contactRetry) run() { // same delete conversation flow) peer := e.Data[event.RemotePeer] cr.authorizedPeers.Delete(peer) + case event.UpdateConversationAuthorization: + // if we update the conversation authorization then we need to check if + // we need to remove blocked conversations from the regular flow. + peer := e.Data[event.RemotePeer] + blocked := e.Data[event.Blocked] + if blocked == "true" { + cr.authorizedPeers.Delete(peer) + } case event.PeerStateChange: state := connections.ConnectionStateToType()[e.Data[event.ConnectionState]] peer := e.Data[event.RemotePeer] diff --git a/functionality/servers/servers_functionality.go b/functionality/servers/servers_functionality.go index 7cd5f37..eef3529 100644 --- a/functionality/servers/servers_functionality.go +++ b/functionality/servers/servers_functionality.go @@ -42,9 +42,8 @@ func (f *Functionality) OnEvent(ev event.Event, profile peer.CwtchPeer) { if profile.IsFeatureEnabled(constants.GroupsExperiment) { switch ev.EventType { // keep the UI in sync with the current backend server updates... - // TODO: do we need a secondary heartbeat for less common updates? - case event.Heartbeat: - f.PublishServerUpdate(profile) + // queue join server gets triggered on load and on new servers so it's a nice + // low-noise event to hook into... case event.QueueJoinServer: f.PublishServerUpdate(profile) }