pusher-chatkit-server 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/chatkit/client.rb +23 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 694c5ae12efd9389cb34faed952830121817e7eb
|
4
|
+
data.tar.gz: d2cde40df08966c836a4dcb2eadd52755a6bcdd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f42f159160c95deeb612e36ffb561bd8cad59093e08b6e609d157ea53e461a0649015f386604ffc3747adac09697a00b27726f804a770fa6dcdbcedd680201ff
|
7
|
+
data.tar.gz: d38b22c3fef78a19aa3811cb8e45c689096fa72305cb7f727a13bc51311d8cb5469ef3099e0985537ba90a71f9b7f790c282706b45b8b9cbd348a2672db52432
|
data/lib/chatkit/client.rb
CHANGED
@@ -362,9 +362,25 @@ module Chatkit
|
|
362
362
|
|
363
363
|
# Messages API
|
364
364
|
|
365
|
+
def fetch_multipart_message(options)
|
366
|
+
verify({
|
367
|
+
room_id: "You must provide the ID of the room to fetch the message from",
|
368
|
+
message_id: "You must provide the message ID"
|
369
|
+
}, options)
|
370
|
+
|
371
|
+
api_request({
|
372
|
+
method: "GET",
|
373
|
+
path: "/rooms/#{CGI::escape options[:room_id]}/messages/#{options[:message_id]}",
|
374
|
+
jwt: generate_su_token[:token]
|
375
|
+
})
|
376
|
+
end
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
|
365
381
|
def fetch_multipart_messages(options)
|
366
382
|
verify({
|
367
|
-
room_id: "You must provide the ID of the room to
|
383
|
+
room_id: "You must provide the ID of the room to fetch the messages from",
|
368
384
|
}, options)
|
369
385
|
|
370
386
|
if !options[:limit].nil? and options[:limit] <= 0
|
@@ -442,9 +458,7 @@ module Chatkit
|
|
442
458
|
attachment_id = upload_attachment(token, options[:room_id], part)
|
443
459
|
{
|
444
460
|
type: part[:type],
|
445
|
-
attachment: {id: attachment_id}
|
446
|
-
name: part[:name],
|
447
|
-
customData: part[:customData]
|
461
|
+
attachment: {id: attachment_id}
|
448
462
|
}.reject{ |_,v| v.nil? }
|
449
463
|
else
|
450
464
|
raise Chatkit::MissingParameterError.new("Each part must have one of :file, :content or :url")
|
@@ -691,7 +705,7 @@ module Chatkit
|
|
691
705
|
private
|
692
706
|
|
693
707
|
def make_request(instance, options)
|
694
|
-
options.merge!({ headers: {
|
708
|
+
options.merge!({ headers: { :'Content-Type' => 'application/json' } })
|
695
709
|
begin
|
696
710
|
format_response(instance.request(options))
|
697
711
|
rescue PusherPlatform::ErrorResponse => e
|
@@ -850,7 +864,10 @@ module Chatkit
|
|
850
864
|
|
851
865
|
attachment_req = {
|
852
866
|
content_type: content_type,
|
853
|
-
content_length: content_length
|
867
|
+
content_length: content_length,
|
868
|
+
name: part[:name],
|
869
|
+
origin: part[:origin],
|
870
|
+
custom_data: part[:custom_data]
|
854
871
|
}
|
855
872
|
|
856
873
|
attachment_response = api_request({
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pusher-chatkit-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pusher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pusher-platform
|
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
version: '0'
|
57
57
|
requirements: []
|
58
58
|
rubyforge_project:
|
59
|
-
rubygems_version: 2.
|
59
|
+
rubygems_version: 2.6.14
|
60
60
|
signing_key:
|
61
61
|
specification_version: 4
|
62
62
|
summary: Pusher Chatkit Ruby SDK
|