selfsdk 0.0.213 → 0.0.214

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c44f95481498c04841cc27d63e1d4679731fc737fa5cf96c3f43ac4b44adb7c
4
- data.tar.gz: 9b06c25e8b5fd7f4e0ac8a1a8122cc54168667cd12506c6ed79a19e0972a51ea
3
+ metadata.gz: caac78867c36b5135e50817e3df241d6b94dd0004c308d5b333975eccf608a5a
4
+ data.tar.gz: 731bb37bb61654a7f510709621d43e7a3643a90682ddc0ecd145a02ede6ca758
5
5
  SHA512:
6
- metadata.gz: dffe0e77a790820b9f1b7ad295faec45065aa14e11519d7bee64fee780407725c663eba97119f6359d9b42323ee56e7cceb309c28c86e0389ee94fee1b1a41a8
7
- data.tar.gz: 661d97ca82d68bd1fb356f42550e820375d9e15a3a2695fe424c90e320d51b77f2a60a54eefd1655cc85d3c06bc4efc67126c5dd00b62c169221f91d1a4db488
6
+ metadata.gz: 62fa8d9fbb16b3c7a362274941d9a2d58a611a7504d3885a13797f4eb5698f121787d2e7a468c647d2a5fc797cee4b6bb17b26e9e378eff678c7c495ebf6eefc
7
+ data.tar.gz: e09193c23e2119e2d6b9471a15fa0f5966e7e966e599ef51f093dc96e6aafccfc5d00e411a0397c6ccb66cabb33e18f59840a4781baa740331015295803449b0
data/lib/chat/message.rb CHANGED
@@ -5,13 +5,15 @@
5
5
  module SelfSDK
6
6
  module Chat
7
7
  class Message
8
- attr_accessor :gid, :body, :from, :payload, :recipients, :objects
8
+ attr_accessor :gid, :body, :from, :payload, :recipients, :objects, :rid, :cid
9
9
 
10
10
  def initialize(chat, recipients, payload, auth_token, self_url)
11
11
  @chat = chat
12
12
  @recipients = recipients
13
13
  @recipients = [@recipients] if @recipients.is_a? String
14
14
  @gid = payload[:gid] if payload.key? :gid
15
+ @rid = payload[:rid] if payload.key? :rid
16
+ @cid = payload[:cid] if payload.key? :cid
15
17
  @payload = payload
16
18
  @payload[:jti] = SecureRandom.uuid unless @payload.include?(:jti)
17
19
  @body = @payload[:msg]
@@ -69,8 +71,7 @@ module SelfSDK
69
71
  # @param body [string] the new message body.
70
72
  #
71
73
  # @return ChatMessage
72
- def respond(body)
73
- opts = {}
74
+ def respond(body, opts = {})
74
75
  opts[:aud] = @payload[:gid] if @payload.key? :gid
75
76
  opts[:gid] = @payload[:gid] if @payload.key? :gid
76
77
  opts[:rid] = @payload[:jti]
data/lib/services/chat.rb CHANGED
@@ -35,6 +35,8 @@ module SelfSDK
35
35
  payload[:gid] = opts[:gid] if opts.key? :gid
36
36
  payload[:rid] = opts[:rid] if opts.key? :rid
37
37
  payload[:objects] = opts[:objects] if opts.key? :objects
38
+ payload[:cid] = opts[:cid] if opts.key? :cid
39
+ payload[:data] = opts[:data] if opts.key? :data
38
40
 
39
41
  m = SelfSDK::Chat::Message.new(self, recipients, payload, @jwt.auth_token, @self_url)
40
42
  _req = send(m.recipients, m.payload)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selfsdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.213
4
+ version: 0.0.214
5
5
  platform: ruby
6
6
  authors:
7
7
  - Self Group Ltd.