mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-11 18:07:41 +00:00
clean up stickers
This commit is contained in:
@@ -274,7 +274,6 @@ public class PushGroupSendJob extends PushSendJob implements InjectableType {
|
||||
String groupId = address.toGroupString();
|
||||
Optional<byte[]> profileKey = getProfileKey(message.getRecipient());
|
||||
Optional<Quote> quote = getQuoteFor(message);
|
||||
Optional<SignalServiceDataMessage.Sticker> sticker = getStickerFor(message);
|
||||
List<SharedContact> sharedContacts = getSharedContactsFor(message);
|
||||
List<Preview> previews = getPreviewsFor(message);
|
||||
List<Attachment> attachments = Stream.of(message.getAttachments()).filterNot(Attachment::isSticker).toList();
|
||||
|
@@ -212,26 +212,6 @@ public abstract class PushSendJob extends SendJob {
|
||||
return Optional.of(new SignalServiceDataMessage.Quote(quoteId, new SignalServiceAddress(quoteAuthor.serialize()), quoteBody, quoteAttachments));
|
||||
}
|
||||
|
||||
protected Optional<SignalServiceDataMessage.Sticker> getStickerFor(OutgoingMediaMessage message) {
|
||||
Attachment stickerAttachment = Stream.of(message.getAttachments()).filter(Attachment::isSticker).findFirst().orElse(null);
|
||||
|
||||
if (stickerAttachment == null) {
|
||||
return Optional.absent();
|
||||
}
|
||||
|
||||
try {
|
||||
byte[] packId = Hex.fromStringCondensed(stickerAttachment.getSticker().getPackId());
|
||||
byte[] packKey = Hex.fromStringCondensed(stickerAttachment.getSticker().getPackKey());
|
||||
int stickerId = stickerAttachment.getSticker().getStickerId();
|
||||
SignalServiceAttachment attachment = getAttachmentPointerFor(stickerAttachment);
|
||||
|
||||
return Optional.of(new SignalServiceDataMessage.Sticker(packId, packKey, stickerId, attachment));
|
||||
} catch (IOException e) {
|
||||
Log.w(TAG, "Failed to decode sticker id/key", e);
|
||||
return Optional.absent();
|
||||
}
|
||||
}
|
||||
|
||||
List<SharedContact> getSharedContactsFor(OutgoingMediaMessage mediaMessage) {
|
||||
List<SharedContact> sharedContacts = new LinkedList<>();
|
||||
|
||||
@@ -259,9 +239,5 @@ public abstract class PushSendJob extends SendJob {
|
||||
}).toList();
|
||||
}
|
||||
|
||||
protected void rotateSenderCertificateIfNecessary() throws IOException {
|
||||
// Loki - We don't need verification on sender certificates
|
||||
}
|
||||
|
||||
protected abstract void onPushSend() throws Exception;
|
||||
}
|
||||
|
Reference in New Issue
Block a user