selfsdk 0.0.164 → 0.0.165
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/messaging.rb +16 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c98f4bd8df938f9c11acb72ffef83f231ddd0c1466c2b507975c5c3f1e4a8b58
|
4
|
+
data.tar.gz: 15109c43f84455b30215b905fdfa556a286a97e04da9c18e0ea7ae24bc69eecc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 747b1019940113d76d2b2bf6e5b0fe39a7178f12dedabaa5b555b71aefdfe8e60d0dbe2658b467151a4df8985c48d695dcc622f2a4583ac28491190159c0a183
|
7
|
+
data.tar.gz: c8755a17be9aeed3d189b9116ad189c4e2bb24de1f9af594c1fe1196abad63ba24a1295958e2183e0845fcaf7a29592b62608440415198fa334efa36f8752534
|
data/lib/messaging.rb
CHANGED
@@ -404,14 +404,22 @@ module SelfSDK
|
|
404
404
|
|
405
405
|
# Authenticates current client on the websocket server.
|
406
406
|
def authenticate
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
407
|
+
res = wait_for 'authentication' do
|
408
|
+
SelfSDK.logger.info "authenticating"
|
409
|
+
send_raw Msgproto::Auth.new(
|
410
|
+
type: Msgproto::MsgType::AUTH,
|
411
|
+
id: "authentication",
|
412
|
+
token: @jwt.auth_token,
|
413
|
+
device: @device_id,
|
414
|
+
offset: @offset,
|
415
|
+
)
|
416
|
+
end
|
417
|
+
|
418
|
+
return res unless res.nil?
|
419
|
+
|
420
|
+
SelfSDK.logger.info "authentication timed out, retrying ..."
|
421
|
+
close
|
422
|
+
start_connection
|
415
423
|
end
|
416
424
|
|
417
425
|
def send_raw(msg)
|