Skip to content

Commit

Permalink
Fix issue with websocket connection after reregistering.
Browse files Browse the repository at this point in the history
Big shoutout to @jonahbeckford for the investigation here. Thanks!

Fixes #10939
Fixes #11095
  • Loading branch information
greyson-signal committed Mar 18, 2021
1 parent 713441d commit fb0243a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ public void onReceive(Context context, Intent intent) {
}, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
}

public synchronized void notifyRegistrationChanged() {
notifyAll();
}

public synchronized void addDecryptionDrainedListener(@NonNull Runnable listener) {
decryptionDrainedListeners.add(listener);
if (decryptionDrained) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.backup.BackupProtos;
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
import org.thoughtcrime.securesms.jobmanager.impl.SqlCipherMigrationConstraintObserver;
import org.thoughtcrime.securesms.keyvalue.SettingsValues;
import org.thoughtcrime.securesms.lock.RegistrationLockReminders;
Expand Down Expand Up @@ -919,6 +920,7 @@ public static boolean isPushRegistered(Context context) {
public static void setPushRegistered(Context context, boolean registered) {
Log.i(TAG, "Setting push registered: " + registered);
setBooleanPreference(context, REGISTERED_GCM_PREF, registered);
ApplicationDependencies.getIncomingMessageObserver().notifyRegistrationChanged();
}

public static boolean isShowInviteReminders(Context context) {
Expand Down

0 comments on commit fb0243a

Please sign in to comment.