matrix_sdk 1.0.0 → 1.0.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: dee0d341f6962b850245ebbea4e85a9e4e3ac14d809a3f3bf1236d5458e9ef80
4
- data.tar.gz: 9a1c731a321aee4f85ad4b6f39f85c975aa763308c069494448b200c7b88b1d3
3
+ metadata.gz: d011936f4351fdcdba80a37592a243e30632355c1b85dcb03afe59b0684775ea
4
+ data.tar.gz: e5e569f87cb325a18bd0996d542bc7baca25e85aa42df1dfafdec05f9bc28dea
5
5
  SHA512:
6
- metadata.gz: ce68baa4997e7ba558c06458d3660d8c1429f352989c1dbef9b47943d77180bb646d45c8a727d29928318f3908ca51240335851b8ee66a345750bef71fd5bfd7
7
- data.tar.gz: 51d7bb564f54c1f4f82700ea7f149837b24035859319be96357bfcb538d948a07b62dbe78e570ebc0090befcd099c5892422c71cc2ab3567296250772af70ae9
6
+ metadata.gz: 6f6881da6dc7b9e9bac6ac59386298f4e09595c6e9445a970b64f77bee3140220e5a0884575e91cc9d88198edebaf1e8074c1eeadb7a301c6d484617c904ed77
7
+ data.tar.gz: 8f0c02e302015dac5f9ef70da92bd073b17c31d3e8e43eb4403bb4df6c0e769f106a3af52733463651deb74ccd0437ba23d0c02138534db8767fb950c31212b6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## v1.0.1 - 2019-05-24
2
+
3
+ - Fixes an error in the room creation code
4
+ - Fixes a divergence from spec in the room message request
5
+ - Fixes a slight divergence from spec in the kick method
6
+ - Fixes a divergence from spec in the tags handling methods
7
+
1
8
  ## v1.0.0 - 2019-05-17
2
9
 
3
10
  - Improves testing and code coverage of existing code
@@ -25,6 +25,10 @@ module MatrixSdk::Protocols::CS
25
25
  end
26
26
  end
27
27
 
28
+ def allowed_login_methods
29
+ request(:get, :client_r0, '/login').flows
30
+ end
31
+
28
32
  # Runs the client API /sync method
29
33
  # @param timeout [Numeric] (30.0) The timeout in seconds for the sync
30
34
  # @param params [Hash] The sync options to use
@@ -149,10 +153,11 @@ module MatrixSdk::Protocols::CS
149
153
  content = {
150
154
  visibility: visibility
151
155
  }
152
- content[:room_alias_name] = params[:room_alias] if params[:room_alias]
153
- content[:invite] = [params[:invite]].flatten if params[:invite]
156
+ content[:room_alias_name] = params.delete(:room_alias) if params[:room_alias]
157
+ content[:invite] = [params.delete(:invite)].flatten if params[:invite]
158
+ content.merge! params
154
159
 
155
- request(:post, :client_r0, '/createRoom', content, query: query)
160
+ request(:post, :client_r0, '/createRoom', body: content, query: query)
156
161
  end
157
162
 
158
163
  # Joins a room
@@ -162,6 +167,7 @@ module MatrixSdk::Protocols::CS
162
167
  # @return [Response] A response hash with the parameter :room_id
163
168
  # @see https://matrix.org/docs/spec/client_server/r0.3.0.html#post-matrix-client-r0-join-roomidoralias
164
169
  # The Matrix Spec, for more information about the call and response
170
+ # @todo Add support for 3rd-party signed objects
165
171
  def join_room(id_or_alias, **params)
166
172
  query = {}
167
173
  query[:server_name] = params[:server_name] if params[:server_name]
@@ -392,7 +398,6 @@ module MatrixSdk::Protocols::CS
392
398
  # The Matrix Spec, for more information about the call and response
393
399
  def get_room_messages(room_id, token, direction, limit: 10, **params)
394
400
  query = {
395
- roomId: room_id,
396
401
  from: token,
397
402
  dir: direction,
398
403
  limit: limit
@@ -492,8 +497,17 @@ module MatrixSdk::Protocols::CS
492
497
  request(:post, :client_r0, "/rooms/#{room_id}/invite", body: content, query: query)
493
498
  end
494
499
 
495
- def kick_user(room_id, user_id, **params)
496
- set_membership(room_id, user_id, 'leave', params)
500
+ def kick_user(room_id, user_id, reason: '', **params)
501
+ query = {}
502
+ query[:user_id] = params.delete(:user_id) if protocol?(:AS) && params.key?(:user_id)
503
+
504
+ content = {
505
+ user_id: user_id,
506
+ reason: reason
507
+ }
508
+ room_id = ERB::Util.url_encode room_id.to_s
509
+
510
+ request(:post, :client_r0, "/rooms/#{room_id}/kick", body: content, query: query)
497
511
  end
498
512
 
499
513
  def get_membership(room_id, user_id, **params)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MatrixSdk
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.1'
5
5
  end
data/matrix-sdk.gemspec CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.join File.expand_path('lib', __dir__), 'matrix_sdk/version'
2
4
 
3
5
  Gem::Specification.new do |spec|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matrix_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Olofsson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-17 00:00:00.000000000 Z
11
+ date: 2019-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging