ruboty-slack_rtm 3.2.2 → 3.2.3

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: 429f0cee022b0da4ec4647dbae78fc5f095db755a7a25ed59f291742d20c5ead
4
- data.tar.gz: 5570cb0fe2e14591d36aea251aa7b5b7af29fbd010e95650500506fe7601b360
3
+ metadata.gz: a735292c902d7fc4aff589e5729f9b467a948b77bcc09f47e7348c8d60768cc5
4
+ data.tar.gz: d318bdcae1a2c3fa09842dc606b8368ac16d2de46225eab88a1ff89b68d89bdf
5
5
  SHA512:
6
- metadata.gz: 7298e60f71abc1c364f3f427e91a4a700865ecb9c63a3d7e44a5e75adb4a24ebbe42fdf2aa929783ec7be00615913452ebbffb957ea3e7b48e86de0d1eeca618
7
- data.tar.gz: 0f4c0f9adafc109eb0f57551c4bf06ad067d9b057857f93221df44721e002034f8d5b4987009887e0b36f7e6c235e47bb3ff58592fe0633edc1d71273ba092ee
6
+ metadata.gz: 53109fa2c2fec6438f59f21f3a4a8af93e715cd0ba6bf665c0e46187adc31fd9e2c13cb080262fe6553d570b7fc8a7df2b8990f3da7c17e08f956950f0da0c5b
7
+ data.tar.gz: 7bd7dc7ed0a4fb744a571e8179b1c541d9451b587aa293a26ca8be3a2fcf8c23cfbb964cd29e973bcadacc16563dc82afa41e996a339710eac963a5c47a77488
@@ -29,35 +29,39 @@ module Ruboty
29
29
 
30
30
  return unless channel
31
31
 
32
+ args = {
33
+ as_user: true
34
+ }
35
+ if message[:thread_ts] || (message[:original] && message[:original][:thread_ts])
36
+ args.merge!(thread_ts: message[:thread_ts] || message[:original][:thread_ts])
37
+ end
38
+
32
39
  if message[:attachments] && !message[:attachments].empty?
33
- client.chat_postMessage(
40
+ args.merge!(
34
41
  channel: channel,
35
- text: message[:code] ? "```\n#{message[:body]}\n```" : message[:body],
42
+ text: message[:code] ? "```\n#{message[:body]}\n```" : message[:body],
36
43
  parse: message[:parse] || 'full',
37
44
  unfurl_links: true,
38
- as_user: true,
39
- attachments: message[:attachments].to_json,
40
- thread_ts: message[:thread_ts] || message[:original][:thread_ts]
45
+ attachments: message[:attachments].to_json
41
46
  )
47
+ client.chat_postMessage(args)
42
48
  elsif message[:file]
43
49
  path = message[:file][:path]
44
- client.files_upload(
50
+ args.merge!(
45
51
  channels: channel,
46
- as_user: true,
47
52
  file: Faraday::UploadIO.new(path, message[:file][:content_type]),
48
53
  title: message[:file][:title] || path,
49
54
  filename: File.basename(path),
50
- initial_comment: message[:body] || '',
51
- thread_ts: message[:thread_ts] || message[:original][:thread_ts]
55
+ initial_comment: message[:body] || ''
52
56
  )
57
+ client.files_upload(args)
53
58
  else
54
- client.chat_postMessage(
59
+ args.merge!(
55
60
  channel: channel,
56
- text: message[:code] ? "```\n#{message[:body]}\n```" : resolve_send_mention(message[:body]),
57
- as_user: true,
58
- mrkdwn: true,
59
- thread_ts: message[:thread_ts] || message[:original][:thread_ts]
61
+ text: message[:code] ? "```\n#{message[:body]}\n```" : resolve_send_mention(message[:body]),
62
+ mrkdwn: true
60
63
  )
64
+ client.chat_postMessage(args)
61
65
  end
62
66
  end
63
67
 
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module SlackRTM
3
- VERSION = '3.2.2'
3
+ VERSION = '3.2.3'
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.2.2
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sho Kusano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-25 00:00:00.000000000 Z
11
+ date: 2021-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
- rubygems_version: 3.1.4
150
+ rubygems_version: 3.2.3
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: Slack real time messaging adapter for Ruboty