tdlib-ruby 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog.md +4 -0
- data/bin/console +17 -0
- data/lib/tdlib/client.rb +5 -1
- data/lib/tdlib/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ea47ef95a69ccc2fb0ae4afbead9e2ac1470e00
|
4
|
+
data.tar.gz: 79edb08342b7faf196eed3b835577e50ac60a4cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 349c0798e5b74134458564fa1303bc93de4ceb23ffdbef04ddc54f23cb9904daa1dbaa33b37dba592d39170ed330e9940c11f4f58c9a5b1ffe524595c457526e
|
7
|
+
data.tar.gz: 67baf114ec3b605e1430ce611bf0c5246d575267108eb3f215494a838eeab4457d99b1b800c89ed643a260945e6b7eb880f9394690e3801949782327c82375b2
|
data/ChangeLog.md
CHANGED
data/bin/console
ADDED
@@ -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__)
|
data/lib/tdlib/client.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/tdlib/version.rb
CHANGED
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.
|
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
|