rocketchat 0.1.23 → 0.2.1

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: e905853c710d76e1eef50b102b93632c5523713d142bd3cfe940995b39ae427c
4
- data.tar.gz: '08ab172483429ae969d957ab0a30a2a0336d701c116719fd061911978b9f1fb7'
3
+ metadata.gz: 23d1c8a93431402bbb37c5c6ec923e77c05aa3aeccab7a0e0cd598c14cabd495
4
+ data.tar.gz: b4c605b263d57257cc3285449988ee7bec9272fb24af6ef70c1a759810c65562
5
5
  SHA512:
6
- metadata.gz: ac016a85545fea96d9d7d9acf798a22ead3eaa31215e2a61a31d696aa43606bee50999f4c9e1d3174b6bdcf03d0c45d3006eff105203bf6d078bd1a221aa51e0
7
- data.tar.gz: 471b76b3a12f47304e26f356218c8d90bc981755ecfc8499724c94d099b40a8f7f34968f3faa912f396dcc108dda20f618cb782a2107f9aef1c305000be0e643
6
+ metadata.gz: 2516550605f1ef594a60c13604400f863c36fe7da3f0fd06167c415cd3428f6181d8ff615835c57e3fb41282ac3b8e46b6abcd5a01436bd04068a6bff3566261
7
+ data.tar.gz: a897b18924cbd3631e2d071badeb0bfb91ea09e9ef7c2e4a6b17b8f322d45200ddea061026edaad6581d0e4343d0c9a961458160551d29f816937b536b6f5d8c
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
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
+
6
10
  ## [0.1.23](releases/tag/v0.1.23) - 2022-11-11
7
11
  ### Added
8
12
  - [#40] Add set_attr options for announcement, custom_fields and default for channels/groups ([@reist][],[@nmagedman][])
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RocketChat
4
- VERSION = '0.1.23'
4
+ VERSION = '0.2.1'
5
5
  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] username Rocket.Chat username
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:, username: nil)
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
- username: username
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 += "?#{body.map { |k, v| "#{k}=#{v}" }.join('&')}" if body
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.23
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-11-11 00:00:00.000000000 Z
12
+ date: 2022-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler