Skip to content

Commit 0b24544

Browse files
Merge pull request #43 from southbridgeio/develop
Release 0.4.0
2 parents 796c0cf + fa1acdd commit 0b24544

25 files changed

+246
-44
lines changed

.travis.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
language: ruby
22
rvm:
3-
- 2.3.8
4-
- 2.6.0
3+
- 2.4.9
4+
- 2.6.5
5+
- 2.7.0
56

67
branches:
78
only:
@@ -13,7 +14,12 @@ addons:
1314

1415
env:
1516
- REDMINE_VER=3.4-stable
16-
- REDMINE_VER=4.0-stable
17+
- REDMINE_VER=4.1-stable
18+
19+
matrix:
20+
exclude:
21+
- env: REDMINE_VER=3.4-stable
22+
rvm: 2.7.0
1723

1824
install: "echo skip bundle install"
1925

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# 0.4.0
2+
3+
* Handle Faraday::ClientError in MessageSender
4+
* Handle deactivated user error in message sender
5+
* Force ipv4 when using proxy
6+
* Improve proxy availability check
7+
* Close supergroups properly
8+
* Rescue from chat not found errors
9+
* Increase sleep time for flood error
10+
* Handle forbidden errors in message sender
11+
* Use sleep time from error data
12+
* Add zh-TW locale
13+
* Handle "message not modified errors"
14+
* Increase rate limits, add exponential retry
15+
* Support tdlib 1.6
16+
117
# 0.3.1
218

319
* Fix Rails 4 support

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ gem 'sidekiq-cron'
33
gem 'sidekiq-rate-limiter', git: 'https://github.com/centosadmin/sidekiq-rate-limiter', branch: 'master',
44
require: 'sidekiq-rate-limiter/server'
55

6-
gem 'telegram-bot-ruby', '~> 0.8.6'
6+
gem 'telegram-bot-ruby', '>= 0.11', '< 1.0'
77
gem 'slack-ruby-bot'
88
gem 'celluloid-io'
9-
gem 'tdlib-ruby', '2.0.0'
9+
gem 'tdlib-ruby', '2.2.0'
1010
gem 'jwt'
1111
gem 'filelock'
1212
gem 'patron'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This plugin provides common stuff to build redmine plugins that involve Slack/Te
77

88
## Requirements
99

10-
* Ruby 2.3+
10+
* Ruby 2.4+
1111
* Redmine 3.4+
1212
* [redmine_sidekiq](https://github.com/southbridgeio/redmine_sidekiq) (also requires Redis)
1313

app/controllers/telegram_login_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def context
3434
def handle_auth_result(auth, user)
3535
if auth.success?
3636
if user != User.current
37-
user.update!(two_fa_id: AuthSource.find_by_name('Telegram').id)
37+
user.update!(two_fa: 'telegram')
3838
successful_authentication(user)
3939
else
4040
redirect_to my_page_path, notice: t('redmine_bots.telegram.bot.login.success')

app/controllers/telegram_proxies_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def update
2525
proxy.save
2626
end
2727

28+
TelegramProxyMonitoringWorker.perform_async
29+
2830
respond_to do |format|
2931
format.js
3032
end

app/models/telegram_proxy.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ def check!
3636

3737
def connection
3838
Faraday.new('https://telegram.org') do |conn|
39-
conn.adapter(:patron) { |adapter| adapter.proxy = url }
39+
conn.adapter(:patron) do |adapter|
40+
adapter.proxy = url
41+
adapter.force_ipv4 = true
42+
end
4043
end
4144
end
4245
end

app/views/telegram_proxies/_item.html.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<%= hidden_field_tag 'proxies[][id]', proxy.id %>
33
<%= text_field_tag 'proxies[][url]', proxy.url, style: 'width: 50%' %>
44

5+
<% icon, locale = proxy.alive? ? %w[icon-ok proxy_alive] : %w[icon-error proxy_dead] %>
6+
57
<% unless proxy.new_record? %>
8+
<span class="icon <%= icon %>" title="<%= t locale, scope: 'redmine_bots.settings.telegram' %>"></span>
69
<%= link_to l(:button_delete), telegram_proxy_destroy_path(id: proxy.id), remote: true, method: :delete %>
710
<% end %>
811
</p>

config/locales/en.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ en:
3030
bot_use_proxy: Use proxy for bot
3131
proxy_settings: Proxy settings
3232
proxy_list: Proxy list
33+
proxy_alive: Proxy is accessible
34+
proxy_dead: Proxy is not accessible
3335
requirements:
3436
title: Requirements
3537
telegram:

config/locales/ru.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ ru:
3131
bot_use_proxy: Использовать прокси для бота
3232
proxy_settings: Настройки прокси
3333
proxy_list: Список прокси
34+
proxy_alive: Прокси доступен
35+
proxy_dead: Прокси недоступен
3436
requirements:
3537
title: Требования
3638
telegram:

0 commit comments

Comments
 (0)