diff --git a/utils/eventHandler.go b/utils/eventHandler.go index 16d625f..9593cf3 100644 --- a/utils/eventHandler.go +++ b/utils/eventHandler.go @@ -180,8 +180,13 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { isArchived = event.False } - // Resolve Peer State (should probably be DISCONNECTED) - state := profile.GetPeerState(conversationInfo.Handle) + groupServer, _ := conversationInfo.GetAttribute(attr.LocalScope, attr.LegacyGroupZone, constants.GroupServer) + + stateHandle := conversationInfo.Handle + if conversationInfo.IsGroup() { + stateHandle = groupServer + } + state := profile.GetPeerState(stateHandle) if !set { state = connections.DISCONNECTED } @@ -191,9 +196,6 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { blocked = true } - // Check if we are a server... - groupServer, _ := conversationInfo.GetAttribute(attr.LocalScope, attr.LegacyGroupZone, constants.GroupServer) - // Fetch the message count, and the time of the most recent message count, err := profile.GetChannelMessageCount(conversationInfo.ID, 0) if err != nil {