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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/matrix_sdk/protocols/cs.rb +20 -6
- data/lib/matrix_sdk/version.rb +1 -1
- data/matrix-sdk.gemspec +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d011936f4351fdcdba80a37592a243e30632355c1b85dcb03afe59b0684775ea
|
4
|
+
data.tar.gz: e5e569f87cb325a18bd0996d542bc7baca25e85aa42df1dfafdec05f9bc28dea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
153
|
-
content[:invite] = [params
|
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
|
-
|
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)
|
data/lib/matrix_sdk/version.rb
CHANGED
data/matrix-sdk.gemspec
CHANGED
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.
|
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-
|
11
|
+
date: 2019-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logging
|