diff --git a/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java b/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java index 4126f9f8f8..dae5b71a9a 100644 --- a/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/conversation/ConversationActivity.java @@ -226,6 +226,7 @@ import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage; import org.whispersystems.signalservice.api.push.SignalServiceAddress; import org.whispersystems.signalservice.loki.messaging.LokiMessageFriendRequestStatus; import org.whispersystems.signalservice.loki.messaging.LokiThreadFriendRequestStatus; +import org.whispersystems.signalservice.loki.utilities.Analytics; import java.io.IOException; import java.text.SimpleDateFormat; @@ -392,6 +393,16 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity }); } }); + + if (this.recipient.isGroupRecipient()) { + if (this.recipient.getName().equals("Loki Public Chat")) { + Analytics.Companion.getShared().track("Loki Public Chat Opened"); + } else { + Analytics.Companion.getShared().track("RSS Feed Opened"); + } + } else { + Analytics.Companion.getShared().track("Conversation Opened"); + } } @Override diff --git a/src/org/thoughtcrime/securesms/loki/NewConversationActivity.kt b/src/org/thoughtcrime/securesms/loki/NewConversationActivity.kt index b4e218495d..e67efcdde7 100644 --- a/src/org/thoughtcrime/securesms/loki/NewConversationActivity.kt +++ b/src/org/thoughtcrime/securesms/loki/NewConversationActivity.kt @@ -16,6 +16,7 @@ import org.thoughtcrime.securesms.qr.ScanListener import org.thoughtcrime.securesms.recipients.Recipient import org.thoughtcrime.securesms.util.DynamicTheme import org.thoughtcrime.securesms.util.TextSecurePreferences +import org.whispersystems.signalservice.loki.utilities.Analytics import org.whispersystems.signalservice.loki.utilities.PublicKeyValidation class NewConversationActivity : PassphraseRequiredActionBarActivity(), ScanListener { @@ -60,6 +61,7 @@ class NewConversationActivity : PassphraseRequiredActionBarActivity(), ScanListe } override fun onQrDataFound(hexEncodedPublicKey: String) { + Analytics.shared.track("QR Code Scanned") startNewConversationIfPossible(hexEncodedPublicKey) } @@ -75,6 +77,7 @@ class NewConversationActivity : PassphraseRequiredActionBarActivity(), ScanListe val existingThread = DatabaseFactory.getThreadDatabase(this).getThreadIdIfExistsFor(contact) intent.putExtra(ConversationActivity.THREAD_ID_EXTRA, existingThread) intent.putExtra(ConversationActivity.DISTRIBUTION_TYPE_EXTRA, ThreadDatabase.DistributionTypes.DEFAULT) + Analytics.shared.track("New Conversation Started") startActivity(intent) finish() } diff --git a/src/org/thoughtcrime/securesms/loki/SeedActivity.kt b/src/org/thoughtcrime/securesms/loki/SeedActivity.kt index b9475ea207..1522d9d2f7 100644 --- a/src/org/thoughtcrime/securesms/loki/SeedActivity.kt +++ b/src/org/thoughtcrime/securesms/loki/SeedActivity.kt @@ -22,6 +22,7 @@ import org.thoughtcrime.securesms.util.TextSecurePreferences import org.whispersystems.curve25519.Curve25519 import org.whispersystems.libsignal.util.KeyHelper import org.whispersystems.signalservice.loki.crypto.MnemonicCodec +import org.whispersystems.signalservice.loki.utilities.Analytics import org.whispersystems.signalservice.loki.utilities.hexEncodedPublicKey import java.io.File import java.io.FileOutputStream @@ -162,6 +163,10 @@ class SeedActivity : BaseActionBarActivity() { val application = ApplicationContext.getInstance(this) application.setUpP2PAPI() application.startLongPollingIfNeeded() + when (mode) { + Mode.Register -> Analytics.shared.track("Seed Created") + Mode.Restore -> Analytics.shared.track("Seed Restored") + } startActivity(Intent(this, ConversationListActivity::class.java)) finish() }