Add the pleroma object to the db
Remember emoji reactions and the 'reply to' text. Co-Authored-By: fruye <fruye@unix.dog>
This commit is contained in:
parent
893e804a6e
commit
e17f8b8613
|
@ -106,7 +106,8 @@ fun Placeholder.toEntity(timelineUserId: Long): TimelineStatusEntity {
|
|||
card = null,
|
||||
repliesCount = 0,
|
||||
language = null,
|
||||
filtered = null
|
||||
filtered = null,
|
||||
pleroma = null,
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -151,7 +152,8 @@ fun Status.toEntity(
|
|||
card = actionableStatus.card?.let(gson::toJson),
|
||||
repliesCount = actionableStatus.repliesCount,
|
||||
language = actionableStatus.language,
|
||||
filtered = actionableStatus.filtered
|
||||
filtered = actionableStatus.filtered,
|
||||
pleroma = actionableStatus.pleroma.let(gson::toJson),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -168,6 +170,7 @@ fun TimelineStatusWithAccount.toViewData(gson: Gson, isDetailed: Boolean = false
|
|||
val emojis: List<Emoji> = gson.fromJson(status.emojis, emojisListType) ?: emptyList()
|
||||
val poll: Poll? = gson.fromJson(status.poll, Poll::class.java)
|
||||
val card: Card? = gson.fromJson(status.card, Card::class.java)
|
||||
val pleroma : Status.PleromaStatus? = gson.fromJson(status.pleroma, Status.PleromaStatus::class.java)
|
||||
|
||||
val reblog = status.reblogServerId?.let { id ->
|
||||
Status(
|
||||
|
@ -200,7 +203,7 @@ fun TimelineStatusWithAccount.toViewData(gson: Gson, isDetailed: Boolean = false
|
|||
repliesCount = status.repliesCount,
|
||||
language = status.language,
|
||||
filtered = status.filtered,
|
||||
pleroma = null, // FIXME
|
||||
pleroma = pleroma,
|
||||
)
|
||||
}
|
||||
val status = if (reblog != null) {
|
||||
|
@ -234,7 +237,7 @@ fun TimelineStatusWithAccount.toViewData(gson: Gson, isDetailed: Boolean = false
|
|||
repliesCount = status.repliesCount,
|
||||
language = status.language,
|
||||
filtered = status.filtered,
|
||||
pleroma = null, // FIXME
|
||||
pleroma = pleroma,
|
||||
)
|
||||
} else {
|
||||
Status(
|
||||
|
@ -267,7 +270,7 @@ fun TimelineStatusWithAccount.toViewData(gson: Gson, isDetailed: Boolean = false
|
|||
repliesCount = status.repliesCount,
|
||||
language = status.language,
|
||||
filtered = status.filtered,
|
||||
pleroma = null, // FIXME
|
||||
pleroma = pleroma,
|
||||
)
|
||||
}
|
||||
return StatusViewData.Concrete(
|
||||
|
|
|
@ -654,6 +654,8 @@ public abstract class AppDatabase extends RoomDatabase {
|
|||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
database.execSQL("ALTER TABLE `DraftEntity` ADD COLUMN `statusId` TEXT");
|
||||
|
||||
database.execSQL("ALTER TABLE `TimelineStatusEntity` ADD COLUMN `pleroma` TEXT");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ SELECT s.serverId, s.url, s.timelineUserId,
|
|||
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, s.filtered,
|
||||
s.content, s.attachments, s.poll, s.card, s.muted, s.expanded, s.contentShowing, s.contentCollapsed, s.pinned, s.language, s.filtered, s.pleroma,
|
||||
a.serverId as 'a_serverId', a.timelineUserId as 'a_timelineUserId',
|
||||
a.localUsername as 'a_localUsername', a.username as 'a_username',
|
||||
a.displayName as 'a_displayName', a.url as 'a_url', a.avatar as 'a_avatar',
|
||||
|
@ -59,7 +59,7 @@ SELECT s.serverId, s.url, s.timelineUserId,
|
|||
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, s.filtered,
|
||||
s.content, s.attachments, s.poll, s.card, s.muted, s.expanded, s.contentShowing, s.contentCollapsed, s.pinned, s.language, s.filtered, s.pleroma,
|
||||
a.serverId as 'a_serverId', a.timelineUserId as 'a_timelineUserId',
|
||||
a.localUsername as 'a_localUsername', a.username as 'a_username',
|
||||
a.displayName as 'a_displayName', a.url as 'a_url', a.avatar as 'a_avatar',
|
||||
|
|
|
@ -85,7 +85,8 @@ data class TimelineStatusEntity(
|
|||
val pinned: Boolean,
|
||||
val card: String?,
|
||||
val language: String?,
|
||||
val filtered: List<FilterResult>?
|
||||
val filtered: List<FilterResult>?,
|
||||
val pleroma: String?,
|
||||
) {
|
||||
val isPlaceholder: Boolean
|
||||
get() = this.authorServerId == null
|
||||
|
|
Loading…
Reference in New Issue