From 5f20512601cecfa190172c389a4d51ae8a6e4322 Mon Sep 17 00:00:00 2001 From: Eeshan Garg Date: Mon, 23 Apr 2018 18:38:16 -0230 Subject: [PATCH] integrations/git: Allow users to specify a stream for notifications. Previously, all notifications went to "commits", now users can modify the constant at the top to change that. --- zulip/integrations/git/zulip_git_config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zulip/integrations/git/zulip_git_config.py b/zulip/integrations/git/zulip_git_config.py index 6ba36b8..0ab0eb0 100644 --- a/zulip/integrations/git/zulip_git_config.py +++ b/zulip/integrations/git/zulip_git_config.py @@ -22,6 +22,9 @@ from typing import Dict, Text, Optional +# Name of the stream to send notifications to, default is "commits" +STREAM_NAME = 'commits' + # Change these values to configure authentication for the plugin ZULIP_USER = "git-bot@example.com" ZULIP_API_KEY = "0123456789abcdef0123456789abcdef" @@ -44,7 +47,7 @@ ZULIP_API_KEY = "0123456789abcdef0123456789abcdef" def commit_notice_destination(repo, branch, commit): # type: (Text, Text, Text) -> Optional[Dict[Text, Text]] if branch in ["master", "test-post-receive"]: - return dict(stream = "commits", + return dict(stream = STREAM_NAME, subject = u"%s" % (branch,)) # Return None for cases where you don't want a notice sent