Display reply icon if you responded 1:1 to the displayed story.

This commit is contained in:
Alex Hart
2022-04-06 13:12:04 -03:00
committed by Cody Henthorne
parent bcd16ce296
commit 46bb64ad24
3 changed files with 9 additions and 2 deletions

View File

@@ -743,8 +743,8 @@ public class MmsDatabase extends MessageDatabase {
public boolean hasSelfReplyInStory(long parentStoryId) {
SQLiteDatabase db = databaseHelper.getSignalReadableDatabase();
String[] columns = new String[]{"COUNT(*)"};
String where = PARENT_STORY_ID + " = ? AND " + RECIPIENT_ID + " = ?";
String[] whereArgs = SqlUtil.buildArgs(parentStoryId, Recipient.self().getId());
String where = PARENT_STORY_ID + " = ? AND (" + getOutgoingTypeClause() + ")";
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;

View File

@@ -188,6 +188,12 @@ object StoriesLandingItem {
}
icon.visible = model.data.hasReplies || model.data.hasRepliesFromSelf
icon.setImageResource(
when {
model.data.hasReplies -> R.drawable.ic_messages_solid_20
else -> R.drawable.ic_reply_24_solid_tinted
}
)
listOf(avatarView, storyPreview, storyMulti, sender, date, icon).forEach {
it.alpha = if (model.data.isHidden) 0.5f else 1f