Increase maximum sticker size to 300 kibibytes

In preparation for animated stickers, allow stickers to be up to 300
kibibytes.
This commit is contained in:
Ehren Kret
2020-08-31 10:24:01 -05:00
committed by Jon Chambers
parent 6aa4acd3db
commit 5221828705
2 changed files with 10 additions and 7 deletions

View File

@@ -1,5 +1,6 @@
package org.whispersystems.textsecuregcm.controllers;
import io.dropwizard.auth.Auth;
import org.whispersystems.textsecuregcm.entities.StickerPackFormUploadAttributes;
import org.whispersystems.textsecuregcm.entities.StickerPackFormUploadAttributes.StickerPackFormUploadItem;
import org.whispersystems.textsecuregcm.limits.RateLimiters;
@@ -22,8 +23,6 @@ import java.time.ZonedDateTime;
import java.util.LinkedList;
import java.util.List;
import io.dropwizard.auth.Auth;
@Path("/v1/sticker")
public class StickerController {
@@ -60,7 +59,7 @@ public class StickerController {
for (int i=0;i<stickerCount;i++) {
String stickerKey = packLocation + "/full/" + i;
Pair<String, String> stickerPolicy = policyGenerator.createFor(now, stickerKey, 100155);
Pair<String, String> stickerPolicy = policyGenerator.createFor(now, stickerKey, 307_200);
String stickerSignature = policySigner.getSignature(now, stickerPolicy.second());
stickers.add(new StickerPackFormUploadItem(i, stickerKey, stickerPolicy.first(), "private", "AWS4-HMAC-SHA256",
now.format(PostPolicyGenerator.AWS_DATE_TIME), stickerPolicy.second(), stickerSignature));