From 4799c13816cb4345b1ea558ae29b702e331e6428 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Wed, 8 Jul 2020 17:05:26 +1000 Subject: [PATCH] Clean up ahead of protocol changes --- .../securesms/ApplicationContext.java | 30 +++++++++---------- .../securesms/jobs/PushMediaSendJob.java | 6 ++-- .../securesms/jobs/PushTextSendJob.java | 6 ++-- .../loki/api/BackgroundPollWorker.kt | 6 ++-- .../loki/api/LokiPushNotificationManager.kt | 4 +-- .../loki/api/PushNotificationService.kt | 4 +-- .../loki/database/LokiAPIDatabase.kt | 28 ++++++++--------- .../dialogs/LinkDeviceMasterModeDialog.kt | 4 +-- .../loki/protocol/ClosedGroupsProtocol.kt | 2 +- .../loki/shelved/LokiRSSFeedPoller.kt | 4 +-- .../OptimizedMessageNotifier.java | 10 +++---- 11 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/org/thoughtcrime/securesms/ApplicationContext.java b/src/org/thoughtcrime/securesms/ApplicationContext.java index b9f0b87e0a..9c346f5a20 100644 --- a/src/org/thoughtcrime/securesms/ApplicationContext.java +++ b/src/org/thoughtcrime/securesms/ApplicationContext.java @@ -95,14 +95,14 @@ import org.whispersystems.libsignal.logging.SignalProtocolLoggerProvider; import org.whispersystems.signalservice.api.messages.SignalServiceEnvelope; import org.whispersystems.signalservice.api.util.StreamDetails; import org.whispersystems.signalservice.internal.push.SignalServiceProtos; -import org.whispersystems.signalservice.loki.api.LokiAPI; -import org.whispersystems.signalservice.loki.api.LokiPoller; -import org.whispersystems.signalservice.loki.api.LokiPushNotificationAcknowledgement; -import org.whispersystems.signalservice.loki.api.LokiSwarmAPI; +import org.whispersystems.signalservice.loki.api.Poller; +import org.whispersystems.signalservice.loki.api.PushNotificationAcknowledgement; +import org.whispersystems.signalservice.loki.api.SnodeAPI; +import org.whispersystems.signalservice.loki.api.SwarmAPI; import org.whispersystems.signalservice.loki.api.fileserver.LokiFileServerAPI; import org.whispersystems.signalservice.loki.api.opengroups.LokiPublicChatAPI; -import org.whispersystems.signalservice.loki.api.p2p.LokiP2PAPI; -import org.whispersystems.signalservice.loki.api.p2p.LokiP2PAPIDelegate; +import org.whispersystems.signalservice.loki.api.shelved.p2p.LokiP2PAPI; +import org.whispersystems.signalservice.loki.api.shelved.p2p.LokiP2PAPIDelegate; import org.whispersystems.signalservice.loki.database.LokiAPIDatabaseProtocol; import org.whispersystems.signalservice.loki.protocol.friendrequests.FriendRequestProtocol; import org.whispersystems.signalservice.loki.protocol.mentions.MentionsManager; @@ -151,7 +151,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc // Loki public MessageNotifier messageNotifier = null; - public LokiPoller lokiPoller = null; + public Poller lokiPoller = null; public LokiPublicChatManager lokiPublicChatManager = null; private LokiPublicChatAPI lokiPublicChatAPI = null; public Broadcaster broadcaster = null; @@ -184,8 +184,8 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc String userPublicKey = TextSecurePreferences.getLocalNumber(this); LokiSessionResetImplementation sessionResetImpl = new LokiSessionResetImplementation(this); if (userPublicKey != null) { - LokiSwarmAPI.Companion.configureIfNeeded(apiDB); - LokiAPI.Companion.configureIfNeeded(userPublicKey, apiDB, broadcaster); + SwarmAPI.Companion.configureIfNeeded(apiDB); + SnodeAPI.Companion.configureIfNeeded(userPublicKey, apiDB, broadcaster); FriendRequestProtocol.Companion.configureIfNeeded(apiDB, userPublicKey); MentionsManager.Companion.configureIfNeeded(userPublicKey, threadDB, userDB); SessionMetaProtocol.Companion.configureIfNeeded(apiDB, userPublicKey); @@ -194,7 +194,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc MultiDeviceProtocol.Companion.configureIfNeeded(apiDB); SessionManagementProtocol.Companion.configureIfNeeded(sessionResetImpl, threadDB, this); setUpP2PAPIIfNeeded(); - LokiPushNotificationAcknowledgement.Companion.configureIfNeeded(BuildConfig.DEBUG); + PushNotificationAcknowledgement.Companion.configureIfNeeded(BuildConfig.DEBUG); if (setUpStorageAPIIfNeeded()) { if (userPublicKey != null) { Set deviceLinks = DatabaseFactory.getLokiAPIDatabase(this).getDeviceLinks(userPublicKey); @@ -493,15 +493,15 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc String userPublicKey = TextSecurePreferences.getLocalNumber(this); if (userPublicKey == null) return; if (lokiPoller != null) { - LokiAPI.shared.setUserHexEncodedPublicKey(userPublicKey); - lokiPoller.setUserHexEncodedPublicKey(userPublicKey); + SnodeAPI.shared.setUserPublicKey(userPublicKey); + lokiPoller.setUserPublicKey(userPublicKey); return; } LokiAPIDatabase apiDB = DatabaseFactory.getLokiAPIDatabase(this); Context context = this; - LokiSwarmAPI.Companion.configureIfNeeded(apiDB); - LokiAPI.Companion.configureIfNeeded(userPublicKey, apiDB, broadcaster); - lokiPoller = new LokiPoller(userPublicKey, apiDB, protos -> { + SwarmAPI.Companion.configureIfNeeded(apiDB); + SnodeAPI.Companion.configureIfNeeded(userPublicKey, apiDB, broadcaster); + lokiPoller = new Poller(userPublicKey, apiDB, protos -> { for (SignalServiceProtos.Envelope proto : protos) { new PushContentReceiveJob(context).processEnvelope(new SignalServiceEnvelope(proto), false); } diff --git a/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java index 3779252021..d36fd517a5 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushMediaSendJob.java @@ -44,7 +44,7 @@ import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSy import org.whispersystems.signalservice.api.messages.shared.SharedContact; import org.whispersystems.signalservice.api.push.SignalServiceAddress; import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException; -import org.whispersystems.signalservice.loki.api.LokiAPI; +import org.whispersystems.signalservice.loki.api.SnodeAPI; import org.whispersystems.signalservice.loki.protocol.meta.SessionMetaProtocol; import java.io.FileNotFoundException; @@ -231,7 +231,7 @@ public class PushMediaSendJob extends PushSendJob implements InjectableType { database.addMismatchedIdentity(messageId, Address.fromSerialized(uie.getE164Number()), uie.getIdentityKey()); database.markAsSentFailed(messageId); } - } catch (LokiAPI.Error e) { + } catch (SnodeAPI.Error e) { Log.d("Loki", "Couldn't send message due to error: " + e.getDescription()); if (messageId >= 0) { LokiMessageDatabase lokiMessageDatabase = DatabaseFactory.getLokiMessageDatabase(context); @@ -257,7 +257,7 @@ public class PushMediaSendJob extends PushSendJob implements InjectableType { private boolean deliver(OutgoingMediaMessage message) throws RetryLaterException, InsecureFallbackApprovalException, UntrustedIdentityException, - UndeliverableMessageException, LokiAPI.Error + UndeliverableMessageException, SnodeAPI.Error { try { Recipient recipient = Recipient.from(context, destination, false); diff --git a/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java b/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java index fbb3a068b8..74f33f457f 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushTextSendJob.java @@ -32,7 +32,7 @@ import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage; import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage; import org.whispersystems.signalservice.api.push.SignalServiceAddress; import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException; -import org.whispersystems.signalservice.loki.api.LokiAPI; +import org.whispersystems.signalservice.loki.api.SnodeAPI; import org.whispersystems.signalservice.loki.protocol.meta.SessionMetaProtocol; import java.io.IOException; @@ -173,7 +173,7 @@ public class PushTextSendJob extends PushSendJob implements InjectableType { database.markAsSentFailed(record.getId()); database.markAsPush(record.getId()); } - } catch (LokiAPI.Error e) { + } catch (SnodeAPI.Error e) { Log.d("Loki", "Couldn't send message due to error: " + e.getDescription()); if (messageId >= 0) { LokiMessageDatabase lokiMessageDatabase = DatabaseFactory.getLokiMessageDatabase(context); @@ -204,7 +204,7 @@ public class PushTextSendJob extends PushSendJob implements InjectableType { } private boolean deliver(SmsMessageRecord message) - throws UntrustedIdentityException, InsecureFallbackApprovalException, RetryLaterException, LokiAPI.Error + throws UntrustedIdentityException, InsecureFallbackApprovalException, RetryLaterException, SnodeAPI.Error { try { Recipient recipient = Recipient.from(context, destination, false); diff --git a/src/org/thoughtcrime/securesms/loki/api/BackgroundPollWorker.kt b/src/org/thoughtcrime/securesms/loki/api/BackgroundPollWorker.kt index 7265083dc5..8ae4cb0314 100644 --- a/src/org/thoughtcrime/securesms/loki/api/BackgroundPollWorker.kt +++ b/src/org/thoughtcrime/securesms/loki/api/BackgroundPollWorker.kt @@ -9,7 +9,7 @@ import org.thoughtcrime.securesms.jobs.PushContentReceiveJob import org.thoughtcrime.securesms.service.PersistentAlarmManagerListener import org.thoughtcrime.securesms.util.TextSecurePreferences import org.whispersystems.signalservice.api.messages.SignalServiceEnvelope -import org.whispersystems.signalservice.loki.api.LokiAPI +import org.whispersystems.signalservice.loki.api.SnodeAPI import java.util.concurrent.TimeUnit class BackgroundPollWorker : PersistentAlarmManagerListener() { @@ -35,8 +35,8 @@ class BackgroundPollWorker : PersistentAlarmManagerListener() { try { val applicationContext = context.applicationContext as ApplicationContext val broadcaster = applicationContext.broadcaster - LokiAPI.configureIfNeeded(userPublicKey, lokiAPIDatabase, broadcaster) - LokiAPI.shared.getMessages().map { messages -> + SnodeAPI.configureIfNeeded(userPublicKey, lokiAPIDatabase, broadcaster) + SnodeAPI.shared.getMessages().map { messages -> messages.forEach { PushContentReceiveJob(context).processEnvelope(SignalServiceEnvelope(it), false) } diff --git a/src/org/thoughtcrime/securesms/loki/api/LokiPushNotificationManager.kt b/src/org/thoughtcrime/securesms/loki/api/LokiPushNotificationManager.kt index 1180d0e68b..a51ed929bb 100644 --- a/src/org/thoughtcrime/securesms/loki/api/LokiPushNotificationManager.kt +++ b/src/org/thoughtcrime/securesms/loki/api/LokiPushNotificationManager.kt @@ -5,14 +5,14 @@ import okhttp3.* import org.thoughtcrime.securesms.util.TextSecurePreferences import org.whispersystems.libsignal.logging.Log import org.whispersystems.signalservice.internal.util.JsonUtil -import org.whispersystems.signalservice.loki.api.LokiPushNotificationAcknowledgement +import org.whispersystems.signalservice.loki.api.PushNotificationAcknowledgement import java.io.IOException object LokiPushNotificationManager { private val connection = OkHttpClient() private val server by lazy { - LokiPushNotificationAcknowledgement.shared.server + PushNotificationAcknowledgement.shared.server } private const val tokenExpirationInterval = 12 * 60 * 60 * 1000 diff --git a/src/org/thoughtcrime/securesms/loki/api/PushNotificationService.kt b/src/org/thoughtcrime/securesms/loki/api/PushNotificationService.kt index bdc55d10dc..0e2522b323 100644 --- a/src/org/thoughtcrime/securesms/loki/api/PushNotificationService.kt +++ b/src/org/thoughtcrime/securesms/loki/api/PushNotificationService.kt @@ -7,7 +7,7 @@ import org.thoughtcrime.securesms.util.TextSecurePreferences import org.whispersystems.libsignal.logging.Log import org.whispersystems.signalservice.api.messages.SignalServiceEnvelope import org.whispersystems.signalservice.internal.util.Base64 -import org.whispersystems.signalservice.loki.api.LokiMessageWrapper +import org.whispersystems.signalservice.loki.api.MessageWrapper class PushNotificationService : FirebaseMessagingService() { @@ -23,7 +23,7 @@ class PushNotificationService : FirebaseMessagingService() { val data = base64EncodedData?.let { Base64.decode(it) } if (data != null) { try { - val envelope = LokiMessageWrapper.unwrap(data) + val envelope = MessageWrapper.unwrap(data) PushContentReceiveJob(this).processEnvelope(SignalServiceEnvelope(envelope), true) } catch (e: Exception) { Log.d("Loki", "Failed to unwrap data for message.") diff --git a/src/org/thoughtcrime/securesms/loki/database/LokiAPIDatabase.kt b/src/org/thoughtcrime/securesms/loki/database/LokiAPIDatabase.kt index 5f953a4b7b..ca55870188 100644 --- a/src/org/thoughtcrime/securesms/loki/database/LokiAPIDatabase.kt +++ b/src/org/thoughtcrime/securesms/loki/database/LokiAPIDatabase.kt @@ -8,7 +8,7 @@ import org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper import org.thoughtcrime.securesms.loki.utilities.* import org.thoughtcrime.securesms.util.Base64 import org.thoughtcrime.securesms.util.TextSecurePreferences -import org.whispersystems.signalservice.loki.api.LokiAPITarget +import org.whispersystems.signalservice.loki.api.Snode import org.whispersystems.signalservice.loki.database.LokiAPIDatabaseProtocol import org.whispersystems.signalservice.loki.protocol.multidevice.DeviceLink @@ -77,7 +77,7 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database( @JvmStatic val createSessionRequestTimestampCacheCommand = "CREATE TABLE $sessionRequestTimestampCache ($publicKey STRING PRIMARY KEY, $timestamp INTEGER DEFAULT 0);" } - override fun getSnodePool(): Set { + override fun getSnodePool(): Set { val database = databaseHelper.readableDatabase return database.get(snodePoolCache, "${Companion.dummyKey} = ?", wrap("dummy_key")) { cursor -> val snodePoolAsString = cursor.getString(cursor.getColumnIndexOrThrow(snodePool)) @@ -87,12 +87,12 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database( val port = components.getOrNull(1)?.toIntOrNull() ?: return@mapNotNull null val ed25519Key = components.getOrNull(2) ?: return@mapNotNull null val x25519Key = components.getOrNull(3) ?: return@mapNotNull null - LokiAPITarget(address, port, LokiAPITarget.KeySet(ed25519Key, x25519Key)) + Snode(address, port, Snode.KeySet(ed25519Key, x25519Key)) } }?.toSet() ?: setOf() } - override fun setSnodePool(newValue: Set) { + override fun setSnodePool(newValue: Set) { val database = databaseHelper.writableDatabase val snodePoolAsString = newValue.joinToString(", ") { snode -> var string = "${snode.address}-${snode.port}" @@ -106,9 +106,9 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database( database.insertOrUpdate(snodePoolCache, row, "${Companion.dummyKey} = ?", wrap("dummy_key")) } - override fun getOnionRequestPaths(): List> { + override fun getOnionRequestPaths(): List> { val database = databaseHelper.readableDatabase - fun get(indexPath: String): LokiAPITarget? { + fun get(indexPath: String): Snode? { return database.get(onionRequestPathCache, "${Companion.indexPath} = ?", wrap(indexPath)) { cursor -> val snodeAsString = cursor.getString(cursor.getColumnIndexOrThrow(snode)) val components = snodeAsString.split("-") @@ -117,7 +117,7 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database( val ed25519Key = components.getOrNull(2) val x25519Key = components.getOrNull(3) if (port != null && ed25519Key != null && x25519Key != null) { - LokiAPITarget(address, port, LokiAPITarget.KeySet(ed25519Key, x25519Key)) + Snode(address, port, Snode.KeySet(ed25519Key, x25519Key)) } else { null } @@ -139,7 +139,7 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database( delete("1-1"); delete("1-2") } - override fun setOnionRequestPaths(newValue: List>) { + override fun setOnionRequestPaths(newValue: List>) { // FIXME: This is a bit of a dirty approach that assumes 2 paths of length 3 each. We should do better than this. if (newValue.count() != 2) { return } val path0 = newValue[0] @@ -147,7 +147,7 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database( if (path0.count() != 3 || path1.count() != 3) { return } Log.d("Loki", "Persisting onion request paths to database.") val database = databaseHelper.writableDatabase - fun set(indexPath: String ,snode: LokiAPITarget) { + fun set(indexPath: String ,snode: Snode) { var snodeAsString = "${snode.address}-${snode.port}" val keySet = snode.publicKeySet if (keySet != null) { @@ -161,7 +161,7 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database( set("1-1", path1[1]); set("1-2", path1[2]) } - override fun getSwarm(hexEncodedPublicKey: String): Set? { + override fun getSwarm(hexEncodedPublicKey: String): Set? { val database = databaseHelper.readableDatabase return database.get(swarmCache, "${Companion.hexEncodedPublicKey} = ?", wrap(hexEncodedPublicKey)) { cursor -> val swarmAsString = cursor.getString(cursor.getColumnIndexOrThrow(swarm)) @@ -171,12 +171,12 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database( val port = components.getOrNull(1)?.toIntOrNull() ?: return@mapNotNull null val ed25519Key = components.getOrNull(2) ?: return@mapNotNull null val x25519Key = components.getOrNull(3) ?: return@mapNotNull null - LokiAPITarget(address, port, LokiAPITarget.KeySet(ed25519Key, x25519Key)) + Snode(address, port, Snode.KeySet(ed25519Key, x25519Key)) } }?.toSet() } - override fun setSwarm(hexEncodedPublicKey: String, newValue: Set) { + override fun setSwarm(hexEncodedPublicKey: String, newValue: Set) { val database = databaseHelper.writableDatabase val swarmAsString = newValue.joinToString(", ") { target -> var string = "${target.address}-${target.port}" @@ -190,14 +190,14 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database( database.insertOrUpdate(swarmCache, row, "${Companion.hexEncodedPublicKey} = ?", wrap(hexEncodedPublicKey)) } - override fun getLastMessageHashValue(target: LokiAPITarget): String? { + override fun getLastMessageHashValue(target: Snode): String? { val database = databaseHelper.readableDatabase return database.get(lastMessageHashValueCache, "${Companion.target} = ?", wrap(target.address)) { cursor -> cursor.getString(cursor.getColumnIndexOrThrow(lastMessageHashValue)) } } - override fun setLastMessageHashValue(target: LokiAPITarget, newValue: String) { + override fun setLastMessageHashValue(target: Snode, newValue: String) { val database = databaseHelper.writableDatabase val row = wrap(mapOf(Companion.target to target.address, lastMessageHashValue to newValue)) database.insertOrUpdate(lastMessageHashValueCache, row, "${Companion.target} = ?", wrap(target.address)) diff --git a/src/org/thoughtcrime/securesms/loki/dialogs/LinkDeviceMasterModeDialog.kt b/src/org/thoughtcrime/securesms/loki/dialogs/LinkDeviceMasterModeDialog.kt index ab899c717c..019160b674 100644 --- a/src/org/thoughtcrime/securesms/loki/dialogs/LinkDeviceMasterModeDialog.kt +++ b/src/org/thoughtcrime/securesms/loki/dialogs/LinkDeviceMasterModeDialog.kt @@ -21,7 +21,7 @@ import org.thoughtcrime.securesms.loki.utilities.QRCodeUtilities import org.thoughtcrime.securesms.loki.utilities.toPx import org.thoughtcrime.securesms.util.TextSecurePreferences import org.thoughtcrime.securesms.util.Util -import org.whispersystems.signalservice.loki.api.LokiAPI +import org.whispersystems.signalservice.loki.api.SnodeAPI import org.whispersystems.signalservice.loki.api.fileserver.LokiFileServerAPI import org.whispersystems.signalservice.loki.crypto.MnemonicCodec import org.whispersystems.signalservice.loki.protocol.multidevice.DeviceLink @@ -84,7 +84,7 @@ class LinkDeviceMasterModeDialog : DialogFragment(), DeviceLinkingSessionListene contentView.cancelButton.visibility = View.GONE contentView.authorizeButton.visibility = View.GONE } - LokiFileServerAPI.shared.addDeviceLink(deviceLink).bind(LokiAPI.sharedContext) { + LokiFileServerAPI.shared.addDeviceLink(deviceLink).bind(SnodeAPI.sharedContext) { MultiDeviceProtocol.signAndSendDeviceLinkMessage(context!!, deviceLink) }.success { TextSecurePreferences.setMultiDevice(context!!, true) diff --git a/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt b/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt index f18ddab0cf..8e7e84111c 100644 --- a/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt +++ b/src/org/thoughtcrime/securesms/loki/protocol/ClosedGroupsProtocol.kt @@ -17,7 +17,7 @@ import org.whispersystems.libsignal.SignalProtocolAddress import org.whispersystems.signalservice.api.messages.SignalServiceContent import org.whispersystems.signalservice.api.messages.SignalServiceGroup import org.whispersystems.signalservice.api.push.SignalServiceAddress -import org.whispersystems.signalservice.loki.api.LokiAPI +import org.whispersystems.signalservice.loki.api.SnodeAPI import org.whispersystems.signalservice.loki.api.fileserver.LokiFileServerAPI import org.whispersystems.signalservice.loki.protocol.multidevice.MultiDeviceProtocol import java.util.* diff --git a/src/org/thoughtcrime/securesms/loki/shelved/LokiRSSFeedPoller.kt b/src/org/thoughtcrime/securesms/loki/shelved/LokiRSSFeedPoller.kt index 18e3c6e307..7096629119 100644 --- a/src/org/thoughtcrime/securesms/loki/shelved/LokiRSSFeedPoller.kt +++ b/src/org/thoughtcrime/securesms/loki/shelved/LokiRSSFeedPoller.kt @@ -14,8 +14,8 @@ import org.whispersystems.signalservice.api.messages.SignalServiceContent import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage import org.whispersystems.signalservice.api.messages.SignalServiceGroup import org.whispersystems.signalservice.api.push.SignalServiceAddress -import org.whispersystems.signalservice.loki.api.rssfeeds.LokiRSSFeed -import org.whispersystems.signalservice.loki.api.rssfeeds.LokiRSSFeedProxy +import org.whispersystems.signalservice.loki.api.shelved.rssfeeds.LokiRSSFeed +import org.whispersystems.signalservice.loki.api.shelved.rssfeeds.LokiRSSFeedProxy import java.text.SimpleDateFormat import java.util.regex.Pattern diff --git a/src/org/thoughtcrime/securesms/notifications/OptimizedMessageNotifier.java b/src/org/thoughtcrime/securesms/notifications/OptimizedMessageNotifier.java index 46e718359a..0a6d1af2c7 100644 --- a/src/org/thoughtcrime/securesms/notifications/OptimizedMessageNotifier.java +++ b/src/org/thoughtcrime/securesms/notifications/OptimizedMessageNotifier.java @@ -9,7 +9,7 @@ import org.thoughtcrime.securesms.ApplicationContext; import org.thoughtcrime.securesms.loki.api.LokiPublicChatManager; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.util.Debouncer; -import org.whispersystems.signalservice.loki.api.LokiPoller; +import org.whispersystems.signalservice.loki.api.Poller; import java.util.concurrent.TimeUnit; @@ -39,7 +39,7 @@ public class OptimizedMessageNotifier implements MessageNotifier { @Override public void updateNotification(@NonNull Context context) { - LokiPoller lokiPoller = ApplicationContext.getInstance(context).lokiPoller; + Poller lokiPoller = ApplicationContext.getInstance(context).lokiPoller; LokiPublicChatManager lokiPublicChatManager = ApplicationContext.getInstance(context).lokiPublicChatManager; Boolean isCaughtUp = false; if (lokiPoller != null && lokiPublicChatManager != null) { @@ -55,7 +55,7 @@ public class OptimizedMessageNotifier implements MessageNotifier { @Override public void updateNotification(@NonNull Context context, long threadId) { - LokiPoller lokiPoller = ApplicationContext.getInstance(context).lokiPoller; + Poller lokiPoller = ApplicationContext.getInstance(context).lokiPoller; LokiPublicChatManager lokiPublicChatManager = ApplicationContext.getInstance(context).lokiPublicChatManager; Boolean isCaughtUp = false; if (lokiPoller != null && lokiPublicChatManager != null) { @@ -71,7 +71,7 @@ public class OptimizedMessageNotifier implements MessageNotifier { @Override public void updateNotification(@NonNull Context context, long threadId, boolean signal) { - LokiPoller lokiPoller = ApplicationContext.getInstance(context).lokiPoller; + Poller lokiPoller = ApplicationContext.getInstance(context).lokiPoller; LokiPublicChatManager lokiPublicChatManager = ApplicationContext.getInstance(context).lokiPublicChatManager; Boolean isCaughtUp = false; if (lokiPoller != null && lokiPublicChatManager != null) { @@ -87,7 +87,7 @@ public class OptimizedMessageNotifier implements MessageNotifier { @Override public void updateNotification(@android.support.annotation.NonNull Context context, boolean signal, int reminderCount) { - LokiPoller lokiPoller = ApplicationContext.getInstance(context).lokiPoller; + Poller lokiPoller = ApplicationContext.getInstance(context).lokiPoller; LokiPublicChatManager lokiPublicChatManager = ApplicationContext.getInstance(context).lokiPublicChatManager; Boolean isCaughtUp = false; if (lokiPoller != null && lokiPublicChatManager != null) {