Skip to content

Commit

Permalink
unarchive on post
Browse files Browse the repository at this point in the history
  • Loading branch information
cohoe committed Jan 21, 2025
1 parent 8517a4d commit 2deabea
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Sources/swiftarr/Controllers/FezController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,13 @@ struct FezController: APIRouteCollection {
}
}
else if participantUserID != cacheUser.userID {
if let pivot = try await getUserPivot(lfg: fez, userID: participantUserID, on: req.db), pivot.isMuted == true {
continue
if let pivot = try await getUserPivot(lfg: fez, userID: participantUserID, on: req.db) {
if pivot.isMuted == true {
continue
} else if pivot.isArchived {
pivot.isArchived = false
try await pivot.save(on: req.db)
}
}
participantNotifyList.append(participantUserID)
}
Expand Down Expand Up @@ -570,6 +575,7 @@ struct FezController: APIRouteCollection {
participantPivot.readCount -= 1
pivotNeedsSave = true
}
// If a post has been deleted, we don't care for the purposes of archived Fezzes.
if pivotNeedsSave {
try await participantPivot.save(on: req.db)
}
Expand Down

0 comments on commit 2deabea

Please sign in to comment.