Add moderation-warning-notification-type (IOS-264)

This commit is contained in:
Nathan Mattes 2024-05-07 17:10:47 +02:00
parent a4b175ce9c
commit a6e41c37ce
4 changed files with 9 additions and 14 deletions

View File

@ -131,7 +131,8 @@ final public class SceneCoordinator {
from: from,
transition: .show
)
case .moderationWarning:
break
case ._other:
assertionFailure()
break

View File

@ -52,6 +52,8 @@ extension NotificationView {
quoteStatusView.configure(status: status)
setQuoteStatusViewDisplay()
}
case .moderationWarning:
setAuthorContainerBottomPaddingViewDisplay()
case ._other:
setAuthorContainerBottomPaddingViewDisplay()
assertionFailure()

View File

@ -60,6 +60,7 @@ extension APIService {
.favourite,
.poll,
.status,
.moderationWarning
]
case .mentions:
return [

View File

@ -46,21 +46,10 @@ extension Mastodon.Entity.Notification {
case favourite
case poll
case status
case moderationWarning
case _other(String)
public static var knownCases: [NotificationType] {
return [
.follow,
.followRequest,
.mention,
.reblog,
.favourite,
.poll,
.status
]
}
public init?(rawValue: String) {
switch rawValue {
case "follow": self = .follow
@ -70,6 +59,7 @@ extension Mastodon.Entity.Notification {
case "favourite": self = .favourite
case "poll": self = .poll
case "status": self = .status
case "moderation_warning": self = .moderationWarning
default: self = ._other(rawValue)
}
}
@ -83,6 +73,7 @@ extension Mastodon.Entity.Notification {
case .favourite: return "favourite"
case .poll: return "poll"
case .status: return "status"
case .moderationWarning: return "moderation_warning"
case ._other(let value): return value
}
}