1
1
Fork 1
mirror of https://github.com/go-gitea/gitea.git synced 2024-05-26 18:06:14 +02:00
gitea/services/websocket/issue_comment_notifier.go
2024-04-06 16:22:35 +02:00

27 lines
593 B
Go

// Copyright 2024 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package websocket
import (
"context"
"encoding/json"
"fmt"
issues_model "code.gitea.io/gitea/models/issues"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/services/pubsub"
)
func (n *websocketNotifier) DeleteComment(ctx context.Context, doer *user_model.User, c *issues_model.Comment) {
d, err := json.Marshal(c)
if err != nil {
return
}
n.pubsub.Publish(ctx, pubsub.Message{
Data: d,
Topic: fmt.Sprintf("repo:%s/%s", c.RefRepo.OwnerName, c.RefRepo.Name),
})
}