Track when the user starts a room call and when they enable formatting options on the message composer

This commit is contained in:
Stefan Ceriu
2024-05-30 12:36:41 +03:00
committed by Stefan Ceriu
parent 8c62c52f45
commit c3571f4f4e
9 changed files with 31 additions and 13 deletions
@@ -27,6 +27,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
private let wysiwygViewModel: WysiwygComposerViewModel
private let completionSuggestionService: CompletionSuggestionServiceProtocol
private let appSettings: AppSettings
private let analyticsService: AnalyticsService
private let mentionBuilder: MentionBuilderProtocol
private let attributedStringBuilder: AttributedStringBuilderProtocol
@@ -47,10 +48,16 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
private var currentLinkData: WysiwygLinkData?
init(wysiwygViewModel: WysiwygComposerViewModel, completionSuggestionService: CompletionSuggestionServiceProtocol, mediaProvider: MediaProviderProtocol, appSettings: AppSettings, mentionDisplayHelper: MentionDisplayHelper) {
init(wysiwygViewModel: WysiwygComposerViewModel,
completionSuggestionService: CompletionSuggestionServiceProtocol,
mediaProvider: MediaProviderProtocol,
appSettings: AppSettings,
mentionDisplayHelper: MentionDisplayHelper,
analyticsService: AnalyticsService) {
self.wysiwygViewModel = wysiwygViewModel
self.completionSuggestionService = completionSuggestionService
self.appSettings = appSettings
self.analyticsService = analyticsService
mentionBuilder = MentionBuilder()
attributedStringBuilder = AttributedStringBuilder(cacheKey: "Composer", mentionBuilder: mentionBuilder)
@@ -157,6 +164,8 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
case .enableTextFormatting:
state.bindings.composerFormattingEnabled = true
state.bindings.composerFocused = true
analyticsService.trackInteraction(name: .MobileRoomComposerFormattingEnabled)
case .composerAction(let action):
if action == .link {
createLinkAlert()