@@ -869,23 +869,23 @@ func DeleteConversationComment(ctx *context.Context) {
869869// ChangeCommentReaction create a reaction for comment
870870func ChangeConversationCommentReaction (ctx * context.Context ) {
871871 form := web .GetForm (ctx ).(* forms.ReactionForm )
872- comment , err := conversations_model .GetCommentByID (ctx , ctx .PathParamInt64 (":id" ))
872+ conversation_comment , err := conversations_model .GetCommentByID (ctx , ctx .PathParamInt64 (":id" ))
873873 if err != nil {
874- ctx .NotFoundOrServerError ("GetCommentByID " , conversations_model .IsErrCommentNotExist , err )
874+ ctx .NotFoundOrServerError ("GetConversationCommentByID " , conversations_model .IsErrCommentNotExist , err )
875875 return
876876 }
877877
878- if err := comment .LoadConversation (ctx ); err != nil {
878+ if err := conversation_comment .LoadConversation (ctx ); err != nil {
879879 ctx .NotFoundOrServerError ("LoadConversation" , conversations_model .IsErrConversationNotExist , err )
880880 return
881881 }
882882
883- if comment .Conversation .RepoID != ctx .Repo .Repository .ID {
883+ if conversation_comment .Conversation .RepoID != ctx .Repo .Repository .ID {
884884 ctx .NotFound ("CompareRepoID" , conversations_model.ErrCommentNotExist {})
885885 return
886886 }
887887
888- if ! ctx .IsSigned || (ctx .Doer .ID != comment .PosterID && ! ctx .Repo .CanReadConversations ()) {
888+ if ! ctx .IsSigned || (ctx .Doer .ID != conversation_comment .PosterID && ! ctx .Repo .CanReadConversations ()) {
889889 if log .IsTrace () {
890890 if ctx .IsSigned {
891891 conversationType := "conversations"
@@ -904,50 +904,50 @@ func ChangeConversationCommentReaction(ctx *context.Context) {
904904 return
905905 }
906906
907- if ! comment .Type .HasContentSupport () {
907+ if ! conversation_comment .Type .HasContentSupport () {
908908 ctx .Error (http .StatusNoContent )
909909 return
910910 }
911911
912912 switch ctx .PathParam (":action" ) {
913913 case "react" :
914- reaction , err := conversation_service .CreateCommentReaction (ctx , ctx .Doer , comment , form .Content )
914+ reaction , err := conversation_service .CreateCommentReaction (ctx , ctx .Doer , conversation_comment , form .Content )
915915 if err != nil {
916916 if conversations_model .IsErrForbiddenConversationReaction (err ) || errors .Is (err , user_model .ErrBlockedUser ) {
917917 ctx .ServerError ("ChangeConversationReaction" , err )
918918 return
919919 }
920- log .Info ("CreateCommentReaction : %s" , err )
920+ log .Info ("CreateConversationCommentReaction : %s" , err )
921921 break
922922 }
923923 // Reload new reactions
924- comment .Reactions = nil
925- if err = comment .LoadReactions (ctx , ctx .Repo .Repository ); err != nil {
926- log .Info ("comment .LoadReactions: %s" , err )
924+ conversation_comment .Reactions = nil
925+ if err = conversation_comment .LoadReactions (ctx , ctx .Repo .Repository ); err != nil {
926+ log .Info ("conversation_comment .LoadReactions: %s" , err )
927927 break
928928 }
929929
930- log .Trace ("Reaction for comment created: %d/%d/%d/%d" , ctx .Repo .Repository .ID , comment .Conversation .ID , comment .ID , reaction .ID )
930+ log .Trace ("Reaction for comment created: %d/%d/%d/%d" , ctx .Repo .Repository .ID , conversation_comment .Conversation .ID , conversation_comment .ID , reaction .ID )
931931 case "unreact" :
932- if err := conversations_model .DeleteCommentReaction (ctx , ctx .Doer .ID , comment .Conversation .ID , comment .ID , form .Content ); err != nil {
933- ctx .ServerError ("DeleteCommentReaction " , err )
932+ if err := conversations_model .DeleteCommentReaction (ctx , ctx .Doer .ID , conversation_comment .Conversation .ID , conversation_comment .ID , form .Content ); err != nil {
933+ ctx .ServerError ("DeleteConversationCommentReaction " , err )
934934 return
935935 }
936936
937937 // Reload new reactions
938- comment .Reactions = nil
939- if err = comment .LoadReactions (ctx , ctx .Repo .Repository ); err != nil {
938+ conversation_comment .Reactions = nil
939+ if err = conversation_comment .LoadReactions (ctx , ctx .Repo .Repository ); err != nil {
940940 log .Info ("comment.LoadReactions: %s" , err )
941941 break
942942 }
943943
944- log .Trace ("Reaction for comment removed: %d/%d/%d" , ctx .Repo .Repository .ID , comment .Conversation .ID , comment .ID )
944+ log .Trace ("Reaction for conversation comment removed: %d/%d/%d" , ctx .Repo .Repository .ID , conversation_comment .Conversation .ID , conversation_comment .ID )
945945 default :
946946 ctx .NotFound (fmt .Sprintf ("Unknown action %s" , ctx .PathParam (":action" )), nil )
947947 return
948948 }
949949
950- if len (comment .Reactions ) == 0 {
950+ if len (conversation_comment .Reactions ) == 0 {
951951 ctx .JSON (http .StatusOK , map [string ]any {
952952 "empty" : true ,
953953 "html" : "" ,
@@ -956,8 +956,8 @@ func ChangeConversationCommentReaction(ctx *context.Context) {
956956 }
957957
958958 html , err := ctx .RenderToHTML (tplReactions , map [string ]any {
959- "ActionURL" : fmt .Sprintf ("%s/conversations/comments/%d/reactions" , ctx .Repo .RepoLink , comment .ID ),
960- "Reactions" : comment .Reactions .GroupByType (),
959+ "ActionURL" : fmt .Sprintf ("%s/conversations/comments/%d/reactions" , ctx .Repo .RepoLink , conversation_comment .ID ),
960+ "Reactions" : conversation_comment .Reactions .GroupByType (),
961961 })
962962 if err != nil {
963963 ctx .ServerError ("ChangeCommentReaction.HTMLString" , err )
0 commit comments