This is an automated email from the ASF dual-hosted git repository.
linkinstar pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/answer.git
The following commit(s) were added to refs/heads/dev by this push:
new 7a8afbb3 add new question notification trigger user
7a8afbb3 is described below
commit 7a8afbb3535e63d575a9740f85333d14c0a8d92f
Author: Neko <[email protected]>
AuthorDate: Fri Aug 29 17:38:26 2025 +0800
add new question notification trigger user
---
internal/service/notification/new_question_notification.go | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/internal/service/notification/new_question_notification.go
b/internal/service/notification/new_question_notification.go
index 8911967a..8a12d0b8 100644
--- a/internal/service/notification/new_question_notification.go
+++ b/internal/service/notification/new_question_notification.go
@@ -279,5 +279,17 @@ func (ns *ExternalNotificationService)
newPluginQuestionNotification(
raw.QuestionUrl = display.QuestionURL(
seoInfo.Permalink, siteInfo.SiteUrl,
msg.NewQuestionTemplateRawData.QuestionID,
msg.NewQuestionTemplateRawData.QuestionTitle)
+ if len(msg.NewQuestionTemplateRawData.QuestionAuthorUserID) > 0 {
+ triggerUser, exist, err := ns.userRepo.GetByUserID(ctx,
msg.NewQuestionTemplateRawData.QuestionAuthorUserID)
+ if err != nil {
+ log.Errorf("get trigger user basic info failed: %v",
err)
+ return
+ }
+ if exist {
+ raw.TriggerUserID = triggerUser.ID
+ raw.TriggerUserDisplayName = triggerUser.DisplayName
+ raw.TriggerUserUrl = display.UserURL(siteInfo.SiteUrl,
triggerUser.Username)
+ }
+ }
return raw
}