Merge pull request 'NewPeer enrichment of conversations: group use groupServer state' (#59) from groupStatus into trunk
continuous-integration/drone/push Build is passing Details

Reviewed-on: #59
This commit is contained in:
Sarah Jamie Lewis 2022-01-07 18:36:28 +00:00
commit 24bcd72e75
1 changed files with 7 additions and 5 deletions

View File

@ -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 {