Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2016-12-13 21:52:41 +0300
committerZ.J. van de Weg <git@zjvandeweg.nl>2016-12-16 14:21:09 +0300
commit87d160634dfdaacd0dc382c26932786382d1be34 (patch)
tree3eb381dd13f1ebd0acdf6c5364f9c2639e057b26 /app/helpers/mattermost_helper.rb
parentdd385c7c3d3046da18c6c251bce25afab1129662 (diff)
Base work for auto config MM slash commands
Diffstat (limited to 'app/helpers/mattermost_helper.rb')
-rw-r--r--app/helpers/mattermost_helper.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/helpers/mattermost_helper.rb b/app/helpers/mattermost_helper.rb
new file mode 100644
index 00000000000..83434c20c2b
--- /dev/null
+++ b/app/helpers/mattermost_helper.rb
@@ -0,0 +1,13 @@
+module MattermostHelper
+ def mattermost_teams_for(current_user)
+ return unless Gitlab.config.mattermost.enabled
+ # Hack to make frontend work better
+ return [{"id"=>"qz8gdr1fopncueb8n9on8ohk3h", "create_at"=>1479992105904, "update_at"=>1479992105904, "delete_at"=>0, "display_name"=>"chatops", "name"=>"chatops", "email"=>"admin@example.com", "type"=>"O", "company_name"=>"", "allowed_domains"=>"", "invite_id"=>"gthxi47gj7rxtcx6zama63zd1w", "allow_open_invite"=>false}]
+
+
+ host = Gitlab.config.mattermost.host
+ Mattermost::Mattermost.new(host, current_user).with_session do
+ Mattermost::Team.all
+ end
+ end
+end