Add voice message analytics

This commit is contained in:
Alfonso Grillo
2023-11-03 11:47:38 +01:00
committed by Alfonso Grillo
parent 530985e674
commit 4985d410b3
5 changed files with 14 additions and 5 deletions
@@ -1001,6 +1001,12 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
displayError(.alert(L10n.errorFailedUploadingVoiceMessage))
return
}
analytics.trackComposer(inThread: false,
isEditing: false,
isReply: false,
messageType: .voiceMessage,
startsThread: nil)
actionsSubject.send(.composer(action: .setMode(mode: .previewVoiceMessage(state: audioPlayerState, waveform: .url(recordingURL), isUploading: true))))
await voiceMessageRecorder.stopPlayback()
@@ -20,6 +20,7 @@ enum AnalyticsMessageType {
case location(LocationType)
case poll
case text
case voiceMessage
enum LocationType {
case pin
@@ -36,6 +37,8 @@ extension AnalyticsEvent.Composer.MessageType {
self = .Poll
case .text:
self = .Text
case .voiceMessage:
self = .VoiceMessage
}
}