core: manage calls for all users (#1748)

This commit is contained in:
JRoberts
2023-01-16 15:06:03 +04:00
committed by GitHub
parent a040fa65bb
commit 9dc6c1327f
8 changed files with 52 additions and 45 deletions

View File

@@ -711,8 +711,7 @@ func apiEndCall(_ contact: Contact) async throws {
}
func apiGetCallInvitations() throws -> [RcvCallInvitation] {
guard let userId = ChatModel.shared.currentUser?.userId else { throw RuntimeError("apiGetCallInvitations: no current user") }
let r = chatSendCmdSync(.apiGetCallInvitations(userId: userId))
let r = chatSendCmdSync(.apiGetCallInvitations)
if case let .callInvitations(invs) = r { return invs }
throw r
}