mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 18:33:39 +00:00
Handle case where GIF fetch fails
This commit is contained in:
parent
e5d82b325d
commit
df36d5e539
@ -946,14 +946,14 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
} else {
|
} else {
|
||||||
notifyTypingStoppedFromIncomingMessage(recipient, content.getSender(), content.getSenderDevice());
|
notifyTypingStoppedFromIncomingMessage(recipient, content.getSender(), content.getSenderDevice());
|
||||||
|
|
||||||
IncomingTextMessage textMessage = new IncomingTextMessage(Address.fromSerialized(content.getSender()),
|
IncomingTextMessage _textMessage = new IncomingTextMessage(Address.fromSerialized(content.getSender()),
|
||||||
content.getSenderDevice(),
|
content.getSenderDevice(),
|
||||||
message.getTimestamp(), body,
|
message.getTimestamp(), body,
|
||||||
message.getGroupInfo(),
|
message.getGroupInfo(),
|
||||||
message.getExpiresInSeconds() * 1000L,
|
message.getExpiresInSeconds() * 1000L,
|
||||||
content.isNeedsReceipt());
|
content.isNeedsReceipt());
|
||||||
|
|
||||||
textMessage = new IncomingEncryptedMessage(textMessage, body);
|
IncomingEncryptedMessage textMessage = new IncomingEncryptedMessage(_textMessage, body);
|
||||||
|
|
||||||
List<Link> urls = LinkPreviewUtil.findWhitelistedUrls(body);
|
List<Link> urls = LinkPreviewUtil.findWhitelistedUrls(body);
|
||||||
int urlCount = urls.size();
|
int urlCount = urls.size();
|
||||||
@ -992,12 +992,20 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
// TODO: Handle
|
// TODO: Handle
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO: Handle
|
handleTextMessage(message, textMessage, smsMessageId, messageServerIDOrNull);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
|
handleTextMessage(message, textMessage, smsMessageId, messageServerIDOrNull);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleTextMessage(@NonNull SignalServiceDataMessage message, @NonNull IncomingTextMessage textMessage, @NonNull Optional<Long> smsMessageId, @NonNull Optional<Long> messageServerIDOrNull) {
|
||||||
|
SmsDatabase database = DatabaseFactory.getSmsDatabase(context);
|
||||||
Optional<InsertResult> insertResult = database.insertMessageInbox(textMessage);
|
Optional<InsertResult> insertResult = database.insertMessageInbox(textMessage);
|
||||||
|
|
||||||
|
Long threadId;
|
||||||
if (insertResult.isPresent()) threadId = insertResult.get().getThreadId();
|
if (insertResult.isPresent()) threadId = insertResult.get().getThreadId();
|
||||||
else threadId = null;
|
else threadId = null;
|
||||||
|
|
||||||
@ -1011,8 +1019,6 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
MessageNotifier.updateNotification(context, threadId);
|
MessageNotifier.updateNotification(context, threadId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateGroupChatMessageServerID(Optional<Long> messageServerIDOrNull, Optional<InsertResult> insertResult) {
|
private void updateGroupChatMessageServerID(Optional<Long> messageServerIDOrNull, Optional<InsertResult> insertResult) {
|
||||||
if (insertResult.isPresent() && messageServerIDOrNull.isPresent()) {
|
if (insertResult.isPresent() && messageServerIDOrNull.isPresent()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user