rocketchat 0.1.22 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/lib/rocket_chat/gem_version.rb +1 -1
- data/lib/rocket_chat/messages/channel.rb +4 -1
- data/lib/rocket_chat/messages/group.rb +3 -1
- data/lib/rocket_chat/messages/im.rb +3 -3
- data/lib/rocket_chat/messages/room.rb +1 -1
- data/lib/rocket_chat/request_helper.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23d1c8a93431402bbb37c5c6ec923e77c05aa3aeccab7a0e0cd598c14cabd495
|
4
|
+
data.tar.gz: b4c605b263d57257cc3285449988ee7bec9272fb24af6ef70c1a759810c65562
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2516550605f1ef594a60c13604400f863c36fe7da3f0fd06167c415cd3428f6181d8ff615835c57e3fb41282ac3b8e46b6abcd5a01436bd04068a6bff3566261
|
7
|
+
data.tar.gz: a897b18924cbd3631e2d071badeb0bfb91ea09e9ef7c2e4a6b17b8f322d45200ddea061026edaad6581d0e4343d0c9a961458160551d29f816937b536b6f5d8c
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@
|
|
3
3
|
## Unreleased
|
4
4
|
- None
|
5
5
|
|
6
|
+
## [0.2.1](releases/tag/v0.2.1) - 2022-12-19
|
7
|
+
### Fixed
|
8
|
+
- [#41] URL-encode param values in GET query strings ([@nmagedman][])
|
9
|
+
|
10
|
+
## [0.1.23](releases/tag/v0.1.23) - 2022-11-11
|
11
|
+
### Added
|
12
|
+
- [#40] Add set_attr options for announcement, custom_fields and default for channels/groups ([@reist][],[@nmagedman][])
|
13
|
+
|
6
14
|
## [0.1.22](releases/tag/v0.1.22) - 2022-07-21
|
7
15
|
### Fixed
|
8
16
|
- [#38] Fix room (channel/group) online API queries (use `query` instead of `roomId`) ([@abrom][])
|
@@ -122,4 +130,4 @@
|
|
122
130
|
[@chrisstime]: https://github.com/chrisstime
|
123
131
|
[@christianmoretti]: https://github.com/christianmoretti
|
124
132
|
[@alinavancea]: https://github.com/alinavancea
|
125
|
-
|
133
|
+
[@nmagedman]: https://github.com/nmagedman
|
@@ -61,6 +61,9 @@ module RocketChat
|
|
61
61
|
end
|
62
62
|
|
63
63
|
# Keys for set_attr:
|
64
|
+
# * [String] announcement Announcement for the channel
|
65
|
+
# * [Hash] custom_fields Custom fields for the channel
|
66
|
+
# * [Boolean] default Sets whether the channel is a default channel or not
|
64
67
|
# * [String] description A room's description
|
65
68
|
# * [String] join_code Code to join a channel
|
66
69
|
# * [String] purpose Alias for description
|
@@ -68,7 +71,7 @@ module RocketChat
|
|
68
71
|
# * [String] topic A room's topic
|
69
72
|
# * [Strong] type c (channel) or p (private group)
|
70
73
|
def self.settable_attributes
|
71
|
-
%i[description join_code purpose read_only topic type]
|
74
|
+
%i[announcement custom_fields default description join_code purpose read_only topic type]
|
72
75
|
end
|
73
76
|
end
|
74
77
|
end
|
@@ -92,13 +92,15 @@ module RocketChat
|
|
92
92
|
end
|
93
93
|
|
94
94
|
# Keys for set_attr:
|
95
|
+
# * [String] announcement Announcement for the channel
|
96
|
+
# * [Hash] custom_fields Custom fields for the channel
|
95
97
|
# * [String] description A room's description
|
96
98
|
# * [String] purpose Alias for description
|
97
99
|
# * [Boolean] read_only Read-only status
|
98
100
|
# * [String] topic A room's topic
|
99
101
|
# * [Strong] type c (channel) or p (private group)
|
100
102
|
def self.settable_attributes
|
101
|
-
%i[description purpose read_only topic type]
|
103
|
+
%i[announcement custom_fields description purpose read_only topic type]
|
102
104
|
end
|
103
105
|
end
|
104
106
|
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
|
@@ -309,7 +309,7 @@ module RocketChat
|
|
309
309
|
attr_reader :session
|
310
310
|
|
311
311
|
def room_option_hash(options)
|
312
|
-
args = [options, :members, :read_only, :custom_fields]
|
312
|
+
args = [options, :members, :read_only, :custom_fields, :extra_data]
|
313
313
|
|
314
314
|
options = Util.slice_hash(*args)
|
315
315
|
return {} if options.empty?
|
@@ -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
|
|
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.1
|
4
|
+
version: 0.2.1
|
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: 2022-
|
12
|
+
date: 2022-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
230
|
- !ruby/object:Gem::Version
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
|
-
rubygems_version: 3.
|
233
|
+
rubygems_version: 3.3.7
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: Rocket.Chat REST API v1 for Ruby
|