Add support for sending and syncing viewed receipts behind a feature flag.

This commit is contained in:
Alex Hart
2021-04-28 16:21:34 -03:00
parent cdc7f1565e
commit ab44d608d2
16 changed files with 425 additions and 44 deletions

View File

@@ -117,6 +117,7 @@ import org.thoughtcrime.securesms.revealable.ViewOnceUtil;
import org.thoughtcrime.securesms.stickers.StickerUrl;
import org.thoughtcrime.securesms.util.DateUtils;
import org.thoughtcrime.securesms.util.DynamicTheme;
import org.thoughtcrime.securesms.util.FeatureFlags;
import org.thoughtcrime.securesms.util.InterceptableLongClickCopyLinkSpan;
import org.thoughtcrime.securesms.util.LongClickMovementMethod;
import org.thoughtcrime.securesms.util.SearchUtil;
@@ -1164,7 +1165,7 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
boolean differentTimestamps = next.isPresent() && !DateUtils.isSameExtendedRelativeTimestamp(context, locale, next.get().getTimestamp(), current.getTimestamp());
if (current.getExpiresIn() > 0 || !current.isSecure() || current.isPending() || current.isPendingInsecureSmsFallback() ||
if (forceFooter(messageRecord) || current.getExpiresIn() > 0 || !current.isSecure() || current.isPending() || current.isPendingInsecureSmsFallback() ||
current.isFailed() || differentTimestamps || isEndOfMessageCluster(current, next, isGroupThread))
{
ConversationItemFooter activeFooter = getActiveFooter(current);
@@ -1189,6 +1190,10 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
}
}
private boolean forceFooter(@NonNull MessageRecord messageRecord) {
return FeatureFlags.viewedReceipts() && hasAudio(messageRecord) && messageRecord.getViewedReceiptCount() == 0;
}
private ConversationItemFooter getActiveFooter(@NonNull MessageRecord messageRecord) {
if (hasNoBubble(messageRecord)) {
return stickerFooter;