stream-chat-ruby 2.12.0 → 2.13.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 +13 -1
- data/lib/stream-chat/client.rb +35 -0
- data/lib/stream-chat/version.rb +1 -1
- data/stream-chat.gemspec +1 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d913a2d883a67d7e06afd1e57febfb5565cbcd23d69249e101f72163084f7b96
|
4
|
+
data.tar.gz: af4374cd74b9789c5751f6569e9317e46289207daa6a72eea0e53a20ad3ee43f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c7ed7f7f94d009b4e3a091942f6b59cfa14087d02ba4b2659e18755dbb62a8bbe471e0497ce46a113598fd1e36aa2c7a3749f4ca3505f6f18e28a8d2ca3e663
|
7
|
+
data.tar.gz: 4c0dbed5b2230c4ce9fb3b8630f6d8fa72dd58097b35b12d78a6b355635cd7d9b0b63e38e1b011b57d7ce647fb271b0b225977e02c35718d549fc9d9c9ad7da3
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,21 @@
|
|
1
|
+
## November 17th, 2021 - 2.13.0
|
2
|
+
|
3
|
+
- Add support for shadow banning user
|
4
|
+
- shadow_ban
|
5
|
+
- remove_shadow_ban
|
6
|
+
- Add support for pinning messages
|
7
|
+
- pin_message
|
8
|
+
- unpin_message
|
9
|
+
- Add support for partial updating messages
|
10
|
+
- update_message_partial
|
11
|
+
- Add support for updating channel ownership for Deleted Users
|
12
|
+
|
1
13
|
## November 1st, 2021 - 2.12.0
|
2
14
|
|
3
15
|
- Add support for async endpoints
|
4
16
|
- get_task
|
5
17
|
- delete_channels
|
6
|
-
|
18
|
+
- delete_users
|
7
19
|
|
8
20
|
## October 22nd, 2021 - 2.11.3
|
9
21
|
|
data/lib/stream-chat/client.rb
CHANGED
@@ -160,6 +160,16 @@ module StreamChat
|
|
160
160
|
delete('moderation/ban', params: params)
|
161
161
|
end
|
162
162
|
|
163
|
+
def shadow_ban(target_id, **options)
|
164
|
+
payload = { target_user_id: target_id, shadow: true }.merge(options)
|
165
|
+
post('moderation/ban', data: payload)
|
166
|
+
end
|
167
|
+
|
168
|
+
def remove_shadow_ban(target_id, **options)
|
169
|
+
params = { target_user_id: target_id, shadow: true }.merge(options)
|
170
|
+
delete('moderation/ban', params: params)
|
171
|
+
end
|
172
|
+
|
163
173
|
def mute_user(target_id, user_id)
|
164
174
|
payload = { target_id: target_id, user_id: user_id }
|
165
175
|
post('moderation/mute', data: payload)
|
@@ -175,12 +185,37 @@ module StreamChat
|
|
175
185
|
post('channels/read', data: payload)
|
176
186
|
end
|
177
187
|
|
188
|
+
def pin_message(message_id, user_id, expiration: nil)
|
189
|
+
updates = {
|
190
|
+
set: {
|
191
|
+
pinned: true,
|
192
|
+
pin_expires: expiration
|
193
|
+
}
|
194
|
+
}
|
195
|
+
update_message_partial(message_id, updates, user_id: user_id)
|
196
|
+
end
|
197
|
+
|
198
|
+
def unpin_message(message_id, user_id)
|
199
|
+
updates = {
|
200
|
+
set: {
|
201
|
+
pinned: false
|
202
|
+
}
|
203
|
+
}
|
204
|
+
update_message_partial(message_id, updates, user_id: user_id)
|
205
|
+
end
|
206
|
+
|
178
207
|
def update_message(message)
|
179
208
|
raise ArgumentError 'message must have an id' unless message.key? 'id'
|
180
209
|
|
181
210
|
post("messages/#{message['id']}", data: { message: message })
|
182
211
|
end
|
183
212
|
|
213
|
+
def update_message_partial(message_id, updates, user_id: nil, **options)
|
214
|
+
params = updates.merge(options)
|
215
|
+
params['user'] = { id: user_id } if user_id
|
216
|
+
put("messages/#{message_id}", data: params)
|
217
|
+
end
|
218
|
+
|
184
219
|
def delete_message(message_id)
|
185
220
|
delete("messages/#{message_id}")
|
186
221
|
end
|
data/lib/stream-chat/version.rb
CHANGED
data/stream-chat.gemspec
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: 2.
|
4
|
+
version: 2.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mircea Cosbuc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -105,7 +105,8 @@ files:
|
|
105
105
|
- stream-chat.gemspec
|
106
106
|
homepage: http://github.com/GetStream/stream-chat-ruby
|
107
107
|
licenses: []
|
108
|
-
metadata:
|
108
|
+
metadata:
|
109
|
+
rubygems_mfa_required: 'true'
|
109
110
|
post_install_message:
|
110
111
|
rdoc_options: []
|
111
112
|
require_paths:
|
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
122
|
- !ruby/object:Gem::Version
|
122
123
|
version: '0'
|
123
124
|
requirements: []
|
124
|
-
rubygems_version: 3.
|
125
|
+
rubygems_version: 3.0.3
|
125
126
|
signing_key:
|
126
127
|
specification_version: 4
|
127
128
|
summary: The low level client for serverside calls for Stream Chat.
|