Display group story notifications if user has reacted or replied.

fork-5.53.8
Alex Hart 2022-09-21 16:50:07 -03:00 zatwierdzone przez Cody Henthorne
rodzic c29922a575
commit 25c0dc801f
4 zmienionych plików z 5 dodań i 14 usunięć

Wyświetl plik

@ -206,7 +206,7 @@ public abstract class MessageDatabase extends Database implements MmsSmsColumns
public abstract @NonNull List<RecipientId> getUnreadStoryThreadRecipientIds();
public abstract boolean containsStories(long threadId);
public abstract boolean hasSelfReplyInStory(long parentStoryId);
public abstract boolean hasSelfReplyInGroupStory(long parentStoryId);
public abstract boolean hasGroupReplyOrReactionInStory(long parentStoryId);
public abstract @NonNull Cursor getStoryReplies(long parentStoryId);
public abstract @Nullable Long getOldestStorySendTimestamp(boolean hasSeenReleaseChannelStories);
public abstract int deleteStoriesOlderThan(long timestamp, boolean hasSeenReleaseChannelStories);

Wyświetl plik

@ -896,17 +896,8 @@ public class MmsDatabase extends MessageDatabase {
}
@Override
public boolean hasSelfReplyInGroupStory(long parentStoryId) {
SQLiteDatabase db = databaseHelper.getSignalReadableDatabase();
String[] columns = new String[]{"COUNT(*)"};
String where = PARENT_STORY_ID + " = ? AND (" +
getOutgoingTypeClause() + ") AND ("
+ MESSAGE_BOX + " & " + Types.SPECIAL_TYPES_MASK + " != " + Types.SPECIAL_TYPE_STORY_REACTION + ")";
String[] whereArgs = SqlUtil.buildArgs(parentStoryId);
try (Cursor cursor = db.query(TABLE_NAME, columns, where, whereArgs, null, null, null, null)) {
return cursor != null && cursor.moveToNext() && cursor.getInt(0) > 0;
}
public boolean hasGroupReplyOrReactionInStory(long parentStoryId) {
return hasSelfReplyInStory(-parentStoryId);
}
@Override

Wyświetl plik

@ -1492,7 +1492,7 @@ public class SmsDatabase extends MessageDatabase {
}
@Override
public boolean hasSelfReplyInGroupStory(long parentStoryId) {
public boolean hasGroupReplyOrReactionInStory(long parentStoryId) {
throw new UnsupportedOperationException();
}

Wyświetl plik

@ -43,7 +43,7 @@ object NotificationStateProvider {
}
val hasSelfRepliedToGroupStory = conversationId.groupStoryId?.let {
SignalDatabase.mms.hasSelfReplyInGroupStory(it)
SignalDatabase.mms.hasGroupReplyOrReactionInStory(it)
}
messages += NotificationMessage(