matrix_sdk 2.4.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +17 -2
- data/lib/matrix_sdk/api.rb +60 -18
- data/lib/matrix_sdk/bot/base.rb +843 -0
- data/lib/matrix_sdk/bot/main.rb +79 -0
- data/lib/matrix_sdk/bot.rb +4 -0
- data/lib/matrix_sdk/client.rb +44 -12
- data/lib/matrix_sdk/mxid.rb +3 -1
- data/lib/matrix_sdk/protocols/cs.rb +132 -106
- data/lib/matrix_sdk/protocols/msc.rb +5 -0
- data/lib/matrix_sdk/response.rb +2 -0
- data/lib/matrix_sdk/room.rb +140 -40
- data/lib/matrix_sdk/rooms/space.rb +3 -3
- data/lib/matrix_sdk/user.rb +25 -3
- data/lib/matrix_sdk/util/account_data_cache.rb +91 -0
- data/lib/matrix_sdk/util/extensions.rb +16 -6
- data/lib/matrix_sdk/util/tinycache.rb +20 -4
- data/lib/matrix_sdk/util/tinycache_adapter.rb +5 -1
- data/lib/matrix_sdk/util/uri.rb +16 -4
- data/lib/matrix_sdk/version.rb +1 -1
- data/lib/matrix_sdk.rb +11 -1
- metadata +7 -3
data/lib/matrix_sdk/util/uri.rb
CHANGED
@@ -7,14 +7,20 @@ module URI
|
|
7
7
|
class MXC < Generic
|
8
8
|
def full_path
|
9
9
|
select(:host, :port, :path, :query, :fragment)
|
10
|
-
.
|
10
|
+
.compact
|
11
11
|
.join
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
# TODO: Use +register_scheme+ on Ruby >=3.1 and fall back to old behavior
|
16
|
+
# for older Rubies. May be removed at EOL of Ruby 3.0.
|
17
|
+
if respond_to? :register_scheme
|
18
|
+
register_scheme 'MXC', MXC
|
19
|
+
else
|
20
|
+
@@schemes['MXC'] = MXC
|
21
|
+
end
|
16
22
|
|
17
|
-
unless
|
23
|
+
unless scheme_list.key? 'MATRIX'
|
18
24
|
# A matrix: URI according to MSC2312
|
19
25
|
class MATRIX < Generic
|
20
26
|
attr_reader :authority, :action, :mxid, :mxid2, :via
|
@@ -84,6 +90,12 @@ module URI
|
|
84
90
|
end
|
85
91
|
end
|
86
92
|
|
87
|
-
|
93
|
+
# TODO: Use +register_scheme+ on Ruby >=3.1 and fall back to old behavior
|
94
|
+
# for older Rubies. May be removed at EOL of Ruby 3.0.
|
95
|
+
if respond_to? :register_scheme
|
96
|
+
register_scheme 'MATRIX', MATRIX
|
97
|
+
else
|
98
|
+
@@schemes['MATRIX'] = MATRIX
|
99
|
+
end
|
88
100
|
end
|
89
101
|
end
|
data/lib/matrix_sdk/version.rb
CHANGED
data/lib/matrix_sdk.rb
CHANGED
@@ -10,7 +10,7 @@ autoload :Logging, 'logging'
|
|
10
10
|
|
11
11
|
module MatrixSdk
|
12
12
|
autoload :Api, 'matrix_sdk/api'
|
13
|
-
autoload :ApplicationService, 'matrix_sdk/application_service'
|
13
|
+
# autoload :ApplicationService, 'matrix_sdk/application_service'
|
14
14
|
autoload :Client, 'matrix_sdk/client'
|
15
15
|
autoload :MXID, 'matrix_sdk/mxid'
|
16
16
|
autoload :Response, 'matrix_sdk/response'
|
@@ -19,15 +19,25 @@ module MatrixSdk
|
|
19
19
|
|
20
20
|
autoload :MatrixError, 'matrix_sdk/errors'
|
21
21
|
autoload :MatrixRequestError, 'matrix_sdk/errors'
|
22
|
+
autoload :MatrixNotAuthorizedError, 'matrix_sdk/errors'
|
23
|
+
autoload :MatrixForbiddenError, 'matrix_sdk/errors'
|
24
|
+
autoload :MatrixNotFoundError, 'matrix_sdk/errors'
|
25
|
+
autoload :MatrixConflictError, 'matrix_sdk/errors'
|
26
|
+
autoload :MatrixTooManyRequestsError, 'matrix_sdk/errors'
|
22
27
|
autoload :MatrixConnectionError, 'matrix_sdk/errors'
|
23
28
|
autoload :MatrixTimeoutError, 'matrix_sdk/errors'
|
24
29
|
autoload :MatrixUnexpectedResponseError, 'matrix_sdk/errors'
|
25
30
|
|
31
|
+
module Bot
|
32
|
+
autoload :Base, 'matrix_sdk/bot/base'
|
33
|
+
end
|
34
|
+
|
26
35
|
module Rooms
|
27
36
|
autoload :Space, 'matrix_sdk/rooms/space'
|
28
37
|
end
|
29
38
|
|
30
39
|
module Util
|
40
|
+
autoload :AccountDataCache, 'matrix_sdk/util/account_data_cache'
|
31
41
|
autoload :Tinycache, 'matrix_sdk/util/tinycache'
|
32
42
|
autoload :TinycacheAdapter, 'matrix_sdk/util/tinycache_adapter'
|
33
43
|
end
|
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: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Olofsson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mocha
|
@@ -95,6 +95,9 @@ files:
|
|
95
95
|
- README.md
|
96
96
|
- lib/matrix_sdk.rb
|
97
97
|
- lib/matrix_sdk/api.rb
|
98
|
+
- lib/matrix_sdk/bot.rb
|
99
|
+
- lib/matrix_sdk/bot/base.rb
|
100
|
+
- lib/matrix_sdk/bot/main.rb
|
98
101
|
- lib/matrix_sdk/client.rb
|
99
102
|
- lib/matrix_sdk/errors.rb
|
100
103
|
- lib/matrix_sdk/mxid.rb
|
@@ -107,6 +110,7 @@ files:
|
|
107
110
|
- lib/matrix_sdk/room.rb
|
108
111
|
- lib/matrix_sdk/rooms/space.rb
|
109
112
|
- lib/matrix_sdk/user.rb
|
113
|
+
- lib/matrix_sdk/util/account_data_cache.rb
|
110
114
|
- lib/matrix_sdk/util/events.rb
|
111
115
|
- lib/matrix_sdk/util/extensions.rb
|
112
116
|
- lib/matrix_sdk/util/tinycache.rb
|
@@ -132,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
136
|
- !ruby/object:Gem::Version
|
133
137
|
version: '0'
|
134
138
|
requirements: []
|
135
|
-
rubygems_version: 3.
|
139
|
+
rubygems_version: 3.3.8
|
136
140
|
signing_key:
|
137
141
|
specification_version: 4
|
138
142
|
summary: SDK for applications using the Matrix protocol
|