Skip to content

Commit

Permalink
Add moderation-warning-notification-type (IOS-264)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitschlag committed May 14, 2024
1 parent a4b175c commit a6e41c3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
3 changes: 2 additions & 1 deletion Mastodon/Coordinator/SceneCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ final public class SceneCoordinator {
from: from,
transition: .show
)

case .moderationWarning:
break
case ._other:
assertionFailure()
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ extension NotificationView {
quoteStatusView.configure(status: status)
setQuoteStatusViewDisplay()
}
case .moderationWarning:
setAuthorContainerBottomPaddingViewDisplay()
case ._other:
setAuthorContainerBottomPaddingViewDisplay()
assertionFailure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ extension APIService {
.favourite,
.poll,
.status,
.moderationWarning
]
case .mentions:
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
}
Expand All @@ -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
}
}
Expand Down

0 comments on commit a6e41c3

Please sign in to comment.