mobile: remove most user data from responses, to reduce noice in errors/console (#2966)

* mobile: remove most user data from responses, to reduce noice in errors/console

* small change for desktop

---------

Co-authored-by: Avently <7953703+avently@users.noreply.github.com>
This commit is contained in:
Evgeny Poberezkin
2023-08-22 12:20:21 +01:00
committed by GitHub
co-authored by Avently
parent e804df9d58
commit a35ab7f9bc
14 changed files with 282 additions and 245 deletions
+4 -4
View File
@@ -807,7 +807,7 @@ func apiChatUnread(type: ChatType, id: Int64, unreadChat: Bool) async throws {
try await sendCommandOkResp(.apiChatUnread(type: type, id: id, unreadChat: unreadChat))
}
func receiveFile(user: User, fileId: Int64, auto: Bool = false) async {
func receiveFile(user: any UserLike, fileId: Int64, auto: Bool = false) async {
if let chatItem = await apiReceiveFile(fileId: fileId, auto: auto) {
await chatItemSimpleUpdate(user, chatItem)
}
@@ -1587,11 +1587,11 @@ func processReceivedMsg(_ res: ChatResponse) async {
}
}
func active(_ user: User) -> Bool {
user.id == ChatModel.shared.currentUser?.id
func active(_ user: any UserLike) -> Bool {
user.userId == ChatModel.shared.currentUser?.id
}
func chatItemSimpleUpdate(_ user: User, _ aChatItem: AChatItem) async {
func chatItemSimpleUpdate(_ user: any UserLike, _ aChatItem: AChatItem) async {
let m = ChatModel.shared
let cInfo = aChatItem.chatInfo
let cItem = aChatItem.chatItem