Send UTD occurences to Posthog (#2575)

Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
This commit is contained in:
Mauro
2024-03-15 00:42:44 +01:00
committed by GitHub
parent c68ec2c382
commit 7611123ae1
8 changed files with 55 additions and 12 deletions
@@ -589,6 +589,7 @@ class ClientProxy: ClientProxyProtocol {
let syncService = try await client
.syncService()
.withCrossProcessLock(appIdentifier: "MainApp")
.withUtdHook(delegate: ClientDecryptionErrorDelegate(actionsSubject: actionsSubject))
.finish()
let roomListService = syncService.roomListService()
@@ -803,6 +804,18 @@ private class ClientDelegateWrapper: ClientDelegate {
}
}
private class ClientDecryptionErrorDelegate: UnableToDecryptDelegate {
private let actionsSubject: PassthroughSubject<ClientProxyAction, Never>
init(actionsSubject: PassthroughSubject<ClientProxyAction, Never>) {
self.actionsSubject = actionsSubject
}
func onUtd(info: UnableToDecryptInfo) {
actionsSubject.send(.receivedDecryptionError(info))
}
}
private class IgnoredUsersListenerProxy: IgnoredUsersListener {
private let onUpdateClosure: ([String]) -> Void