NewPeer enrichment of conversations: group use groupServer state
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Dan Ballard 2022-01-07 11:32:46 -05:00
parent f1d2e6a310
commit f2067348ec
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 {