mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Wrapped envelope handing code inside a try-catch.
This commit is contained in:
parent
c25e0fded9
commit
050849d302
@ -25,22 +25,26 @@ public abstract class PushReceivedJob extends BaseJob {
|
|||||||
|
|
||||||
public void processEnvelope(@NonNull SignalServiceEnvelope envelope) {
|
public void processEnvelope(@NonNull SignalServiceEnvelope envelope) {
|
||||||
synchronized (RECEIVE_LOCK) {
|
synchronized (RECEIVE_LOCK) {
|
||||||
if (envelope.hasSource()) {
|
try {
|
||||||
Address source = Address.fromExternal(context, envelope.getSource());
|
if (envelope.hasSource()) {
|
||||||
Recipient recipient = Recipient.from(context, source, false);
|
Address source = Address.fromExternal(context, envelope.getSource());
|
||||||
|
Recipient recipient = Recipient.from(context, source, false);
|
||||||
|
|
||||||
if (!isActiveNumber(recipient)) {
|
if (!isActiveNumber(recipient)) {
|
||||||
DatabaseFactory.getRecipientDatabase(context).setRegistered(recipient, RecipientDatabase.RegisteredState.REGISTERED);
|
DatabaseFactory.getRecipientDatabase(context).setRegistered(recipient, RecipientDatabase.RegisteredState.REGISTERED);
|
||||||
ApplicationContext.getInstance(context).getJobManager().add(new DirectoryRefreshJob(recipient, false));
|
ApplicationContext.getInstance(context).getJobManager().add(new DirectoryRefreshJob(recipient, false));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (envelope.isReceipt()) {
|
if (envelope.isReceipt()) {
|
||||||
handleReceipt(envelope);
|
handleReceipt(envelope);
|
||||||
} else if (envelope.isPreKeySignalMessage() || envelope.isSignalMessage() || envelope.isUnidentifiedSender() || envelope.isFriendRequest()) {
|
} else if (envelope.isPreKeySignalMessage() || envelope.isSignalMessage() || envelope.isUnidentifiedSender() || envelope.isFriendRequest()) {
|
||||||
handleMessage(envelope);
|
handleMessage(envelope);
|
||||||
} else {
|
} else {
|
||||||
Log.w(TAG, "Received envelope of unknown type: " + envelope.getType());
|
Log.w(TAG, "Received envelope of unknown type: " + envelope.getType());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.d("Loki", "Failed to process envelope: " + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user