Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: anon claim and global mod #156

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion server/services/v1/comments/abandon.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,18 @@ func abandon(args *commentapi.AbandonArgs) (*commentapi.CommentItem, error) {
if comment.R.Channel == nil {
return nil, errors.Err("channel id '%s' does not have a channel record", comment.ChannelID.String)
}
commenterChannel = comment.R.Channel
// Handle anonymous content where there's no channel associated
if args.CreatorChannelID == "" && args.CreatorChannelName == "" {
// If the content is anonymous, set the modChannel to a default or system channel
if args.ModChannelName != "" && args.ModChannelID != "" {
modChannel, _, err = helper.GetModerator(args.ModChannelID, args.ModChannelName, args.ModChannelID, args.ModChannelName)
if err != nil {
return nil, err
}
}
} else {
commenterChannel = comment.R.Channel
}
// Old versions of desktop app will allow for just creator channel info to be sent for creators to
// delete comments and mod channel info is newer addition and would not be sent so we cannot assume
// it will sent with request.
Expand Down
Loading