mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Adopt various rust side Timeline API additions (#3423)
* Adopt new reaction toggling API introduced in matrix-org/matrix-rust-sdk/pull/4127 * Adopt the changes introduced in matrix-org/matrix-rust-sdk/pull/4111: use the new `TimelineUniqueId` type instead of `String` for unique timeline identifiers. * Bump the RustSDK to v1.0.58. * Fix unit tests
This commit is contained in:
+2
-2
@@ -84,7 +84,7 @@ class MockRoomTimelineController: RoomTimelineControllerProtocol {
|
||||
inReplyToEventID: String?,
|
||||
intentionalMentions: IntentionalMentions) async { }
|
||||
|
||||
func toggleReaction(_ reaction: String, to itemID: TimelineItemIdentifier) async { }
|
||||
func toggleReaction(_ reaction: String, to eventID: EventOrTransactionId) async { }
|
||||
|
||||
func edit(_ eventOrTransactionID: EventOrTransactionId,
|
||||
useTimeline: Bool,
|
||||
@@ -92,7 +92,7 @@ class MockRoomTimelineController: RoomTimelineControllerProtocol {
|
||||
html: String?,
|
||||
intentionalMentions: IntentionalMentions) async { }
|
||||
|
||||
func redact(_ itemID: TimelineItemIdentifier) async { }
|
||||
func redact(_ eventOrTransactionID: EventOrTransactionId) async { }
|
||||
|
||||
func pin(eventID: String) async { }
|
||||
|
||||
|
||||
@@ -158,10 +158,10 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func toggleReaction(_ reaction: String, to itemID: TimelineItemIdentifier) async {
|
||||
MXLog.info("Toggle reaction in \(roomID)")
|
||||
func toggleReaction(_ reaction: String, to eventOrTransactionID: EventOrTransactionId) async {
|
||||
MXLog.info("Toggle reaction \(reaction) to \(eventOrTransactionID)")
|
||||
|
||||
switch await activeTimeline.toggleReaction(reaction, to: itemID) {
|
||||
switch await activeTimeline.toggleReaction(reaction, to: eventOrTransactionID) {
|
||||
case .success:
|
||||
MXLog.info("Finished toggling reaction")
|
||||
case .failure(let error):
|
||||
@@ -203,10 +203,10 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func redact(_ timelineItemID: TimelineItemIdentifier) async {
|
||||
func redact(_ eventOrTransactionID: EventOrTransactionId) async {
|
||||
MXLog.info("Send redaction in \(roomID)")
|
||||
|
||||
switch await activeTimeline.redact(timelineItemID, reason: nil) {
|
||||
switch await activeTimeline.redact(eventOrTransactionID, reason: nil) {
|
||||
case .success:
|
||||
MXLog.info("Finished redacting message")
|
||||
case .failure(let error):
|
||||
|
||||
+2
-2
@@ -57,9 +57,9 @@ protocol RoomTimelineControllerProtocol {
|
||||
html: String?,
|
||||
intentionalMentions: IntentionalMentions) async
|
||||
|
||||
func toggleReaction(_ reaction: String, to itemID: TimelineItemIdentifier) async
|
||||
func toggleReaction(_ reaction: String, to eventOrTransactionID: EventOrTransactionId) async
|
||||
|
||||
func redact(_ itemID: TimelineItemIdentifier) async
|
||||
func redact(_ eventOrTransactionID: EventOrTransactionId) async
|
||||
|
||||
func pin(eventID: String) async
|
||||
|
||||
|
||||
Reference in New Issue
Block a user