Compare commits
5 Commits
4b43726e1d
...
c3cf38b0c9
Author | SHA1 | Date |
---|---|---|
Shadowfacts | c3cf38b0c9 | |
Shadowfacts | 7929e7530f | |
Shadowfacts | a11e453112 | |
Shadowfacts | 2e7ad1626e | |
Shadowfacts | 4182c15500 |
|
@ -134,6 +134,16 @@ public class InstanceFeatures: ObservableObject {
|
|||
}
|
||||
}
|
||||
|
||||
public var statusEditNotifications: Bool {
|
||||
// pleroma doesn't seem to support 'update' type notifications, even though it supports edits
|
||||
hasMastodonVersion(3, 5, 0)
|
||||
}
|
||||
|
||||
public var statusNotifications: Bool {
|
||||
// pleroma doesn't support notifications for new posts from an account
|
||||
hasMastodonVersion(3, 3, 0)
|
||||
}
|
||||
|
||||
public var needsEditAttachmentsInSeparateRequest: Bool {
|
||||
instanceType.isPleroma(.akkoma(nil))
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ class ActionNotificationGroupCollectionViewCell: UICollectionViewListCell {
|
|||
avatarStack.arrangedSubviews.forEach { $0.removeFromSuperview() }
|
||||
for avatarURL in people.lazy.compactMap(\.avatar).prefix(10) {
|
||||
let imageView = CachedImageView(cache: .avatars)
|
||||
imageView.contentMode = .scaleAspectFit
|
||||
imageView.contentMode = .scaleAspectFill
|
||||
imageView.layer.masksToBounds = true
|
||||
imageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadiusFraction * 30
|
||||
imageView.layer.cornerCurve = .continuous
|
||||
|
|
|
@ -121,6 +121,7 @@ class FollowNotificationGroupCollectionViewCell: UICollectionViewListCell {
|
|||
avatarStack.arrangedSubviews.forEach { $0.removeFromSuperview() }
|
||||
for avatarURL in people.lazy.compactMap(\.avatar).prefix(10) {
|
||||
let imageView = CachedImageView(cache: .avatars)
|
||||
imageView.contentMode = .scaleAspectFill
|
||||
imageView.layer.masksToBounds = true
|
||||
imageView.layer.cornerRadius = Preferences.shared.avatarStyle.cornerRadiusFraction * 30
|
||||
imageView.layer.cornerCurve = .continuous
|
||||
|
|
|
@ -20,6 +20,7 @@ class FollowRequestNotificationCollectionViewCell: UICollectionViewListCell {
|
|||
}
|
||||
|
||||
private let avatarImageView = CachedImageView(cache: .avatars).configure {
|
||||
$0.contentMode = .scaleAspectFill
|
||||
$0.layer.masksToBounds = true
|
||||
$0.layer.cornerCurve = .continuous
|
||||
NSLayoutConstraint.activate([
|
||||
|
|
|
@ -398,13 +398,19 @@ extension NotificationsCollectionViewController {
|
|||
var types = Set(Notification.Kind.allCases)
|
||||
types.remove(.unknown)
|
||||
allowedTypes.forEach { types.remove($0) }
|
||||
if !mastodonController.instanceFeatures.statusEditNotifications {
|
||||
types.remove(.update)
|
||||
}
|
||||
if !mastodonController.instanceFeatures.statusNotifications {
|
||||
types.remove(.status)
|
||||
}
|
||||
return Client.getNotifications(excludedTypes: Array(types), range: range)
|
||||
}
|
||||
}
|
||||
|
||||
private func validateNotifications(_ notifications: [Pachyderm.Notification]) -> [Pachyderm.Notification] {
|
||||
return notifications.compactMap { notif in
|
||||
if notif.status == nil && (notif.kind == .mention || notif.kind == .reblog || notif.kind == .favourite) {
|
||||
if notif.status == nil && (notif.kind == .mention || notif.kind == .reblog || notif.kind == .favourite || notif.kind == .status) {
|
||||
let crumb = Breadcrumb(level: .fatal, category: "notifications")
|
||||
crumb.data = [
|
||||
"id": notif.id,
|
||||
|
|
|
@ -486,6 +486,7 @@ class CustomAlertPresentationAnimation: NSObject, UIViewControllerAnimatedTransi
|
|||
|
||||
let container = transitionContext.containerView
|
||||
container.addSubview(alert.view)
|
||||
alert.view.frame = container.bounds
|
||||
|
||||
guard transitionContext.isAnimated else {
|
||||
presenter.view.tintAdjustmentMode = .dimmed
|
||||
|
|
|
@ -28,6 +28,7 @@ class ConversationMainStatusCollectionViewCell: UICollectionViewListCell, Status
|
|||
|
||||
private static let avatarImageViewSize: CGFloat = 50
|
||||
private(set) lazy var avatarImageView = CachedImageView(cache: .avatars).configure {
|
||||
$0.contentMode = .scaleAspectFill
|
||||
$0.layer.masksToBounds = true
|
||||
$0.layer.cornerCurve = .continuous
|
||||
NSLayoutConstraint.activate([
|
||||
|
|
|
@ -75,6 +75,7 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
|
|||
|
||||
private static let avatarImageViewSize: CGFloat = 50
|
||||
private(set) lazy var avatarImageView = CachedImageView(cache: .avatars).configure {
|
||||
$0.contentMode = .scaleAspectFill
|
||||
$0.layer.masksToBounds = true
|
||||
$0.layer.cornerCurve = .continuous
|
||||
NSLayoutConstraint.activate([
|
||||
|
@ -535,6 +536,21 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
|
|||
fatalError()
|
||||
}
|
||||
|
||||
self.statusState = state
|
||||
|
||||
let reblogStatus: StatusMO?
|
||||
if let rebloggedStatus = status.reblog {
|
||||
reblogStatus = status
|
||||
reblogStatusID = statusID
|
||||
rebloggerID = status.account.id
|
||||
|
||||
status = rebloggedStatus
|
||||
} else {
|
||||
reblogStatus = nil
|
||||
reblogStatusID = nil
|
||||
rebloggerID = nil
|
||||
}
|
||||
|
||||
switch filterResult {
|
||||
case .allow:
|
||||
setContentViewMode(.status)
|
||||
|
@ -545,6 +561,10 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
|
|||
attrStr.append(showStr)
|
||||
filteredLabel.attributedText = attrStr
|
||||
setContentViewMode(.filtered)
|
||||
|
||||
// still update id properties, so that info for other methods (e.g., context menus) is correct
|
||||
self.statusID = status.id
|
||||
self.accountID = status.account.id
|
||||
return
|
||||
case .hide:
|
||||
fatalError("unreachable")
|
||||
|
@ -552,20 +572,11 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
|
|||
|
||||
createObservers()
|
||||
|
||||
self.statusState = state
|
||||
|
||||
var hideTimelineReason = true
|
||||
|
||||
if let rebloggedStatus = status.reblog {
|
||||
reblogStatusID = statusID
|
||||
rebloggerID = status.account.id
|
||||
|
||||
if let reblogStatus {
|
||||
hideTimelineReason = false
|
||||
updateRebloggerLabel(reblogger: status.account)
|
||||
status = rebloggedStatus
|
||||
} else {
|
||||
reblogStatusID = nil
|
||||
rebloggerID = nil
|
||||
updateRebloggerLabel(reblogger: reblogStatus.account)
|
||||
}
|
||||
|
||||
if showFollowedHashtags {
|
||||
|
|
Loading…
Reference in New Issue