decord/source/modules/voice_messages/VoiceMessageAnalytics.tsx

41 lines
2 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 11157
// Function ID: 11158
2026-07-20 16:05:17 +00:00
// Name: logVoiceMessagePlaybackStarted
2026-07-29 08:29:29 +00:00
// Dependencies: [676, 698, 2]
2026-07-20 16:05:17 +00:00
// Exports: logVoiceMessagePlaybackEnded, logVoiceMessagePlaybackFailed, logVoiceMessagePlaybackStarted
2026-08-05 07:35:12 +00:00
// Module 11157 (logVoiceMessagePlaybackStarted)
2026-07-23 10:11:24 +00:00
import { AnalyticEvents } from "ME";
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("modules/voice_messages/VoiceMessageAnalytics.tsx");
2026-07-20 16:05:17 +00:00
export const VoiceMessageRecordingResult = { SENT: "sent", CANCELLED_DURATION: "cancelled_duration", CANCELLED_USER_REQUESTED: "cancelled_user_requested", CANCELLED_GESTURE_CONFLICT: "cancelled_gesture_conflict", CANCELLED_ON_BACKGROUND: "cancelled_on_background" };
export const logVoiceMessagePlaybackStarted = function logVoiceMessagePlaybackStarted(messageId, totalDurationSecs, startDurationSecs, id) {
2026-07-29 08:29:29 +00:00
let tmp = totalDurationSecs;
let obj = importDefault(698);
obj = { message_id: messageId, total_duration_secs: totalDurationSecs, start_duration_secs: null, sender_user_id: null };
if (totalDurationSecs == null) {
tmp = startDurationSecs;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = Math.min(tmp, startDurationSecs);
obj[3] = id;
2026-07-20 16:05:17 +00:00
obj.track(AnalyticEvents.VOICE_MESSAGE_PLAYBACK_STARTED, obj);
};
export const logVoiceMessagePlaybackEnded = function logVoiceMessagePlaybackEnded(messageId, totalDurationSecs, endDurationSecs, id, durationListeningSecs) {
2026-07-29 08:29:29 +00:00
let tmp = totalDurationSecs;
let obj = importDefault(698);
obj = { message_id: messageId, total_duration_secs: totalDurationSecs, end_duration_secs: null, sender_user_id: null, duration_listening_secs: null };
if (totalDurationSecs == null) {
tmp = endDurationSecs;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = Math.min(tmp, endDurationSecs);
obj[3] = id;
obj[4] = durationListeningSecs;
2026-07-20 16:05:17 +00:00
obj.track(AnalyticEvents.VOICE_MESSAGE_PLAYBACK_ENDED, obj);
};
2026-07-29 08:29:29 +00:00
export const logVoiceMessagePlaybackFailed = function logVoiceMessagePlaybackFailed(messageId, errorMessage) {
let obj = importDefault(698);
obj = { message_id: messageId, error_message: errorMessage };
2026-07-20 16:05:17 +00:00
obj.track(AnalyticEvents.VOICE_MESSAGE_PLAYBACK_FAILED, obj);
};