mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	integrations: Separate issue milestoned events in GitHub Integration.
This commit creates separate events for issue milestoned and demilestoned notifications. This allows the end-users to choose whether they want these notifications or not. Fixes #25793.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							34f31ab9d2
						
					
				
				
					commit
					328c104424
				
			@@ -162,10 +162,6 @@ def get_issue_body(helper: Helper) -> str:
 | 
			
		||||
    action = payload["action"].tame(check_string)
 | 
			
		||||
    issue = payload["issue"]
 | 
			
		||||
    has_assignee = "assignee" in payload
 | 
			
		||||
 | 
			
		||||
    if action in ("milestoned", "demilestoned"):
 | 
			
		||||
        return get_issue_milestoned_or_demilestoned_body(helper)
 | 
			
		||||
 | 
			
		||||
    base_message = get_issue_event_message(
 | 
			
		||||
        user_name=get_sender_name(payload),
 | 
			
		||||
        action=action,
 | 
			
		||||
@@ -750,6 +746,7 @@ EVENT_FUNCTION_MAPPER: Dict[str, Callable[[Helper], str]] = {
 | 
			
		||||
    "gollum": get_wiki_pages_body,
 | 
			
		||||
    "issue_comment": get_issue_comment_body,
 | 
			
		||||
    "issue_labeled_or_unlabeled": get_issue_labeled_or_unlabeled_body,
 | 
			
		||||
    "issue_milestoned_or_demilestoned": get_issue_milestoned_or_demilestoned_body,
 | 
			
		||||
    "issues": get_issue_body,
 | 
			
		||||
    "member": get_member_body,
 | 
			
		||||
    "membership": get_membership_body,
 | 
			
		||||
@@ -906,6 +903,8 @@ def get_zulip_event_name(
 | 
			
		||||
        action = payload["action"].tame(check_string)
 | 
			
		||||
        if action in ("labeled", "unlabeled"):
 | 
			
		||||
            return "issue_labeled_or_unlabeled"
 | 
			
		||||
        if action in ("milestoned", "demilestoned"):
 | 
			
		||||
            return "issue_milestoned_or_demilestoned"
 | 
			
		||||
        else:
 | 
			
		||||
            return "issues"
 | 
			
		||||
    elif header_event in list(EVENT_FUNCTION_MAPPER.keys()):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user