Notification: Add emoji_reaction type and objects specific to it
This commit is contained in:
parent
2c55491274
commit
d576294a91
|
@ -31,6 +31,7 @@ data class Notification(
|
|||
val status: Status?,
|
||||
val report: Report?,
|
||||
val pleroma: PleromaNotification? = null,
|
||||
val emoji: String? = null,
|
||||
) {
|
||||
|
||||
/** From https://docs.joinmastodon.org/entities/Notification/#type */
|
||||
|
@ -66,7 +67,10 @@ data class Notification(
|
|||
UPDATE("update", R.string.notification_update_name),
|
||||
|
||||
/** A new report has been filed */
|
||||
REPORT("admin.report", R.string.notification_report_name);
|
||||
REPORT("admin.report", R.string.notification_report_name),
|
||||
|
||||
EMOJI_REACTION("pleroma:emoji_reaction", R.string.notification_emoji_name),
|
||||
;
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
|
@ -80,7 +84,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)
|
||||
val visibleTypes = listOf(MENTION, REBLOG, FAVOURITE, FOLLOW, FOLLOW_REQUEST, POLL, STATUS, SIGN_UP, UPDATE, REPORT, EMOJI_REACTION)
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
|
|
|
@ -65,7 +65,8 @@ fun Notification.toViewData(
|
|||
this.id,
|
||||
this.account,
|
||||
this.status?.toViewData(isShowingContent, isExpanded, isCollapsed),
|
||||
this.report
|
||||
this.report,
|
||||
this.emoji,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
* see <http://www.gnu.org/licenses>. */
|
||||
package com.keylesspalace.tusky.viewdata
|
||||
|
||||
import com.keylesspalace.tusky.entity.Emoji
|
||||
import com.keylesspalace.tusky.entity.Notification
|
||||
import com.keylesspalace.tusky.entity.Report
|
||||
import com.keylesspalace.tusky.entity.TimelineAccount
|
||||
|
@ -39,5 +40,6 @@ data class NotificationViewData(
|
|||
val id: String,
|
||||
val account: TimelineAccount,
|
||||
var statusViewData: StatusViewData.Concrete?,
|
||||
val report: Report?
|
||||
val report: Report?,
|
||||
val emoji: String?,
|
||||
)
|
||||
|
|
|
@ -10,5 +10,6 @@
|
|||
<string name="action_emoji_unreact">Remove reaction</string>
|
||||
<string name="action_emoji_reacted_by">Who reacted</string>
|
||||
<string name="title_emoji_reacted_by">%s reacted by</string>
|
||||
<string name="notification_emoji_name">Emoji Reactions</string>
|
||||
|
||||
</resources>
|
Loading…
Reference in New Issue