mobile: use batched DOWN/UP events, core: include pending contacts (#573)

* mobile: use batched DOWN/UP events, core: include pending contacts

* query style
This commit is contained in:
Evgeny Poberezkin
2022-04-26 07:51:06 +01:00
committed by GitHub
parent 44de6297ee
commit fc5cdc5eb1
5 changed files with 61 additions and 43 deletions
+10 -3
View File
@@ -70,9 +70,9 @@ final class ChatModel: ObservableObject {
}
}
func updateNetworkStatus(_ contact: Contact, _ status: Chat.NetworkStatus) {
if let ix = getChatIndex(contact.id) {
chats[ix].serverInfo.networkStatus = status
func updateNetworkStatus(_ id: ChatId, _ status: Chat.NetworkStatus) {
if let i = getChatIndex(id) {
chats[i].serverInfo.networkStatus = status
}
}
@@ -488,6 +488,13 @@ struct Contact: Identifiable, Decodable, NamedChat {
)
}
struct ContactRef: Decodable {
var contactId: Int64
var localDisplayName: ContactName
var id: ChatId { get { "@\(contactId)" } }
}
struct ContactSubStatus: Decodable {
var contact: Contact
var contactError: ChatError?