rocketchat 0.1.23 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +14 -0
- data/lib/rocket_chat/gem_version.rb +1 -1
- data/lib/rocket_chat/message.rb +7 -1
- data/lib/rocket_chat/messages/chat.rb +2 -2
- data/lib/rocket_chat/messages/im.rb +3 -3
- data/lib/rocket_chat/request_helper.rb +2 -2
- data/lib/rocket_chat/util.rb +1 -1
- data/rocketchat.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a6c0288c4420a286b0444dc84749e572fa40806874616673a360a509dfa90f8
|
4
|
+
data.tar.gz: e6d74695c8e75fa49c51f4de0e6db86476b965351a9a7231d9f57b5a59d70bd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbecd274cd60768eb7fcc19a95cd9652d474405bb80047aa16e51a700b2468b1057cdfe907ab093471e4227a6870924b05c89cb41a2be8742c7a5ddb4e6a6248
|
7
|
+
data.tar.gz: f6e927d6dca42397da5ea9517033e9549f9ebc238e1f994aee63ef5f33644d497330a4dfd74426f3564f71223af257a79678ac346bce5dc4610d5e95423977ba
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,19 @@
|
|
3
3
|
## Unreleased
|
4
4
|
- None
|
5
5
|
|
6
|
+
## [0.2.2](releases/tag/v0.2.2) - 2023-04-21
|
7
|
+
### Added
|
8
|
+
- [#43] Add Ruby 3.2 support ([@MrRTI][])
|
9
|
+
- [#44] Add support for thread messages ([@MrRTI][])
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
- [#45] Fixed some rubocop lints ([@abrom][])
|
13
|
+
|
14
|
+
|
15
|
+
## [0.2.1](releases/tag/v0.2.1) - 2022-12-19
|
16
|
+
### Fixed
|
17
|
+
- [#41] URL-encode param values in GET query strings ([@nmagedman][])
|
18
|
+
|
6
19
|
## [0.1.23](releases/tag/v0.1.23) - 2022-11-11
|
7
20
|
### Added
|
8
21
|
- [#40] Add set_attr options for announcement, custom_fields and default for channels/groups ([@reist][],[@nmagedman][])
|
@@ -127,3 +140,4 @@
|
|
127
140
|
[@christianmoretti]: https://github.com/christianmoretti
|
128
141
|
[@alinavancea]: https://github.com/alinavancea
|
129
142
|
[@nmagedman]: https://github.com/nmagedman
|
143
|
+
[@MrRTI]: https://github.com/MrRTi
|
data/lib/rocket_chat/message.rb
CHANGED
@@ -20,6 +20,11 @@ module RocketChat
|
|
20
20
|
data['_id']
|
21
21
|
end
|
22
22
|
|
23
|
+
# Message thread id
|
24
|
+
def tmid
|
25
|
+
data['tmid']
|
26
|
+
end
|
27
|
+
|
23
28
|
# Timestamp
|
24
29
|
def timestamp
|
25
30
|
Time.parse data['ts']
|
@@ -67,7 +72,8 @@ module RocketChat
|
|
67
72
|
object_id: object_id,
|
68
73
|
id: id,
|
69
74
|
room_id: room_id,
|
70
|
-
message: message
|
75
|
+
message: message,
|
76
|
+
tmid: tmid
|
71
77
|
)
|
72
78
|
end
|
73
79
|
end
|
@@ -55,7 +55,7 @@ module RocketChat
|
|
55
55
|
# @param [String] room_id Rocket.Chat room id
|
56
56
|
# @param [String] name Rocket.Chat room name (coming soon)
|
57
57
|
# @param [String] channel Rocket.Chat channel name
|
58
|
-
# @param [Hash] params Optional params (text, alias, emoji, avatar & attachments)
|
58
|
+
# @param [Hash] params Optional params (text, alias, emoji, tmid, avatar & attachments)
|
59
59
|
# @return [RocketChat::Message]
|
60
60
|
# @raise [HTTPError, StatusError]
|
61
61
|
#
|
@@ -65,7 +65,7 @@ module RocketChat
|
|
65
65
|
method: :post,
|
66
66
|
body: room_params(room_id, name)
|
67
67
|
.merge(channel: channel)
|
68
|
-
.merge(Util.slice_hash(params, :text, :alias, :emoji, :avatar, :attachments))
|
68
|
+
.merge(Util.slice_hash(params, :text, :alias, :tmid, :emoji, :avatar, :attachments))
|
69
69
|
)
|
70
70
|
RocketChat::Message.new response['message'] if response['success']
|
71
71
|
end
|
@@ -78,16 +78,16 @@ module RocketChat
|
|
78
78
|
#
|
79
79
|
# im.counters REST API
|
80
80
|
# @param [String] room_id Rocket.Chat roomId
|
81
|
-
# @param [String]
|
81
|
+
# @param [String] user_id Rocket.Chat userId [optional]
|
82
82
|
# @return [RocketChat::ImSummary]
|
83
83
|
# @raise [HTTPError, StatusError]
|
84
84
|
#
|
85
|
-
def counters(room_id:,
|
85
|
+
def counters(room_id:, user_id: nil)
|
86
86
|
response = session.request_json(
|
87
87
|
'/api/v1/im.counters',
|
88
88
|
body: {
|
89
89
|
roomId: room_id,
|
90
|
-
|
90
|
+
userId: user_id
|
91
91
|
}
|
92
92
|
)
|
93
93
|
RocketChat::ImSummary.new response
|
@@ -104,14 +104,14 @@ module RocketChat
|
|
104
104
|
|
105
105
|
def create_request(path, options)
|
106
106
|
headers = get_headers(options)
|
107
|
-
body = options[:body]
|
107
|
+
body = options[:body]&.reject { |_key, value| value.nil? }
|
108
108
|
|
109
109
|
if options[:method] == :post
|
110
110
|
req = Net::HTTP::Post.new(path, headers)
|
111
111
|
add_body(req, body) if body
|
112
112
|
else
|
113
113
|
uri = path
|
114
|
-
uri += "?#{
|
114
|
+
uri += "?#{URI.encode_www_form(body)}" if body
|
115
115
|
req = Net::HTTP::Get.new(uri, headers)
|
116
116
|
end
|
117
117
|
|
data/lib/rocket_chat/util.rb
CHANGED
data/rocketchat.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.description = 'Rocket.Chat REST API v1 for Ruby'
|
16
16
|
spec.homepage = 'https://github.com/abrom/rocketchat-ruby'
|
17
17
|
spec.license = 'MIT'
|
18
|
-
spec.required_ruby_version = ['>= 2.5.0', '< 3.
|
18
|
+
spec.required_ruby_version = ['>= 2.5.0', '< 3.3.0']
|
19
19
|
|
20
20
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
21
21
|
# delete this section to allow pushing this gem to any host.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocketchat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- int512
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -223,14 +223,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
223
223
|
version: 2.5.0
|
224
224
|
- - "<"
|
225
225
|
- !ruby/object:Gem::Version
|
226
|
-
version: 3.
|
226
|
+
version: 3.3.0
|
227
227
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
228
228
|
requirements:
|
229
229
|
- - ">="
|
230
230
|
- !ruby/object:Gem::Version
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
|
-
rubygems_version: 3.
|
233
|
+
rubygems_version: 3.4.1
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: Rocket.Chat REST API v1 for Ruby
|