mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-17 15:28:25 +00:00
Fix threading issue
This commit is contained in:
parent
97b25507d2
commit
fcb5cbb74d
@ -1558,7 +1558,7 @@
|
||||
<!-- New conversation activity -->
|
||||
<string name="activity_new_conversation_title">New Conversation</string>
|
||||
<string name="activity_new_conversation_public_key_edit_text_label">Public Key</string>
|
||||
<string name="activity_new_conversation_public_key_explanation">Enter the public key of the person you\'d like to securely message. They can share their public key with you by going into Loki Messenger\'s in-app settings and clicking "Share Public Key".</string>
|
||||
<string name="activity_new_conversation_public_key_explanation">Enter the public key of the person you\'d like to securely message. They can share their public key with you by going into Loki Messenger\'s in-app settings and clicking \"Share Public Key\".</string>
|
||||
<string name="activity_new_conversation_button_title">Next</string>
|
||||
<string name="activity_new_conversation_invalid_public_key_message">Invalid Public Key</string>
|
||||
<!-- Friend request view -->
|
||||
|
@ -5,6 +5,8 @@ import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.NotificationCompat;
|
||||
@ -911,14 +913,20 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
||||
}
|
||||
|
||||
private void sendBackgroundMessage(String contactHexEncodedPublicKey) {
|
||||
SignalServiceMessageSender messageSender = ApplicationContext.getInstance(context).communicationModule.provideSignalMessageSender();
|
||||
SignalServiceAddress address = new SignalServiceAddress(contactHexEncodedPublicKey);
|
||||
SignalServiceDataMessage message = new SignalServiceDataMessage(System.currentTimeMillis(), "");
|
||||
try {
|
||||
messageSender.sendMessage(0, address, Optional.absent(), message); // The message ID doesn't matter
|
||||
} catch (Exception e) {
|
||||
Log.d("Loki", "Failed to send background message to: " + contactHexEncodedPublicKey + ".");
|
||||
}
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
SignalServiceMessageSender messageSender = ApplicationContext.getInstance(context).communicationModule.provideSignalMessageSender();
|
||||
SignalServiceAddress address = new SignalServiceAddress(contactHexEncodedPublicKey);
|
||||
SignalServiceDataMessage message = new SignalServiceDataMessage(System.currentTimeMillis(), "");
|
||||
try {
|
||||
messageSender.sendMessage(0, address, Optional.absent(), message); // The message ID doesn't matter
|
||||
} catch (Exception e) {
|
||||
Log.d("Loki", "Failed to send background message to: " + contactHexEncodedPublicKey + ".");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private long handleSynchronizeSentTextMessage(@NonNull SentTranscriptMessage message)
|
||||
|
Loading…
x
Reference in New Issue
Block a user