Address review

This commit is contained in:
bxdxnn
2026-06-08 18:17:45 +00:00
parent a10aa6cbe3
commit 8b4158c824
5 changed files with 3 additions and 8 deletions
@@ -107,7 +107,7 @@ class MessagesNode(
private val timelineController = TimelineController(room, room.liveTimeline) private val timelineController = TimelineController(room, room.liveTimeline)
private val presenter = presenterFactory.create( private val presenter = presenterFactory.create(
navigator = this, navigator = this,
composerPresenter = messageComposerPresenterFactory.create(timelineController, this, isInThread = false, threadRoot = null), composerPresenter = messageComposerPresenterFactory.create(timelineController, this, threadRoot = null),
timelinePresenter = timelinePresenterFactory.create(timelineController = timelineController, this), timelinePresenter = timelinePresenterFactory.create(timelineController = timelineController, this),
actionListPresenter = actionListPresenterFactory.create( actionListPresenter = actionListPresenterFactory.create(
postProcessor = TimelineItemActionPostProcessor.Default, postProcessor = TimelineItemActionPostProcessor.Default,
@@ -110,7 +110,6 @@ import io.element.android.libraries.core.mimetype.MimeTypes.Any as AnyMimeTypes
class MessageComposerPresenter( class MessageComposerPresenter(
@Assisted private val navigator: MessagesNavigator, @Assisted private val navigator: MessagesNavigator,
@Assisted private val timelineController: TimelineController, @Assisted private val timelineController: TimelineController,
@Assisted private val isInThread: Boolean,
@Assisted private val threadRoot: ThreadId?, @Assisted private val threadRoot: ThreadId?,
@SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope, @SessionCoroutineScope private val sessionCoroutineScope: CoroutineScope,
private val room: JoinedRoom, private val room: JoinedRoom,
@@ -140,11 +139,11 @@ class MessageComposerPresenter(
fun create( fun create(
timelineController: TimelineController, timelineController: TimelineController,
navigator: MessagesNavigator, navigator: MessagesNavigator,
isInThread: Boolean,
threadRoot: ThreadId?, threadRoot: ThreadId?,
): MessageComposerPresenter ): MessageComposerPresenter
} }
private val isInThread: Boolean get() = threadRoot != null
private val mediaSender = mediaSenderFactory.create(timelineMode = timelineController.mainTimelineMode()) private val mediaSender = mediaSenderFactory.create(timelineMode = timelineController.mainTimelineMode())
private val cameraPermissionPresenter = permissionsPresenterFactory.create(Manifest.permission.CAMERA) private val cameraPermissionPresenter = permissionsPresenterFactory.create(Manifest.permission.CAMERA)
@@ -112,7 +112,7 @@ class ThreadedMessagesNode(
this.timelineController = timelineController this.timelineController = timelineController
return presenterFactory.create( return presenterFactory.create(
navigator = this, navigator = this,
composerPresenter = messageComposerPresenterFactory.create(timelineController, this, isInThread = true, threadRoot = inputs.threadRootEventId), composerPresenter = messageComposerPresenterFactory.create(timelineController, this, threadRoot = inputs.threadRootEventId),
timelinePresenter = timelinePresenterFactory.create(timelineController = timelineController, this), timelinePresenter = timelinePresenterFactory.create(timelineController = timelineController, this),
// TODO add special processor for threaded timeline // TODO add special processor for threaded timeline
actionListPresenter = actionListPresenterFactory.create( actionListPresenter = actionListPresenterFactory.create(
@@ -272,13 +272,11 @@ class MessageComposerPresenterSlashCommandTest {
isRichTextEditorEnabled: Boolean = true, isRichTextEditorEnabled: Boolean = true,
draftService: ComposerDraftService = FakeComposerDraftService(), draftService: ComposerDraftService = FakeComposerDraftService(),
mediaOptimizationConfigProvider: FakeMediaOptimizationConfigProvider = FakeMediaOptimizationConfigProvider(), mediaOptimizationConfigProvider: FakeMediaOptimizationConfigProvider = FakeMediaOptimizationConfigProvider(),
isInThread: Boolean = false,
threadRoot: ThreadId? = null, threadRoot: ThreadId? = null,
slashCommandService: SlashCommandService = FakeSlashCommandService(), slashCommandService: SlashCommandService = FakeSlashCommandService(),
) = MessageComposerPresenter( ) = MessageComposerPresenter(
navigator = navigator, navigator = navigator,
sessionCoroutineScope = this, sessionCoroutineScope = this,
isInThread = isInThread,
threadRoot = threadRoot, threadRoot = threadRoot,
room = room, room = room,
mediaPickerProvider = pickerProvider, mediaPickerProvider = pickerProvider,
@@ -1534,13 +1534,11 @@ class MessageComposerPresenterTest {
isRichTextEditorEnabled: Boolean = true, isRichTextEditorEnabled: Boolean = true,
draftService: ComposerDraftService = FakeComposerDraftService(), draftService: ComposerDraftService = FakeComposerDraftService(),
mediaOptimizationConfigProvider: FakeMediaOptimizationConfigProvider = FakeMediaOptimizationConfigProvider(), mediaOptimizationConfigProvider: FakeMediaOptimizationConfigProvider = FakeMediaOptimizationConfigProvider(),
isInThread: Boolean = false,
threadRoot: ThreadId? = null, threadRoot: ThreadId? = null,
slashCommandService: SlashCommandService = FakeSlashCommandService(), slashCommandService: SlashCommandService = FakeSlashCommandService(),
) = MessageComposerPresenter( ) = MessageComposerPresenter(
navigator = navigator, navigator = navigator,
sessionCoroutineScope = this, sessionCoroutineScope = this,
isInThread = isInThread,
threadRoot = threadRoot, threadRoot = threadRoot,
room = room, room = room,
mediaPickerProvider = pickerProvider, mediaPickerProvider = pickerProvider,