selfsdk 0.0.192 → 0.0.193
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chat/file_object.rb +15 -2
- data/lib/services/facts.rb +4 -0
- 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: ce09c8f8b8cb4daafea4f4d94f2d1110fd376e8811a9e30f2703a8add593d5ab
|
4
|
+
data.tar.gz: 44d649bce5e7f0d0789954fdde6bbc47896b474a95af8eb536913f1bf5ef8712
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26aad938c2d5c2e0cc2328eb9639f2e15b46805de03f97456cead55d005a21942f13078db7ce75ad6507d134777040e1698a17cab8c9caf075d52407f48222b3
|
7
|
+
data.tar.gz: 39ebfd842ec43b0b425b843dc9cfbf557dff14d5aa411ebd0fb8645ab7f09e81fcb5d71dd134154d9b0d80c6b891416309adf4d2ef285f8f9203cbbd80c834dc
|
data/lib/chat/file_object.rb
CHANGED
@@ -6,7 +6,7 @@ require 'open-uri'
|
|
6
6
|
module SelfSDK
|
7
7
|
module Chat
|
8
8
|
class FileObject
|
9
|
-
attr_accessor :link, :mime, :content, :key, :nonce, :ciphertext
|
9
|
+
attr_accessor :name, :link, :mime, :content, :key, :nonce, :ciphertext
|
10
10
|
|
11
11
|
def initialize(token, url)
|
12
12
|
@token = token
|
@@ -35,7 +35,20 @@ module SelfSDK
|
|
35
35
|
# Incoming objects
|
36
36
|
def build_from_object(input)
|
37
37
|
# Download from CDN
|
38
|
-
ciphertext =
|
38
|
+
ciphertext = ""
|
39
|
+
5.times do
|
40
|
+
begin
|
41
|
+
ciphertext = URI.open(input[:link], "Authorization" => "Bearer #{@token}").read
|
42
|
+
break
|
43
|
+
rescue
|
44
|
+
sleep 1
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
if ciphertext.empty?
|
49
|
+
SelfSDK.logger.warn "unable to process incoming object"
|
50
|
+
return
|
51
|
+
end
|
39
52
|
|
40
53
|
@content = ciphertext
|
41
54
|
@key = nil
|
data/lib/services/facts.rb
CHANGED