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.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/lib/chatkit/client.rb +23 -6
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 1d23ad337a78ce6724ff5547a231cfb34e2d03558bca495a615ae68fcb88009d
4
- data.tar.gz: 94476997fcf6a26ff12ea8a9e54156473d455c72a8af66521e9ed699190fc7c2
2
+ SHA1:
3
+ metadata.gz: 694c5ae12efd9389cb34faed952830121817e7eb
4
+ data.tar.gz: d2cde40df08966c836a4dcb2eadd52755a6bcdd5
5
5
  SHA512:
6
- metadata.gz: 56206f5cd6e827d9b58e2001e6f689b75f66c708b4d0f8df758e8a91be32da79407816f96f29c1b4a0a96a8cbb1b9559a3b6d4da637db38925ed51721eb40474
7
- data.tar.gz: e224f3b913648ab438c7528e35dbc2b0420506794c22ba7785c4fd402928e7b6b9c18a0bf8da46f8235366af1c5738958223d1f67d680a49e751f1201af02f66
6
+ metadata.gz: f42f159160c95deeb612e36ffb561bd8cad59093e08b6e609d157ea53e461a0649015f386604ffc3747adac09697a00b27726f804a770fa6dcdbcedd680201ff
7
+ data.tar.gz: d38b22c3fef78a19aa3811cb8e45c689096fa72305cb7f727a13bc51311d8cb5469ef3099e0985537ba90a71f9b7f790c282706b45b8b9cbd348a2672db52432
@@ -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 send the message 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: { "Content-Type": "application/json" } })
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.6.0
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-07-30 00:00:00.000000000 Z
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.7.6
59
+ rubygems_version: 2.6.14
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: Pusher Chatkit Ruby SDK