stream-chat-ruby 3.6.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/stream-chat/channel.rb +65 -0
- data/lib/stream-chat/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e10a1fbd71fbd03f5bae3e09ab7ab73550a2db39ee4115e9c67d2d4b8e1470b3
|
4
|
+
data.tar.gz: aa5c552ab4b4246d2bc2f3beff765b50b1d27dae6ca798ed7eea28e5aded68ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a4e3c68f24960341d454269c49bf6340efe2cab15205bb4b4656d9602fa233b3e4305b3e1001da9be3c3e195e9a5afc4048f03eccb9c369f83427241ce244ef
|
7
|
+
data.tar.gz: df5e4fb41602279d2649ce0c91ca9381984c1321fe941f30d12e2e5dc5059d2da2f6d1993f4b8488106879ec32db68eb160c496c3c3b3f798c0b37b2d238d4f9
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
4
4
|
|
5
|
+
## [3.8.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.7.0...v3.8.0) (2025-02-11)
|
6
|
+
|
7
|
+
|
8
|
+
### Other
|
9
|
+
|
10
|
+
* added tests using the restricted visibility feature ([#144](https://github.com/GetStream/stream-chat-ruby/issues/144)) ([b13cc92](https://github.com/GetStream/stream-chat-ruby/commit/b13cc92cd91aeb1f6e1a25f5c6d22efb41339f49))
|
11
|
+
|
12
|
+
## [3.7.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.6.0...v3.7.0) (2024-12-09)
|
13
|
+
|
5
14
|
## [3.6.0](https://github.com/GetStream/stream-chat-ruby/compare/v3.5.1...v3.6.0) (2024-05-22)
|
6
15
|
|
7
16
|
|
data/lib/stream-chat/channel.rb
CHANGED
@@ -16,6 +16,9 @@ module StreamChat
|
|
16
16
|
sig { returns(String) }
|
17
17
|
attr_reader :channel_type
|
18
18
|
|
19
|
+
sig { returns(String) }
|
20
|
+
attr_reader :cid
|
21
|
+
|
19
22
|
sig { returns(StringKeyHash) }
|
20
23
|
attr_reader :custom_data
|
21
24
|
|
@@ -166,6 +169,68 @@ module StreamChat
|
|
166
169
|
@client.post('moderation/unmute/channel', data: { 'user_id' => user_id, 'channel_cid' => @cid })
|
167
170
|
end
|
168
171
|
|
172
|
+
# Pins a channel for a user.
|
173
|
+
sig { params(user_id: String).returns(StreamChat::StreamResponse) }
|
174
|
+
def pin(user_id)
|
175
|
+
raise StreamChannelException, 'user ID must not be empty' if user_id.empty?
|
176
|
+
|
177
|
+
payload = {
|
178
|
+
set: {
|
179
|
+
pinned: true
|
180
|
+
}
|
181
|
+
}
|
182
|
+
@client.patch("#{url}/member/#{CGI.escape(user_id)}", data: payload)
|
183
|
+
end
|
184
|
+
|
185
|
+
# Unins a channel for a user.
|
186
|
+
sig { params(user_id: String).returns(StreamChat::StreamResponse) }
|
187
|
+
def unpin(user_id)
|
188
|
+
raise StreamChannelException, 'user ID must not be empty' if user_id.empty?
|
189
|
+
|
190
|
+
payload = {
|
191
|
+
set: {
|
192
|
+
pinned: false
|
193
|
+
}
|
194
|
+
}
|
195
|
+
@client.patch("#{url}/member/#{CGI.escape(user_id)}", data: payload)
|
196
|
+
end
|
197
|
+
|
198
|
+
# Archives a channel for a user.
|
199
|
+
sig { params(user_id: String).returns(StreamChat::StreamResponse) }
|
200
|
+
def archive(user_id)
|
201
|
+
raise StreamChannelException, 'user ID must not be empty' if user_id.empty?
|
202
|
+
|
203
|
+
payload = {
|
204
|
+
set: {
|
205
|
+
archived: true
|
206
|
+
}
|
207
|
+
}
|
208
|
+
@client.patch("#{url}/member/#{CGI.escape(user_id)}", data: payload)
|
209
|
+
end
|
210
|
+
|
211
|
+
# Archives a channel for a user.
|
212
|
+
sig { params(user_id: String).returns(StreamChat::StreamResponse) }
|
213
|
+
def unarchive(user_id)
|
214
|
+
raise StreamChannelException, 'user ID must not be empty' if user_id.empty?
|
215
|
+
|
216
|
+
payload = {
|
217
|
+
set: {
|
218
|
+
archived: false
|
219
|
+
}
|
220
|
+
}
|
221
|
+
@client.patch("#{url}/member/#{CGI.escape(user_id)}", data: payload)
|
222
|
+
end
|
223
|
+
|
224
|
+
# Updates a member partially in the channel.
|
225
|
+
sig { params(user_id: String, set: T.nilable(StringKeyHash), unset: T.nilable(T::Array[String])).returns(StreamChat::StreamResponse) }
|
226
|
+
def update_member_partial(user_id, set: nil, unset: nil)
|
227
|
+
raise StreamChannelException, 'user ID must not be empty' if user_id.empty?
|
228
|
+
raise StreamChannelException, 'set or unset is required' if set.nil? && unset.nil?
|
229
|
+
|
230
|
+
payload = { set: set, unset: unset }
|
231
|
+
@client.patch("#{url}/member/#{CGI.escape(user_id)}", data: payload)
|
232
|
+
end
|
233
|
+
|
169
234
|
# Adds members to the channel.
|
170
235
|
sig { params(user_ids: T::Array[String], options: T.untyped).returns(StreamChat::StreamResponse) }
|
171
236
|
def add_members(user_ids, **options)
|
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: 3.
|
4
|
+
version: 3.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- getstream.io
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -130,7 +130,7 @@ metadata:
|
|
130
130
|
documentation_uri: https://getstream.io/chat/docs/ruby/?language=ruby
|
131
131
|
changelog_uri: https://github.com/GetStream/stream-chat-ruby/blob/master/CHANGELOG.md
|
132
132
|
source_code_uri: https://github.com/GetStream/stream-chat-ruby
|
133
|
-
post_install_message:
|
133
|
+
post_install_message:
|
134
134
|
rdoc_options: []
|
135
135
|
require_paths:
|
136
136
|
- lib
|
@@ -145,8 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
149
|
-
signing_key:
|
148
|
+
rubygems_version: 3.4.20
|
149
|
+
signing_key:
|
150
150
|
specification_version: 4
|
151
151
|
summary: The low level client for serverside calls for Stream Chat.
|
152
152
|
test_files: []
|