mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-21 04:30:24 +02:00
use GetUserIDsByNames for mention lookups
This commit is contained in:
parent
0084880f6a
commit
23ca3422dd
@ -130,10 +130,14 @@ func CreateCommitCommentNotification(ctx context.Context, doer *user_model.User,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Notify @mentioned users
|
// Notify @mentioned users
|
||||||
for _, username := range mentionedUsernames {
|
if len(mentionedUsernames) > 0 {
|
||||||
mentioned, err := user_model.GetUserByName(ctx, username)
|
mentionedIDs, err := user_model.GetUserIDsByNames(ctx, mentionedUsernames, true)
|
||||||
if err == nil && mentioned.ID != doer.ID {
|
if err == nil {
|
||||||
receiverIDs[mentioned.ID] = struct{}{}
|
for _, id := range mentionedIDs {
|
||||||
|
if id != doer.ID {
|
||||||
|
receiverIDs[id] = struct{}{}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user