mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
ios: use agent connection id as key for network statuses map (#1808)
This commit is contained in:
@@ -1017,7 +1017,7 @@ func processReceivedMsg(_ res: ChatResponse) async {
|
||||
m.removeChat(contact.activeConn.id)
|
||||
NtfManager.shared.notifyContactConnected(user, contact)
|
||||
}
|
||||
m.updateContactNetworkStatus(contact, .connected)
|
||||
m.setContactNetworkStatus(contact, .connected)
|
||||
case let .contactConnecting(user, contact):
|
||||
if active(user) && contact.directOrUsed {
|
||||
m.updateContact(contact)
|
||||
@@ -1049,9 +1049,9 @@ func processReceivedMsg(_ res: ChatResponse) async {
|
||||
}
|
||||
m.removeChat(mergedContact.id)
|
||||
}
|
||||
case let .contactsSubscribed(_, _, contactRefs):
|
||||
case let .contactsSubscribed(_, contactRefs):
|
||||
updateContactsStatus(contactRefs, status: .connected)
|
||||
case let .contactsDisconnected(_, _, contactRefs):
|
||||
case let .contactsDisconnected(_, contactRefs):
|
||||
updateContactsStatus(contactRefs, status: .disconnected)
|
||||
case let .contactSubError(user, contact, chatError):
|
||||
if active(user) {
|
||||
@@ -1066,7 +1066,7 @@ func processReceivedMsg(_ res: ChatResponse) async {
|
||||
if let err = sub.contactError {
|
||||
processContactSubError(sub.contact, err)
|
||||
} else {
|
||||
m.updateContactNetworkStatus(sub.contact, .connected)
|
||||
m.setContactNetworkStatus(sub.contact, .connected)
|
||||
}
|
||||
}
|
||||
case let .newChatItem(user, aChatItem):
|
||||
@@ -1285,7 +1285,7 @@ func chatItemSimpleUpdate(_ aChatItem: AChatItem) {
|
||||
func updateContactsStatus(_ contactRefs: [ContactRef], status: NetworkStatus) {
|
||||
let m = ChatModel.shared
|
||||
for c in contactRefs {
|
||||
m.networkStatuses[c.connId] = status
|
||||
m.networkStatuses[c.agentConnId] = status
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1297,7 +1297,7 @@ func processContactSubError(_ contact: Contact, _ chatError: ChatError) {
|
||||
case .errorAgent(agentError: .SMP(smpErr: .AUTH)): err = "contact deleted"
|
||||
default: err = String(describing: chatError)
|
||||
}
|
||||
m.updateContactNetworkStatus(contact, .error(err))
|
||||
m.setContactNetworkStatus(contact, .error(err))
|
||||
}
|
||||
|
||||
func refreshCallInvitations() throws {
|
||||
|
||||
Reference in New Issue
Block a user