ruboty-slack_rtm 3.1.1 → 3.2.0

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: 192cc29d094f0ebc80588eaab885bbf3b7e45bda878579ef8e72f96cf66a5dac
4
- data.tar.gz: 2cc3c8b63c9f434ebdfe62d1c87867da62410da1d9c5c9af4eaf81639e059aba
3
+ metadata.gz: 9bd44ee1547d957dde6233b843c3782ec588d176d82905663b17fec77a414a8d
4
+ data.tar.gz: 3e35b643ad57dadbdcf903528b19093d1b34199295022296143f2820bf6f33f5
5
5
  SHA512:
6
- metadata.gz: 3961b9798ee4ce5adea2b25ae8a4a37fdb9feec86fcd01a93db038116bbec0a66b0f3fe90f9cf5e1d1bc7588c31be77f613ee57be1b8d6e7b67cca1cb297182d
7
- data.tar.gz: 33b07949f4640e5b36a9f57c6625cde2d27d901ee0399de99ab181ff67c4e7154c6122dc4c1ab070b75995f1cf00ff119c1e864b23582b8089f1d42131500a9e
6
+ metadata.gz: ea4276ca5f71db7d59fe5d17c8d45f7f69946a41329fc687e7c608c67eec60c5f3f5f58c4f3038d2c4fa8bf3810e21844c3b2dc29b3b92d20e465d539cfa8463
7
+ data.tar.gz: 88d98fc0232e198c3f0af2ef1ed2915a3ac75d6704f25bedde44631da75cbc36341d8e2cb1efeffce2b81f5e2bd2211429e0eb735cfda921493d1dc7d95ce977
@@ -36,7 +36,8 @@ module Ruboty
36
36
  parse: message[:parse] || 'full',
37
37
  unfurl_links: true,
38
38
  as_user: true,
39
- attachments: message[:attachments].to_json
39
+ attachments: message[:attachments].to_json,
40
+ thread_ts: message[:thread_ts] || message[:original][:thread_ts]
40
41
  )
41
42
  elsif message[:file]
42
43
  path = message[:file][:path]
@@ -46,14 +47,16 @@ module Ruboty
46
47
  file: Faraday::UploadIO.new(path, message[:file][:content_type]),
47
48
  title: message[:file][:title] || path,
48
49
  filename: File.basename(path),
49
- initial_comment: message[:body] || ''
50
+ initial_comment: message[:body] || '',
51
+ thread_ts: message[:thread_ts] || message[:original][:thread_ts]
50
52
  )
51
53
  else
52
54
  client.chat_postMessage(
53
55
  channel: channel,
54
56
  text: message[:code] ? "```\n#{message[:body]}\n```" : resolve_send_mention(message[:body]),
55
57
  as_user: true,
56
- mrkdwn: true
58
+ mrkdwn: true,
59
+ thread_ts: message[:thread_ts] || message[:original][:thread_ts]
57
60
  )
58
61
  end
59
62
  end
@@ -156,6 +159,8 @@ module Ruboty
156
159
  to: channel_to,
157
160
  channel: channel,
158
161
  user: user,
162
+ ts: data['ts'],
163
+ thread_ts: data['thread_ts'],
159
164
  time: Time.at(data['ts'].to_f)
160
165
  }
161
166
 
@@ -237,7 +242,7 @@ module Ruboty
237
242
  end
238
243
 
239
244
  def resolve_send_mention(text)
240
- text = text.to_s
245
+ text = text.dup.to_s
241
246
  text.gsub!(/@(?<mention>[0-9a-z._-]+)/) do |_|
242
247
  mention = Regexp.last_match[:mention]
243
248
  msg = "@#{mention}"
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module SlackRTM
3
- VERSION = '3.1.1'
3
+ VERSION = '3.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-slack_rtm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Kusano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-30 00:00:00.000000000 Z
11
+ date: 2019-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -147,8 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
- rubyforge_project:
151
- rubygems_version: 2.7.6
150
+ rubygems_version: 3.0.6
152
151
  signing_key:
153
152
  specification_version: 4
154
153
  summary: Slack real time messaging adapter for Ruboty