mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Add history sharing badges to room details (#5043)
* chore: Add dependency `SwiftFlow` for use in avatar header badges. Signed-off-by: Skye Elliot <actuallyori@gmail.com> * feat: Display history sharing pill in room details. Signed-off-by: Skye Elliot <actuallyori@gmail.com> * tests: Add tests for history sharing room details pill. Signed-off-by: Skye Elliot <actuallyori@gmail.com> * tests: Update screenshots for RoomDetailsScreen preview tests. * fix: Use Localazy translations for room details badges * fix: Address review comments * fix: Remove line limit from room details badges --------- Signed-off-by: Skye Elliot <actuallyori@gmail.com>
This commit is contained in:
@@ -61,7 +61,13 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
|
||||
let topic = attributedStringBuilder.fromPlain(roomProxy.infoPublisher.value.topic)
|
||||
|
||||
super.init(initialViewState: .init(details: roomProxy.details,
|
||||
// Clear details.historySharingState manually while we are still behind a feature flag.
|
||||
var details = roomProxy.details
|
||||
if !appSettings.enableKeyShareOnInvite {
|
||||
details.historySharingState = nil
|
||||
}
|
||||
|
||||
super.init(initialViewState: .init(details: details,
|
||||
isEncrypted: roomProxy.infoPublisher.value.isEncrypted,
|
||||
isDirect: roomProxy.infoPublisher.value.isDirect,
|
||||
topic: topic,
|
||||
@@ -275,6 +281,14 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
|
||||
state.details = roomProxy.details
|
||||
|
||||
// Set state.details.historySharingState manually while we are still behind
|
||||
// a feature flag.
|
||||
if appSettings.enableKeyShareOnInvite {
|
||||
state.details.historySharingState = roomInfo.historySharingState
|
||||
} else {
|
||||
state.details.historySharingState = nil
|
||||
}
|
||||
|
||||
let topic = attributedStringBuilder.fromPlain(roomInfo.topic)
|
||||
state.topic = topic
|
||||
state.topicSummary = topic?.unattributedStringByReplacingNewlinesWithSpaces()
|
||||
|
||||
Reference in New Issue
Block a user