clean up stickers

This commit is contained in:
Ryan ZHAO
2021-02-22 10:21:06 +11:00
parent 19a829d011
commit 88bbc0b677
12 changed files with 0 additions and 2439 deletions

View File

@@ -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();

View File

@@ -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;
}