tdlib-ruby 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7668dcf652a419af320628d4452b980fcc6b14d
4
- data.tar.gz: bdc0bbe0e4bb6a1d9b4035ac8ac620d19e5105f0
3
+ metadata.gz: 2ea47ef95a69ccc2fb0ae4afbead9e2ac1470e00
4
+ data.tar.gz: 79edb08342b7faf196eed3b835577e50ac60a4cc
5
5
  SHA512:
6
- metadata.gz: 8886e255f1410795e460fe2d39b099c88c7f4e4c1dabea0bc16eaba1cd120720a185dba71e076063e84b3d01073e07063bf1b41ea4ad77efe3cf81151e55b1fe
7
- data.tar.gz: 4d14e17af82aef8a6e9ce58e5332f3f20a74c3e25434a04c3946f22e442aea8ceb3c568111b7f83bde1f6923dfdc5f5d54521dd396da6906e7df492b5b227aa3
6
+ metadata.gz: 349c0798e5b74134458564fa1303bc93de4ceb23ffdbef04ddc54f23cb9904daa1dbaa33b37dba592d39170ed330e9940c11f4f58c9a5b1ffe524595c457526e
7
+ data.tar.gz: 67baf114ec3b605e1430ce611bf0c5246d575267108eb3f215494a838eeab4457d99b1b800c89ed643a260945e6b7eb880f9394690e3801949782327c82375b2
@@ -1,3 +1,7 @@
1
+ ### 0.9.3 / 2018-05-04
2
+
3
+ * Add proxy support
4
+
1
5
  ### 0.9.2 / 2018-05-04
2
6
 
3
7
  * Fix some potential deadlocks
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'tdlib-ruby'
5
+
6
+ TD.configure do |config|
7
+ config.lib_path = File.join(File.expand_path("#{TD.root_path}/../"), 'td', 'build')
8
+
9
+ config.client.api_id = ENV['TD_API_ID']
10
+ config.client.api_hash = ENV['TD_API_HASH']
11
+ config.client.use_test_dc = true
12
+ end
13
+
14
+ TD::Api.set_log_verbosity_level(1)
15
+
16
+ require 'irb'
17
+ IRB.start(__FILE__)
@@ -62,10 +62,12 @@ class TD::Client
62
62
 
63
63
  def initialize(td_client = TD::Api.client_create,
64
64
  update_manager = TD::UpdateManager.new(td_client),
65
+ proxy: { '@type' => 'proxyEmpty' },
65
66
  **extra_config)
66
67
  @td_client = td_client
67
68
  @update_manager = update_manager
68
69
  @config = TD.config.client.to_h.merge(extra_config)
70
+ @proxy = proxy
69
71
  @ready_condition_mutex = Mutex.new
70
72
  @ready_condition = ConditionVariable.new
71
73
  authorize
@@ -98,9 +100,10 @@ class TD::Client
98
100
  result = nil
99
101
  mutex = Mutex.new
100
102
  handler = ->(update) do
101
- next unless update['@extra'] == extra
103
+ return unless update['@extra'] == extra
102
104
  mutex.synchronize do
103
105
  result = update
106
+ @update_manager.remove_handler(handler)
104
107
  condition.signal
105
108
  end
106
109
  end
@@ -174,6 +177,7 @@ class TD::Client
174
177
  when 'authorizationStateWaitEncryptionKey'
175
178
  broadcast(encryption_key_query)
176
179
  else
180
+ broadcast('@type' => 'setProxy', 'proxy' => @proxy)
177
181
  @update_manager.remove_handler(handler)
178
182
  @ready_condition_mutex.synchronize do
179
183
  @ready = true
@@ -1,4 +1,4 @@
1
1
  module TD
2
2
  # tdlib-ruby version
3
- VERSION = "0.9.2"
3
+ VERSION = "0.9.3"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdlib-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Southbridge
@@ -110,7 +110,8 @@ dependencies:
110
110
  version: '0.11'
111
111
  description: Ruby bindings and client for TDlib
112
112
  email: ask@southbridge.io
113
- executables: []
113
+ executables:
114
+ - console
114
115
  extensions: []
115
116
  extra_rdoc_files: []
116
117
  files:
@@ -124,6 +125,7 @@ files:
124
125
  - LICENSE.txt
125
126
  - README.md
126
127
  - Rakefile
128
+ - bin/console
127
129
  - lib/tdlib-ruby.rb
128
130
  - lib/tdlib/api.rb
129
131
  - lib/tdlib/client.rb