mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Show a verification badge on the Room Member/User Profile screens. (#3427)
* Add a badge for verified users/room members. * Reorder subviews. * Add a (disabled) button to verify other users. * PR comments. * Update the SDK. * Adopt the SDK changes introduced in matrix-rust-sdk/pull/4100 --------- Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
This commit is contained in:
@@ -87,7 +87,6 @@ class MockRoomTimelineController: RoomTimelineControllerProtocol {
|
||||
func toggleReaction(_ reaction: String, to eventID: EventOrTransactionId) async { }
|
||||
|
||||
func edit(_ eventOrTransactionID: EventOrTransactionId,
|
||||
useTimeline: Bool,
|
||||
message: String,
|
||||
html: String?,
|
||||
intentionalMentions: IntentionalMentions) async { }
|
||||
|
||||
@@ -170,7 +170,6 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
}
|
||||
|
||||
func edit(_ eventOrTransactionID: EventOrTransactionId,
|
||||
useTimeline: Bool,
|
||||
message: String,
|
||||
html: String?,
|
||||
intentionalMentions: IntentionalMentions) async {
|
||||
@@ -181,25 +180,11 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
html: html,
|
||||
intentionalMentions: intentionalMentions.toRustMentions())
|
||||
|
||||
if useTimeline {
|
||||
switch await activeTimeline.edit(eventOrTransactionID, newContent: messageContent) {
|
||||
case .success:
|
||||
MXLog.info("Finished editing message by event")
|
||||
case let .failure(error):
|
||||
MXLog.error("Failed editing message by event with error: \(error)")
|
||||
}
|
||||
} else {
|
||||
guard case let .eventId(eventID) = eventOrTransactionID else {
|
||||
MXLog.error("Failed editing message, missing eventID.")
|
||||
return
|
||||
}
|
||||
|
||||
switch await roomProxy.edit(eventID: eventID, newContent: messageContent) {
|
||||
case .success:
|
||||
MXLog.info("Finished editing message by event ID")
|
||||
case let .failure(error):
|
||||
MXLog.error("Failed editing message by event ID with error: \(error)")
|
||||
}
|
||||
switch await activeTimeline.edit(eventOrTransactionID, newContent: messageContent) {
|
||||
case .success:
|
||||
MXLog.info("Finished editing message by event")
|
||||
case let .failure(error):
|
||||
MXLog.error("Failed editing message by event with error: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -52,7 +52,6 @@ protocol RoomTimelineControllerProtocol {
|
||||
intentionalMentions: IntentionalMentions) async
|
||||
|
||||
func edit(_ eventOrTransactionID: EventOrTransactionId,
|
||||
useTimeline: Bool,
|
||||
message: String,
|
||||
html: String?,
|
||||
intentionalMentions: IntentionalMentions) async
|
||||
|
||||
@@ -166,12 +166,10 @@ final class TimelineProxy: TimelineProxyProtocol {
|
||||
|
||||
func edit(_ eventOrTransactionID: EventOrTransactionId, newContent: RoomMessageEventContentWithoutRelation) async -> Result<Void, TimelineProxyError> {
|
||||
do {
|
||||
guard try await timeline.edit(eventOrTransactionId: eventOrTransactionID, newContent: .roomMessage(content: newContent)) == true else {
|
||||
return .failure(.failedEditing)
|
||||
}
|
||||
try await timeline.edit(eventOrTransactionId: eventOrTransactionID, newContent: .roomMessage(content: newContent))
|
||||
|
||||
MXLog.info("Finished editing timeline item: \(eventOrTransactionID)")
|
||||
|
||||
|
||||
return .success(())
|
||||
} catch {
|
||||
MXLog.error("Failed editing timeline item: \(eventOrTransactionID) with error: \(error)")
|
||||
@@ -460,13 +458,11 @@ final class TimelineProxy: TimelineProxyProtocol {
|
||||
do {
|
||||
let originalEvent = try await timeline.getEventTimelineItemByEventId(eventId: eventID)
|
||||
|
||||
guard try await timeline.edit(eventOrTransactionId: originalEvent.eventOrTransactionId,
|
||||
newContent: .pollStart(pollData: .init(question: question,
|
||||
answers: answers,
|
||||
maxSelections: 1,
|
||||
pollKind: .init(pollKind: pollKind)))) else {
|
||||
return .failure(.failedEditing)
|
||||
}
|
||||
try await timeline.edit(eventOrTransactionId: originalEvent.eventOrTransactionId,
|
||||
newContent: .pollStart(pollData: .init(question: question,
|
||||
answers: answers,
|
||||
maxSelections: 1,
|
||||
pollKind: .init(pollKind: pollKind))))
|
||||
|
||||
MXLog.info("Finished editing poll with eventID: \(eventID)")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user