dmitri.shuralyov.com/service/change/...

fs, githubapi: rename threadType constant

Give it a more specific name. This improves clarity of what it means
and how it's being used in the ThreadType method.
dmitshur committed 5 years ago commit 17086f11787b0ad3d36fd609387e7709d6195c46
Collapse all
fs/fs.go
@@ -392,15 +392,15 @@ func (s *Service) EditComment(ctx context.Context, repo string, id uint64, cr ch

func hasChange(repo string, id uint64) bool {
	return 1 <= id && id <= uint64(len(s.changes[repo]))
}

// threadType is the notifications thread type for this service.
const threadType = "Change"
// fsChangeThreadType is the notification thread type for changes stored in a virtual filesystem.
const fsChangeThreadType = "Change"

// ThreadType returns the notifications thread type for this service.
func (*Service) ThreadType(repo string) string { return threadType }
// ThreadType returns the notification thread type for this service.
func (*Service) ThreadType(repo string) string { return fsChangeThreadType }

var (
	dmitshur = users.User{
		UserSpec: users.UserSpec{
			ID:     1924134,
githubapi/githubapi.go
@@ -1013,15 +1013,15 @@ func externalizeReaction(reaction reactions.EmojiID) (githubv4.ReactionContent,
	default:
		return "", fmt.Errorf("%q is an unsupported reaction", reaction)
	}
}

// threadType is the notifications thread type for this service.
const threadType = "PullRequest"
// githubPRThreadType is the notification thread type for GitHub Pull Requests.
const githubPRThreadType = "PullRequest"

// ThreadType returns the notifications thread type for this service.
func (service) ThreadType(repo string) string { return threadType }
// ThreadType returns the notification thread type for this service.
func (service) ThreadType(repo string) string { return githubPRThreadType }

// markRead marks the specified issue as read for current user.
func (s service) markRead(ctx context.Context, repo string, id uint64) error {
	if s.notifications == nil {
		return nil