mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 01:19:33 +00:00
Send composer analytics when sending a message (#1288)
Composer event are not sent to posthog when sending messages. After investigation I've found that in `MessageComposerPresenter` the `analyticsService.capture()` call is invoked in the `SetMode` event handler rather than in the `SendMessage` event handler. This change should result in the desired behavior.
This commit is contained in:
+8
-8
@@ -148,14 +148,6 @@ class MessageComposerPresenter @Inject constructor(
|
|||||||
)
|
)
|
||||||
is MessageComposerEvents.SetMode -> {
|
is MessageComposerEvents.SetMode -> {
|
||||||
messageComposerContext.composerMode = event.composerMode
|
messageComposerContext.composerMode = event.composerMode
|
||||||
analyticsService.capture(
|
|
||||||
Composer(
|
|
||||||
inThread = messageComposerContext.composerMode.inThread,
|
|
||||||
isEditing = messageComposerContext.composerMode.isEditing,
|
|
||||||
isReply = messageComposerContext.composerMode.isReply,
|
|
||||||
messageType = Composer.MessageType.Text,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
MessageComposerEvents.AddAttachment -> localCoroutineScope.launch {
|
MessageComposerEvents.AddAttachment -> localCoroutineScope.launch {
|
||||||
showAttachmentSourcePicker = true
|
showAttachmentSourcePicker = true
|
||||||
@@ -238,6 +230,14 @@ class MessageComposerPresenter @Inject constructor(
|
|||||||
message.html,
|
message.html,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
analyticsService.capture(
|
||||||
|
Composer(
|
||||||
|
inThread = capturedMode.inThread,
|
||||||
|
isEditing = capturedMode.isEditing,
|
||||||
|
isReply = capturedMode.isReply,
|
||||||
|
messageType = Composer.MessageType.Text, // Set proper type when we'll be sending other types of messages.
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun CoroutineScope.sendAttachment(
|
private fun CoroutineScope.sendAttachment(
|
||||||
|
|||||||
Reference in New Issue
Block a user