Format file

This commit is contained in:
Benoit Marty 2022-05-05 12:01:33 +02:00
parent 66b32a74d5
commit 67bc7c93e6
1 changed files with 35 additions and 18 deletions

View File

@ -666,11 +666,13 @@ class TimelineFragment @Inject constructor(
).apply {
directListener = { granted ->
if (granted) {
timelineViewModel.handle(RoomDetailAction.EnsureNativeWidgetAllowed(
widget = it.widget,
userJustAccepted = true,
grantedEvents = it.grantedEvents
))
timelineViewModel.handle(
RoomDetailAction.EnsureNativeWidgetAllowed(
widget = it.widget,
userJustAccepted = true,
grantedEvents = it.grantedEvents
)
)
}
}
}
@ -791,25 +793,29 @@ class TimelineFragment @Inject constructor(
override fun onSendVoiceMessage() {
messageComposerViewModel.handle(
MessageComposerAction.EndRecordingVoiceMessage(isCancelled = false, rootThreadEventId = getRootThreadEventId()))
MessageComposerAction.EndRecordingVoiceMessage(isCancelled = false, rootThreadEventId = getRootThreadEventId())
)
updateRecordingUiState(RecordingUiState.Idle)
}
override fun onDeleteVoiceMessage() {
messageComposerViewModel.handle(
MessageComposerAction.EndRecordingVoiceMessage(isCancelled = true, rootThreadEventId = getRootThreadEventId()))
MessageComposerAction.EndRecordingVoiceMessage(isCancelled = true, rootThreadEventId = getRootThreadEventId())
)
updateRecordingUiState(RecordingUiState.Idle)
}
override fun onRecordingLimitReached() {
messageComposerViewModel.handle(
MessageComposerAction.PauseRecordingVoiceMessage)
MessageComposerAction.PauseRecordingVoiceMessage
)
updateRecordingUiState(RecordingUiState.Draft)
}
override fun onRecordingWaveformClicked() {
messageComposerViewModel.handle(
MessageComposerAction.PauseRecordingVoiceMessage)
MessageComposerAction.PauseRecordingVoiceMessage
)
updateRecordingUiState(RecordingUiState.Draft)
}
@ -827,7 +833,8 @@ class TimelineFragment @Inject constructor(
private fun updateRecordingUiState(state: RecordingUiState) {
messageComposerViewModel.handle(
MessageComposerAction.OnVoiceRecordingUiStateChanged(state))
MessageComposerAction.OnVoiceRecordingUiStateChanged(state)
)
}
}
}
@ -1527,9 +1534,11 @@ class TimelineFragment @Inject constructor(
attachmentTypeSelector = AttachmentTypeSelectorView(vectorBaseActivity, vectorBaseActivity.layoutInflater, this@TimelineFragment)
attachmentTypeSelector.setAttachmentVisibility(
AttachmentTypeSelectorView.Type.LOCATION,
vectorPreferences.isLocationSharingEnabled())
vectorPreferences.isLocationSharingEnabled()
)
attachmentTypeSelector.setAttachmentVisibility(
AttachmentTypeSelectorView.Type.POLL, !isThreadTimeLine())
AttachmentTypeSelectorView.Type.POLL, !isThreadTimeLine()
)
}
attachmentTypeSelector.show(views.composerLayout.views.attachmentButton)
}
@ -2292,12 +2301,18 @@ class TimelineFragment @Inject constructor(
handleCancelSend(action)
}
is EventSharedAction.ReportContentSpam -> {
timelineViewModel.handle(RoomDetailAction.ReportContent(
action.eventId, action.senderId, "This message is spam", spam = true))
timelineViewModel.handle(
RoomDetailAction.ReportContent(
action.eventId, action.senderId, "This message is spam", spam = true
)
)
}
is EventSharedAction.ReportContentInappropriate -> {
timelineViewModel.handle(RoomDetailAction.ReportContent(
action.eventId, action.senderId, "This message is inappropriate", inappropriate = true))
timelineViewModel.handle(
RoomDetailAction.ReportContent(
action.eventId, action.senderId, "This message is inappropriate", inappropriate = true
)
)
}
is EventSharedAction.ReportContentCustom -> {
promptReasonToReportContent(action)
@ -2443,7 +2458,8 @@ class TimelineFragment @Inject constructor(
displayName = timelineViewModel.getRoomSummary()?.displayName,
avatarUrl = timelineViewModel.getRoomSummary()?.avatarUrl,
roomEncryptionTrustLevel = timelineViewModel.getRoomSummary()?.roomEncryptionTrustLevel,
rootThreadEventId = rootThreadEventId)
rootThreadEventId = rootThreadEventId
)
navigator.openThread(it, roomThreadDetailArgs)
}
}
@ -2479,7 +2495,8 @@ class TimelineFragment @Inject constructor(
roomId = timelineArgs.roomId,
displayName = timelineViewModel.getRoomSummary()?.displayName,
roomEncryptionTrustLevel = timelineViewModel.getRoomSummary()?.roomEncryptionTrustLevel,
avatarUrl = timelineViewModel.getRoomSummary()?.avatarUrl)
avatarUrl = timelineViewModel.getRoomSummary()?.avatarUrl
)
navigator.openThreadList(it, roomThreadDetailArgs)
}
}