summaryrefslogtreecommitdiffstats
path: root/status_app.rb
diff options
context:
space:
mode:
authorGravatar √Čtienne Deparis 2020-03-28 14:56:25 +0100
committerGravatar √Čtienne Deparis 2020-03-28 15:12:22 +0100
commitbb226fc5b5f1f621bfd976ea48caae8fa27e83da (patch)
treeef16a0cb4e6b55fa0cb1501c61ffffb926c3f08c /status_app.rb
parent99b87beb10464bde73631a977606edde2a523a79 (diff)
downloadstatus-bb226fc5b5f1f621bfd976ea48caae8fa27e83da.tar.gz
status-bb226fc5b5f1f621bfd976ea48caae8fa27e83da.tar.xz
status-bb226fc5b5f1f621bfd976ea48caae8fa27e83da.zip
feat: Improve mattermost helper by using API calls
Diffstat (limited to 'status_app.rb')
-rw-r--r--status_app.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/status_app.rb b/status_app.rb
index a273c4b..b9a077a 100644
--- a/status_app.rb
+++ b/status_app.rb
@@ -67,6 +67,7 @@ class StatusApp < Sinatra::Base
details['eta'] = '' if details['status'] == 'present'
update_status(details, @current_status['email'])
send_mattermost_notification
+ change_mattermost_status(@current_status['status'])
redirect to("/status?#{@auth_chain}")
end
@@ -107,7 +108,7 @@ class StatusApp < Sinatra::Base
post '/mattermost' do
content_type 'application/json'
- check_token = @config.dig('mattermost', 'token')
+ check_token = @config.dig('mattermost', 'slash_token')
if !check_token || params[:token] != check_token
return JSON.dump({ 'response_type' => 'ephemeral',
'text' => 'Not authorized' })