mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Convert WebSocketStrategy.java -> WebSocketDrainer.kt
This commit is contained in:
committed by
Cody Henthorne
parent
b07d675bb4
commit
5fa9a27ee0
@@ -14,7 +14,7 @@ import org.thoughtcrime.securesms.MainActivity
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
|
||||
import org.thoughtcrime.securesms.jobs.PushNotificationReceiveJob
|
||||
import org.thoughtcrime.securesms.messages.WebSocketStrategy
|
||||
import org.thoughtcrime.securesms.messages.WebSocketDrainer
|
||||
import org.thoughtcrime.securesms.notifications.NotificationChannels
|
||||
import org.thoughtcrime.securesms.notifications.NotificationIds
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
@@ -140,7 +140,7 @@ object FcmFetchManager {
|
||||
|
||||
@JvmStatic
|
||||
fun retrieveMessages(context: Context): Boolean {
|
||||
val success = WebSocketStrategy.execute(WEBSOCKET_DRAIN_TIMEOUT)
|
||||
val success = WebSocketDrainer.blockUntilDrainedAndProcessed(WEBSOCKET_DRAIN_TIMEOUT)
|
||||
|
||||
if (success) {
|
||||
Log.i(TAG, "Successfully retrieved messages.")
|
||||
|
||||
@@ -12,10 +12,8 @@ import androidx.annotation.RequiresApi;
|
||||
import org.signal.core.util.concurrent.SignalExecutors;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.messages.WebSocketStrategy;
|
||||
import org.thoughtcrime.securesms.messages.WebSocketDrainer;
|
||||
import org.thoughtcrime.securesms.util.ServiceUtil;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
|
||||
/**
|
||||
* Pulls down messages. Used when we fail to pull down messages in {@link FcmReceiveService}.
|
||||
@@ -47,7 +45,7 @@ public class FcmJobService extends JobService {
|
||||
}
|
||||
|
||||
SignalExecutors.UNBOUNDED.execute(() -> {
|
||||
boolean success = WebSocketStrategy.execute();
|
||||
boolean success = WebSocketDrainer.blockUntilDrainedAndProcessed();
|
||||
|
||||
if (success) {
|
||||
Log.i(TAG, "Successfully retrieved messages.");
|
||||
|
||||
Reference in New Issue
Block a user