matrix_sdk 2.1.3 → 2.5.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 +31 -0
- data/README.md +1 -1
- data/lib/matrix_sdk/api.rb +49 -32
- data/lib/matrix_sdk/client.rb +71 -54
- data/lib/matrix_sdk/errors.rb +4 -0
- data/lib/matrix_sdk/mxid.rb +50 -15
- data/lib/matrix_sdk/protocols/cs.rb +182 -124
- data/lib/matrix_sdk/protocols/msc.rb +5 -1
- data/lib/matrix_sdk/response.rb +3 -1
- data/lib/matrix_sdk/room.rb +335 -102
- data/lib/matrix_sdk/rooms/space.rb +79 -0
- data/lib/matrix_sdk/user.rb +11 -3
- data/lib/matrix_sdk/util/events.rb +111 -0
- data/lib/matrix_sdk/util/extensions.rb +75 -0
- data/lib/matrix_sdk/util/tinycache.rb +134 -0
- data/lib/matrix_sdk/util/tinycache_adapter.rb +77 -0
- data/lib/matrix_sdk/util/uri.rb +89 -0
- data/lib/matrix_sdk/version.rb +1 -1
- data/lib/matrix_sdk.rb +16 -1
- metadata +12 -8
- data/lib/matrix_sdk/application_service.rb +0 -212
- data/lib/matrix_sdk/extensions.rb +0 -197
@@ -47,7 +47,7 @@ module MatrixSdk::Protocols::MSC
|
|
47
47
|
query[:user_id] = params.delete(:user_id) if protocol?(:AS) && params.key?(:user_id)
|
48
48
|
|
49
49
|
req = Net::HTTP::Get.new(homeserver.dup.tap do |u|
|
50
|
-
u.path = api_to_path
|
50
|
+
u.path = "#{api_to_path :client_r0}/sync/sse"
|
51
51
|
u.query = URI.encode_www_form(query)
|
52
52
|
end)
|
53
53
|
req['accept'] = 'text/event-stream'
|
@@ -60,7 +60,9 @@ module MatrixSdk::Protocols::MSC
|
|
60
60
|
# rubocop:disable Metrics/BlockLength
|
61
61
|
thread = Thread.new(cancellation_token) do |ctx|
|
62
62
|
print_http(req)
|
63
|
+
@http_lock.lock
|
63
64
|
http.request req do |response|
|
65
|
+
@http_lock.unlock
|
64
66
|
break unless ctx[:run]
|
65
67
|
|
66
68
|
print_http(response, body: false)
|
@@ -136,6 +138,8 @@ module MatrixSdk::Protocols::MSC
|
|
136
138
|
end
|
137
139
|
break unless ctx[:run]
|
138
140
|
end
|
141
|
+
rescue StandardError
|
142
|
+
@http_lock.unlock if @http_lock.owned?
|
139
143
|
end
|
140
144
|
# rubocop:enable Metrics/BlockLength
|
141
145
|
|