stream-chat-ruby 1.1.0 → 1.1.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 +2 -1
- data/README.md +3 -3
- data/lib/stream-chat/client.rb +3 -1
- data/lib/stream-chat/errors.rb +2 -4
- data/lib/stream-chat/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2d9ca6f8fb47bba23a0091fd3727a43cc9f72838418e10d565ef29c219dc722
|
4
|
+
data.tar.gz: 6ce0d0079a0ea1c303c97b1c12e3e3b67d4be82c1368ffae46e34478608694fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c6a88306903dc45bf0ab0c3cbdd5fb1e6dc04846229b0297301e84676fccdff88f1d5761f52fcac35ee2a56c0ac73a5bc652bb9602219ad06a035d9c70611cd
|
7
|
+
data.tar.gz: ec592e809858d6e5b865822c91fe333fe9cafc22e7e909af0d2a7832aeb4462db8dc90f9078fcd173a121a08bdd8fcd5a0528de93bc4dfdb2f51a830ca4e01dc
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/lib/stream-chat/client.rb
CHANGED
@@ -92,7 +92,9 @@ module StreamChat
|
|
92
92
|
def update_users(users)
|
93
93
|
payload = {}
|
94
94
|
users.each do |user|
|
95
|
-
|
95
|
+
id = user[:id] || user["id"]
|
96
|
+
raise ArgumentError "user must have an id" unless id
|
97
|
+
payload[id] = user
|
96
98
|
end
|
97
99
|
post('users', data: {'users': payload})
|
98
100
|
end
|
data/lib/stream-chat/errors.rb
CHANGED
@@ -9,10 +9,8 @@ module StreamChat
|
|
9
9
|
begin
|
10
10
|
parsed_response = JSON.parse(response.body)
|
11
11
|
@json_response = true
|
12
|
-
@error_code = parsed_response.fetch("
|
13
|
-
|
14
|
-
@error_message = parsed_response.fetch("data", {})
|
15
|
-
.fetch("message", "unknown")
|
12
|
+
@error_code = parsed_response.fetch("code", "unknown")
|
13
|
+
@error_message = parsed_response.fetch("message", "unknown")
|
16
14
|
rescue JSON::ParserError
|
17
15
|
@json_response = false
|
18
16
|
end
|
data/lib/stream-chat/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stream-chat-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mircea Cosbuc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
121
|
+
rubygems_version: 3.1.2
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: The low level client for serverside calls for Stream Chat.
|