Skip to content

Avoid mailing users that have explicitly unwatched an issue (#10475)#10500

Merged
jolheiser merged 2 commits into
go-gitea:release/v1.11from
6543-forks:backports_10475
Feb 27, 2020
Merged

Avoid mailing users that have explicitly unwatched an issue (#10475)#10500
jolheiser merged 2 commits into
go-gitea:release/v1.11from
6543-forks:backports_10475

Conversation

@6543
Copy link
Copy Markdown
Member

@6543 6543 commented Feb 27, 2020

backports #10475

Comment thread models/issue_watch.go Outdated
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 27, 2020
Comment thread models/issue_watch.go Outdated
@lafriks lafriks added this to the 1.11.2 milestone Feb 27, 2020
@6543
Copy link
Copy Markdown
Member Author

6543 commented Feb 27, 2020

@guillep2k done

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 27, 2020
@strk
Copy link
Copy Markdown
Member

strk commented Feb 27, 2020

I understand this is a backport so LGTM (just to move things further) but it doesn't seem clean to call that getIssuesWatchers twice, rather I'd expect such a function to internally remove explicit unsubscribers...

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 27, 2020
@jolheiser jolheiser merged commit 50f2e90 into go-gitea:release/v1.11 Feb 27, 2020
@6543 6543 deleted the backports_10475 branch February 27, 2020 17:45
@6543
Copy link
Copy Markdown
Member Author

6543 commented Feb 27, 2020

@strk it doesnt work that way ... since you can "watch" via repo watch or participants or issuewatch ... and there are 3 types of issuewatch:

    1. No entry in table (so it use default witch is not subscribed unless you watch the repo or have participated)
    1. IssueWatch.IsWatching = true; explicit watch
    1. IssueWatch.IsWatching = false; explicit DONT watch

So i can query the userIDs in two functioncalls or query all IssueWatch entrys for a issue and itterate throu it fo set / unset ...

@zeripath zeripath changed the title [BugFix] Avoid mailing explicit unwatched (#10475) Avoid mailing users that have explicitly unwatched an issue (#10475) Mar 6, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants