This commit is contained in:
kolaente 2021-02-13 20:41:27 +01:00
parent 5c2295607c
commit a7c5f327be
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 0 deletions

View File

@ -83,6 +83,10 @@ func (et SubscriptionEntityType) validate() error {
return &ErrUnknownSubscriptionEntityType{EntityType: et}
}
// Returns a matching subscription for an entity and user.
// It will return the next parent of a subscription. That means for tasks, it will first look for a subscription for
// that task, if there is none it will look for a subscription on the list the task belongs to and if that also
// doesn't exist it will check for a subscription for the namespace the list is belonging to.
func getSubscription(s *xorm.Session, entityType SubscriptionEntityType, a web.Auth, entityID int64) (subscription *Subscription, err error) {
u, is := a.(*user.User)
if !is {