mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 10:17:56 +00:00
Update story notifications to match spec.
This commit is contained in:
committed by
Greyson Parrelli
parent
bd5907ea04
commit
2270dfaf21
@@ -12,6 +12,7 @@ import org.thoughtcrime.securesms.database.model.MessageRecord
|
||||
import org.thoughtcrime.securesms.database.model.ReactionRecord
|
||||
import org.thoughtcrime.securesms.notifications.profiles.NotificationProfile
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.util.isStoryReaction
|
||||
|
||||
/**
|
||||
* Queries the message databases to determine messages that should be in notifications.
|
||||
@@ -125,7 +126,7 @@ object NotificationStateProvider {
|
||||
) {
|
||||
private val isGroupStoryReply: Boolean = thread.groupStoryId != null
|
||||
private val isUnreadIncoming: Boolean = isUnreadMessage && !messageRecord.isOutgoing && !isGroupStoryReply
|
||||
private val isNotifiableGroupStoryMessage: Boolean = isUnreadMessage && !messageRecord.isOutgoing && isGroupStoryReply && (isParentStorySentBySelf || hasSelfRepliedToStory)
|
||||
private val isNotifiableGroupStoryMessage: Boolean = isUnreadMessage && !messageRecord.isOutgoing && isGroupStoryReply && (isParentStorySentBySelf || (hasSelfRepliedToStory && !messageRecord.isStoryReaction()))
|
||||
|
||||
fun includeMessage(notificationProfile: NotificationProfile?): MessageInclusion {
|
||||
return if (isUnreadIncoming || stickyThread || isNotifiableGroupStoryMessage) {
|
||||
|
||||
@@ -37,7 +37,12 @@ public class PagingMappingAdapter<Key> extends MappingAdapter {
|
||||
if (pagingController != null) {
|
||||
pagingController.onDataNeededAroundIndex(position);
|
||||
}
|
||||
return super.getItem(position);
|
||||
|
||||
if (position > 0 && position < super.getCurrentList().size()) {
|
||||
return super.getItem(position);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user