kopia lustrzana https://github.com/ryukoposting/Signal-Android
Display group story notifications if user has reacted or replied.
rodzic
c29922a575
commit
25c0dc801f
|
@ -206,7 +206,7 @@ public abstract class MessageDatabase extends Database implements MmsSmsColumns
|
||||||
public abstract @NonNull List<RecipientId> getUnreadStoryThreadRecipientIds();
|
public abstract @NonNull List<RecipientId> getUnreadStoryThreadRecipientIds();
|
||||||
public abstract boolean containsStories(long threadId);
|
public abstract boolean containsStories(long threadId);
|
||||||
public abstract boolean hasSelfReplyInStory(long parentStoryId);
|
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 @NonNull Cursor getStoryReplies(long parentStoryId);
|
||||||
public abstract @Nullable Long getOldestStorySendTimestamp(boolean hasSeenReleaseChannelStories);
|
public abstract @Nullable Long getOldestStorySendTimestamp(boolean hasSeenReleaseChannelStories);
|
||||||
public abstract int deleteStoriesOlderThan(long timestamp, boolean hasSeenReleaseChannelStories);
|
public abstract int deleteStoriesOlderThan(long timestamp, boolean hasSeenReleaseChannelStories);
|
||||||
|
|
|
@ -896,17 +896,8 @@ public class MmsDatabase extends MessageDatabase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasSelfReplyInGroupStory(long parentStoryId) {
|
public boolean hasGroupReplyOrReactionInStory(long parentStoryId) {
|
||||||
SQLiteDatabase db = databaseHelper.getSignalReadableDatabase();
|
return hasSelfReplyInStory(-parentStoryId);
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1492,7 +1492,7 @@ public class SmsDatabase extends MessageDatabase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasSelfReplyInGroupStory(long parentStoryId) {
|
public boolean hasGroupReplyOrReactionInStory(long parentStoryId) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ object NotificationStateProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
val hasSelfRepliedToGroupStory = conversationId.groupStoryId?.let {
|
val hasSelfRepliedToGroupStory = conversationId.groupStoryId?.let {
|
||||||
SignalDatabase.mms.hasSelfReplyInGroupStory(it)
|
SignalDatabase.mms.hasGroupReplyOrReactionInStory(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
messages += NotificationMessage(
|
messages += NotificationMessage(
|
||||||
|
|
Ładowanie…
Reference in New Issue