From 3eb8e97f3758e71e21930ad4d0312e39e6494345 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Thu, 6 Jun 2019 09:51:40 +0800 Subject: [PATCH] DEV: Remove deprecation warning. --- .../provider/telegram/telegram_initializer.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/discourse_chat/provider/telegram/telegram_initializer.rb b/lib/discourse_chat/provider/telegram/telegram_initializer.rb index 6360147..6b36afd 100644 --- a/lib/discourse_chat/provider/telegram/telegram_initializer.rb +++ b/lib/discourse_chat/provider/telegram/telegram_initializer.rb @@ -1,6 +1,13 @@ # frozen_string_literal: true -DiscourseEvent.on(:site_setting_saved) do |sitesetting| +event = + if Gem::Version.new(Discourse::VERSION::STRING) > Gem::Version.new("2.3.0.beta8") + :site_setting_changed + else + :site_setting_saved + end + +DiscourseEvent.on(event) do |sitesetting| isEnabledSetting = sitesetting.name == 'chat_integration_telegram_enabled' isAccessToken = sitesetting.name == 'chat_integration_telegram_access_token'