feat: 就地通过评审,并为已过审用户提供默认可关的免审发布
帖/评管理入口可直接通过;站点默认信任已有 published 内容的用户后续直发。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -30,6 +30,23 @@ type Handlers struct {
|
||||
Chat *service.ChatService
|
||||
}
|
||||
|
||||
// resolvePublishStatus 决定新帖/新评的初始状态:
|
||||
// staff 直发;若开启「已过审免审」且用户已有 published 内容则直发;否则进 pending。
|
||||
func (h *Handlers) resolvePublishStatus(userID uint, role string) string {
|
||||
if model.IsStaff(model.Role(role)) {
|
||||
return model.ContentStatusPublished
|
||||
}
|
||||
trust, err := h.Setting.TrustReviewedPublish()
|
||||
if err != nil || !trust {
|
||||
return model.ContentStatusPending
|
||||
}
|
||||
ok, err := h.Moderation.UserHasApprovedContent(userID)
|
||||
if err != nil || !ok {
|
||||
return model.ContentStatusPending
|
||||
}
|
||||
return model.ContentStatusPublished
|
||||
}
|
||||
|
||||
// broadcastFeedChanged 帖子流有公开发布内容时全员广播(三期)
|
||||
func (h *Handlers) broadcastFeedChanged(kind string, postID, boardID, actorID uint) {
|
||||
if h.Hub == nil {
|
||||
|
||||
Reference in New Issue
Block a user