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

fs, githubapi: Add repo parameter to ThreadType method.

It's needed because in some meta-services that unify multiple
underlying services, the ThreadType changes depending on the RepoSpec.

Similar to https://github.com/shurcooL/issuesapp/commit/60bf33177c6943f244f14f81f145bc8b6c63f6cc.
dmitshur committed 6 years ago commit 891fba5eb78bd1e1c421e6c7c422ccda350d246d
Collapse all
fs/fs.go
@@ -152,10 +152,16 @@ func (*Service) GetDiff(ctx context.Context, repo string, id uint64, opt *change
		return nil, os.ErrNotExist
	}
	return s.changes[0].Diff, nil
}

// threadType is the notifications thread type for this service.
const threadType = "Change"

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

var shurcool = users.User{
	UserSpec: users.UserSpec{
		ID:     1924134,
		Domain: "github.com",
	},
githubapi/githubapi.go
@@ -767,11 +767,11 @@ func externalizeReaction(reaction reactions.EmojiID) (githubql.ReactionContent,

// threadType is the notifications thread type for this service.
const threadType = "PullRequest"

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

// 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