mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 16:49:40 +01:00
Fix attachment deduplication issue with Stories.
This commit is contained in:
committed by
Cody Henthorne
parent
ed25be2e23
commit
ba6e1b5dd5
@@ -16,9 +16,11 @@
|
||||
*/
|
||||
package org.thoughtcrime.securesms.mms;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class MediaStream {
|
||||
public class MediaStream implements Closeable {
|
||||
private final InputStream stream;
|
||||
private final String mimeType;
|
||||
private final int width;
|
||||
@@ -46,4 +48,9 @@ public class MediaStream {
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
stream.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,4 +81,22 @@ public class OutgoingSecureMediaMessage extends OutgoingMediaMessage {
|
||||
getMentions(),
|
||||
getGiftBadge());
|
||||
}
|
||||
|
||||
public @NonNull OutgoingSecureMediaMessage stripAttachments() {
|
||||
return new OutgoingSecureMediaMessage(getRecipient(),
|
||||
getBody(),
|
||||
Collections.emptyList(),
|
||||
getSentTimeMillis(),
|
||||
getDistributionType(),
|
||||
getExpiresIn(),
|
||||
isViewOnce(),
|
||||
getStoryType(),
|
||||
getParentStoryId(),
|
||||
isStoryReaction(),
|
||||
getOutgoingQuote(),
|
||||
Collections.emptyList(),
|
||||
Collections.emptyList(),
|
||||
getMentions(),
|
||||
getGiftBadge());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user