Screen sharing in 1-to-1 calls

This commit is contained in:
Ali
2021-07-23 18:02:47 +02:00
parent 37c6de33ff
commit ee7116ff15
25 changed files with 395 additions and 275 deletions

View File

@@ -203,9 +203,9 @@ public final class NotificationViewControllerImpl {
return
}
self.applyDisposable.set((sharedAccountContext.activeAccounts
self.applyDisposable.set((sharedAccountContext.activeAccountContexts
|> map { _, accounts, _ -> Account? in
return accounts.first(where: { $0.0 == AccountRecordId(rawValue: accountIdValue) })?.1
return accounts.first(where: { $0.0 == AccountRecordId(rawValue: accountIdValue) })?.1.account
}
|> filter { account in
return account != nil
@@ -254,16 +254,16 @@ public final class NotificationViewControllerImpl {
self.imageInfo = (true, dimensions.cgSize)
self.updateImageLayout(boundingSize: view.bounds.size)
self.applyDisposable.set((sharedAccountContext.activeAccounts
|> map { _, accounts, _ -> Account? in
return accounts.first(where: { $0.0 == AccountRecordId(rawValue: accountIdValue) })?.1
self.applyDisposable.set((sharedAccountContext.activeAccountContexts
|> map { _, contexts, _ -> AccountContext? in
return contexts.first(where: { $0.0 == AccountRecordId(rawValue: accountIdValue) })?.1
}
|> filter { account in
return account != nil
|> filter { context in
return context != nil
}
|> take(1)
|> mapToSignal { account -> Signal<(Account, FileMediaReference?), NoError> in
guard let account = account else {
|> mapToSignal { context -> Signal<(Account, FileMediaReference?), NoError> in
guard let account = context?.account else {
return .complete()
}
return account.postbox.messageAtId(messageId)