Notification: Add 'move' type and objects specific to it

This commit is contained in:
fruye 2022-11-13 17:15:25 +01:00
parent 1039c2d81e
commit 8f7a0d333b
4 changed files with 6 additions and 1 deletions

View File

@ -33,6 +33,7 @@ data class Notification(
val pleroma: PleromaNotification? = null,
val emoji: String? = null,
@SerializedName("emoji_url") val emojiUrl: String? = null,
val target: TimelineAccount? = null,
) {
/** From https://docs.joinmastodon.org/entities/Notification/#type */
@ -71,6 +72,7 @@ data class Notification(
REPORT("admin.report", R.string.notification_report_name),
EMOJI_REACTION("pleroma:emoji_reaction", R.string.notification_emoji_name),
MOVE("move", R.string.notification_move_name),
;
companion object {
@ -85,7 +87,7 @@ data class Notification(
}
/** Notification types for UI display (omits UNKNOWN) */
val visibleTypes = listOf(MENTION, REBLOG, FAVOURITE, FOLLOW, FOLLOW_REQUEST, POLL, STATUS, SIGN_UP, UPDATE, REPORT, EMOJI_REACTION)
val visibleTypes = listOf(MENTION, REBLOG, FAVOURITE, FOLLOW, FOLLOW_REQUEST, POLL, STATUS, SIGN_UP, UPDATE, REPORT, EMOJI_REACTION, MOVE)
}
override fun toString(): String {

View File

@ -68,6 +68,7 @@ fun Notification.toViewData(
this.report,
this.emoji,
this.emojiUrl,
this.target,
)
}

View File

@ -43,6 +43,7 @@ data class NotificationViewData(
val report: Report?,
val emoji: String?,
val emojiUrl: String?,
val target: TimelineAccount?,
)
{
fun isCustomEmoji() = emojiUrl != null

View File

@ -14,5 +14,6 @@
<string name="notification_emoji_name">Emoji Reactions</string>
<string name="notification_emoji_description">Notifications about new emoji reactions</string>
<string name="pref_title_notification_filter_emoji">my posts are reacted with emojis</string>
<string name="notification_move_name">Move</string>
</resources>