mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Extract createComment (#9125)
* Extract createComment * fix lint * fix lint
This commit is contained in:
		
				
					committed by
					
						
						techknowlogick
					
				
			
			
				
	
			
			
			
						parent
						
							7c6f2e27be
						
					
				
				
					commit
					2011a5b818
				
			@@ -131,18 +131,22 @@ func (issue *Issue) toggleAssignee(sess *xorm.Session, doer *User, assigneeID in
 | 
			
		||||
		return false, nil, fmt.Errorf("loadRepo: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Comment
 | 
			
		||||
	comment, err = createComment(sess, &CreateCommentOptions{
 | 
			
		||||
	var opts = &CreateCommentOptions{
 | 
			
		||||
		Type:            CommentTypeAssignees,
 | 
			
		||||
		Doer:            doer,
 | 
			
		||||
		Repo:            issue.Repo,
 | 
			
		||||
		Issue:           issue,
 | 
			
		||||
		RemovedAssignee: removed,
 | 
			
		||||
		AssigneeID:      assigneeID,
 | 
			
		||||
	})
 | 
			
		||||
	}
 | 
			
		||||
	// Comment
 | 
			
		||||
	comment, err = createCommentWithNoAction(sess, opts)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return false, nil, fmt.Errorf("createComment: %v", err)
 | 
			
		||||
	}
 | 
			
		||||
	if err = sendCreateCommentAction(sess, opts, comment); err != nil {
 | 
			
		||||
		return false, nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// if pull request is in the middle of creation - don't call webhook
 | 
			
		||||
	if isCreate {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user