-
Notifications
You must be signed in to change notification settings - Fork 194
Listen to call decline to stop ringing when declined from other device #4505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4505 +/- ##
===========================================
- Coverage 79.18% 79.16% -0.03%
===========================================
Files 836 836
Lines 78731 78758 +27
===========================================
- Hits 62347 62346 -1
- Misses 16384 16412 +28
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
60c329d
to
b480695
Compare
1c8addd
to
12fd7e1
Compare
3509092
to
f847108
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, looks like a neat feature 🙌
I chatted with Stefan about the new DeclineCallbackPublisher
and we concluded that as there is only a single usage, the additional complexity probably isn't worth it. We're perfectly happy to follow the same pattern for these as we do for e.g. knocking, typing etc by subscribing and exposing a single publisher:
element-x-ios/ElementX/Sources/Services/Room/JoinedRoomProxy.swift
Lines 20 to 21 in df47858
// periphery:ignore - required for instance retention in the rust codebase | |
private var typingNotificationObservationToken: TaskHandle? |
element-x-ios/ElementX/Sources/Services/Room/JoinedRoomProxy.swift
Lines 59 to 62 in df47858
private let typingMembersSubject = CurrentValueSubject<[String], Never>([]) | |
var typingMembersPublisher: CurrentValuePublisher<[String], Never> { | |
typingMembersSubject.asCurrentValuePublisher() | |
} |
element-x-ios/ElementX/Sources/Services/Room/JoinedRoomProxy.swift
Lines 120 to 130 in df47858
Task { | |
subscribeToRoomInfoUpdates() | |
subscribeToTypingNotifications() | |
await subscribeToKnockRequests() | |
if infoPublisher.value.isEncrypted { | |
await subscribeToIdentityStatusChanges() | |
} | |
} |
element-x-ios/ElementX/Sources/Services/Room/JoinedRoomProxy.swift
Lines 719 to 735 in df47858
private func subscribeToTypingNotifications() { | |
typingNotificationObservationToken = room.subscribeToTypingNotifications(listener: RoomTypingNotificationUpdateListener { [weak self] typingUserIDs in | |
guard let self else { return } | |
MXLog.info("Received typing notification update, typingUsers: \(typingUserIDs)") | |
let typingMembers = typingUserIDs.compactMap { userID in | |
if let member = self.membersPublisher.value.filter({ $0.userID == userID }).first { | |
return member.displayName ?? member.userID | |
} else { | |
return userID | |
} | |
} | |
typingMembersSubject.send(typingMembers) | |
}) | |
} |
48c1f7a
to
2c242a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the updates.
|
Pull Request Checklist
Fixes Fixes #4493
Based on #4499
UI changes have been tested with: