Status: Display indicators of edited posts (#2935)

* Add editedAt field to Status

* Status: Display indicators of edited posts

* Annotate edited posts in the Status description

* Cache info that post has been edited
This commit is contained in:
fruyek 2022-12-03 12:15:54 +01:00 committed by GitHub
commit d823052862
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 1041 additions and 18 deletions

View file

@ -31,7 +31,7 @@ import java.io.File;
*/
@Database(entities = { DraftEntity.class, AccountEntity.class, InstanceEntity.class, TimelineStatusEntity.class,
TimelineAccountEntity.class, ConversationEntity.class
}, version = 44)
}, version = 45)
public abstract class AppDatabase extends RoomDatabase {
public abstract AccountDao accountDao();
@ -624,4 +624,12 @@ public abstract class AppDatabase extends RoomDatabase {
database.execSQL("ALTER TABLE `AccountEntity` ADD COLUMN `notificationsReports` INTEGER NOT NULL DEFAULT 1");
}
};
public static final Migration MIGRATION_44_45 = new Migration(44, 45) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("ALTER TABLE `TimelineStatusEntity` ADD COLUMN `editedAt` INTEGER");
database.execSQL("ALTER TABLE `ConversationEntity` ADD COLUMN `s_editedAt` INTEGER");
}
};
}

View file

@ -33,7 +33,7 @@ abstract class TimelineDao {
@Query(
"""
SELECT s.serverId, s.url, s.timelineUserId,
s.authorServerId, s.inReplyToId, s.inReplyToAccountId, s.createdAt,
s.authorServerId, s.inReplyToId, s.inReplyToAccountId, s.createdAt, s.editedAt,
s.emojis, s.reblogsCount, s.favouritesCount, s.repliesCount, s.reblogged, s.favourited, s.bookmarked, s.sensitive,
s.spoilerText, s.visibility, s.mentions, s.tags, s.application, s.reblogServerId,s.reblogAccountId,
s.content, s.attachments, s.poll, s.card, s.muted, s.expanded, s.contentShowing, s.contentCollapsed, s.pinned, s.language,

View file

@ -58,6 +58,7 @@ data class TimelineStatusEntity(
val inReplyToAccountId: String?,
val content: String?,
val createdAt: Long,
val editedAt: Long?,
val emojis: String?,
val reblogsCount: Int,
val favouritesCount: Int,