mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 17:27:45 +00:00
Clean
This commit is contained in:
parent
e109df7525
commit
869c06e71a
@ -744,17 +744,9 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
Optional<List<Contact>> sharedContacts = getContacts(message.getSharedContacts());
|
Optional<List<Contact>> sharedContacts = getContacts(message.getSharedContacts());
|
||||||
Optional<List<LinkPreview>> linkPreviews = getLinkPreviews(message.getPreviews(), message.getBody().or(""));
|
Optional<List<LinkPreview>> linkPreviews = getLinkPreviews(message.getPreviews(), message.getBody().or(""));
|
||||||
Optional<Attachment> sticker = getStickerAttachment(message.getSticker());
|
Optional<Attachment> sticker = getStickerAttachment(message.getSticker());
|
||||||
IncomingMediaMessage mediaMessage = new IncomingMediaMessage(Address.fromExternal(context, content.getSender()),
|
IncomingMediaMessage mediaMessage = new IncomingMediaMessage(Address.fromExternal(context, content.getSender()), message.getTimestamp(), -1,
|
||||||
message.getTimestamp(), -1,
|
message.getExpiresInSeconds() * 1000L, false, content.isNeedsReceipt(), message.getBody(), message.getGroupInfo(), message.getAttachments(),
|
||||||
message.getExpiresInSeconds() * 1000L, false,
|
quote, sharedContacts, linkPreviews, sticker);
|
||||||
content.isNeedsReceipt(),
|
|
||||||
message.getBody(),
|
|
||||||
message.getGroupInfo(),
|
|
||||||
message.getAttachments(),
|
|
||||||
quote,
|
|
||||||
sharedContacts,
|
|
||||||
linkPreviews,
|
|
||||||
sticker);
|
|
||||||
|
|
||||||
if (linkPreviews.isPresent()) {
|
if (linkPreviews.isPresent()) {
|
||||||
int linkPreviewCount = linkPreviews.get().size();
|
int linkPreviewCount = linkPreviews.get().size();
|
||||||
@ -774,7 +766,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
try {
|
try {
|
||||||
handleMediaMessage(content, mediaMessage, smsMessageId);
|
handleMediaMessage(content, mediaMessage, smsMessageId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Do nothing
|
// TODO: Handle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@ -958,17 +950,9 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
List<Link> urls = LinkPreviewUtil.findWhitelistedUrls(body);
|
List<Link> urls = LinkPreviewUtil.findWhitelistedUrls(body);
|
||||||
int urlCount = urls.size();
|
int urlCount = urls.size();
|
||||||
if (urlCount != 0) {
|
if (urlCount != 0) {
|
||||||
IncomingMediaMessage mediaMessage = new IncomingMediaMessage(Address.fromExternal(context, content.getSender()),
|
IncomingMediaMessage mediaMessage = new IncomingMediaMessage(Address.fromExternal(context, content.getSender()), message.getTimestamp(), -1,
|
||||||
message.getTimestamp(), -1,
|
message.getExpiresInSeconds() * 1000L, false, content.isNeedsReceipt(), message.getBody(), message.getGroupInfo(), message.getAttachments(),
|
||||||
message.getExpiresInSeconds() * 1000L, false,
|
Optional.absent(), Optional.absent(), Optional.of(new ArrayList<>()), Optional.absent());
|
||||||
content.isNeedsReceipt(),
|
|
||||||
message.getBody(),
|
|
||||||
message.getGroupInfo(),
|
|
||||||
message.getAttachments(),
|
|
||||||
Optional.absent(),
|
|
||||||
Optional.absent(),
|
|
||||||
Optional.of(new ArrayList<>()),
|
|
||||||
Optional.absent());
|
|
||||||
LinkPreviewRepository lpr = new LinkPreviewRepository(context);
|
LinkPreviewRepository lpr = new LinkPreviewRepository(context);
|
||||||
final int[] count = { 0 };
|
final int[] count = { 0 };
|
||||||
for (Link url : urls) {
|
for (Link url : urls) {
|
||||||
@ -976,14 +960,12 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
int c = count[0];
|
int c = count[0];
|
||||||
c = c + 1;
|
c = c + 1;
|
||||||
count[0] = c;
|
count[0] = c;
|
||||||
if (lp.isPresent()) {
|
if (lp.isPresent()) { mediaMessage.getLinkPreviews().add(lp.get()); }
|
||||||
mediaMessage.getLinkPreviews().add(lp.get());
|
|
||||||
}
|
|
||||||
if (c == urlCount) {
|
if (c == urlCount) {
|
||||||
try {
|
try {
|
||||||
handleMediaMessage(content, mediaMessage, smsMessageId);
|
handleMediaMessage(content, mediaMessage, smsMessageId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Do nothing
|
// TODO: Handle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user