@@ -55,7 +55,6 @@ func (ar *AnswerActivityRepo) SaveAcceptAnswerActivity(ctx context.Context, op *
5555 return nil
5656 }
5757
58- ar .data .DB .ShowSQL (true )
5958 // save activity
6059 _ , err = ar .data .DB .Transaction (func (session * xorm.Session ) (result any , err error ) {
6160 session = session .Context (ctx )
@@ -311,12 +310,11 @@ func (ar *AnswerActivityRepo) sendAcceptAnswerNotification(
311310 Type : schema .NotificationTypeAchievement ,
312311 ObjectID : op .AnswerObjectID ,
313312 ReceiverUserID : act .ActivityUserID ,
313+ TriggerUserID : act .TriggerUserID ,
314314 }
315315 if act .ActivityUserID == op .QuestionUserID {
316- msg .TriggerUserID = op .AnswerUserID
317316 msg .ObjectType = constant .AnswerObjectType
318317 } else {
319- msg .TriggerUserID = op .QuestionUserID
320318 msg .ObjectType = constant .AnswerObjectType
321319 }
322320 if msg .TriggerUserID != msg .ReceiverUserID {
@@ -329,9 +327,9 @@ func (ar *AnswerActivityRepo) sendAcceptAnswerNotification(
329327 ReceiverUserID : act .ActivityUserID ,
330328 Type : schema .NotificationTypeInbox ,
331329 ObjectID : op .AnswerObjectID ,
330+ TriggerUserID : op .TriggerUserID ,
332331 }
333332 if act .ActivityUserID != op .QuestionUserID {
334- msg .TriggerUserID = op .QuestionUserID
335333 msg .ObjectType = constant .AnswerObjectType
336334 msg .NotificationAction = constant .NotificationAcceptAnswer
337335 ar .notificationQueueService .Send (ctx , msg )
@@ -343,15 +341,14 @@ func (ar *AnswerActivityRepo) sendCancelAcceptAnswerNotification(
343341 ctx context.Context , op * schema.AcceptAnswerOperationInfo ) {
344342 for _ , act := range op .Activities {
345343 msg := & schema.NotificationMsg {
344+ TriggerUserID : act .TriggerUserID ,
346345 ReceiverUserID : act .ActivityUserID ,
347346 Type : schema .NotificationTypeAchievement ,
348347 ObjectID : op .AnswerObjectID ,
349348 }
350349 if act .ActivityUserID == op .QuestionObjectID {
351- msg .TriggerUserID = op .AnswerObjectID
352350 msg .ObjectType = constant .QuestionObjectType
353351 } else {
354- msg .TriggerUserID = op .QuestionObjectID
355352 msg .ObjectType = constant .AnswerObjectType
356353 }
357354 if msg .TriggerUserID != msg .ReceiverUserID {
0 commit comments