mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Merge pull request #91 from loki-project/robustness
Handle Clock Out of Sync Issue
This commit is contained in:
commit
24116bc7cb
@ -404,6 +404,15 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
registerMessageStatusObserver("sendingMessage");
|
||||
registerMessageStatusObserver("messageSent");
|
||||
registerMessageStatusObserver("messageFailed");
|
||||
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Toast.makeText(ConversationActivity.this, "Your clock is out of sync with the service node network.", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
};
|
||||
broadcastReceivers.add(broadcastReceiver);
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(broadcastReceiver, new IntentFilter("clockOutOfSync"));
|
||||
|
||||
initializeReceivers();
|
||||
initializeActionBar();
|
||||
|
@ -6,6 +6,11 @@ import android.support.v4.content.LocalBroadcastManager
|
||||
|
||||
class Broadcaster(private val context: Context) : org.whispersystems.signalservice.loki.utilities.Broadcaster {
|
||||
|
||||
override fun broadcast(event: String) {
|
||||
val intent = Intent(event)
|
||||
LocalBroadcastManager.getInstance(context).sendBroadcast(intent)
|
||||
}
|
||||
|
||||
override fun broadcast(event: String, long: Long) {
|
||||
val intent = Intent(event)
|
||||
intent.putExtra("long", long)
|
||||
|
Loading…
Reference in New Issue
Block a user