Merge pull request #494 from hjubb/refactor-sending

Fix expiration timers updates for groups
This commit is contained in:
Niels Andriesse
2021-04-09 16:22:40 +10:00
committed by GitHub
5 changed files with 93 additions and 37 deletions

View File

@@ -58,6 +58,7 @@ public class OutgoingGroupMediaMessage extends OutgoingSecureMediaMessage {
@Nullable final Attachment avatar,
long sentTime,
long expireIn,
boolean expirationUpdate,
@Nullable QuoteModel quote,
@NonNull List<Contact> contacts,
@NonNull List<LinkPreview> previews)
@@ -65,7 +66,7 @@ public class OutgoingGroupMediaMessage extends OutgoingSecureMediaMessage {
super(recipient, Base64.encodeBytes(group.toByteArray()),
new LinkedList<Attachment>() {{if (avatar != null) add(avatar);}},
sentTime,
DistributionTypes.CONVERSATION, expireIn, false, quote, contacts, previews);
DistributionTypes.CONVERSATION, expireIn, expirationUpdate, quote, contacts, previews);
this.group = group;
}

View File

@@ -78,6 +78,11 @@ object GroupUtil {
return getEncodedClosedGroupID(getEncodedClosedGroupID(Hex.fromStringCondensed(groupPublicKey)).toByteArray())
}
@JvmStatic
fun doubleEncodeGroupID(groupID: ByteArray): String {
return getEncodedClosedGroupID(getEncodedClosedGroupID(groupID).toByteArray())
}
@JvmStatic
@Throws(IOException::class)
fun doubleDecodeGroupID(groupID: String): ByteArray {