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 +4 -4
- data/lib/chat/message.rb +4 -3
- data/lib/services/chat.rb +2 -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: caac78867c36b5135e50817e3df241d6b94dd0004c308d5b333975eccf608a5a
|
4
|
+
data.tar.gz: 731bb37bb61654a7f510709621d43e7a3643a90682ddc0ecd145a02ede6ca758
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|