Skip to content

Commit

Permalink
Add missing "reason" parameter to user restrictions (#158)
Browse files Browse the repository at this point in the history
* feat(lib): add missing 'reason' parameter to User.setRestrictions

* PubNub SDK v0.5.1 release.

---------

Co-authored-by: PubNub Release Bot <[email protected]>
  • Loading branch information
piotr-suwala and pubnub-release-bot authored Dec 18, 2023
1 parent 0c12f3f commit 1da11ff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
---
name: pubnub-js-chat
version: v0.5.0
version: v0.5.1
scm: github.com/pubnub/js-chat
schema: 1
files:
- lib/dist/index.js
changelog:
- date: 2023-12-18
version: v0.5.1
changes:
- type: feature
text: "Add missing "reason" parameter to user restrictions."
- date: 2023-12-14
version: v0.5.0
changes:
Expand Down
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pubnub/chat",
"version": "0.5.0",
"version": "0.5.1",
"description": "PubNub JavaScript Chat SDK",
"author": "PubNub <[email protected]>",
"license": "SEE LICENSE IN LICENSE",
Expand Down
5 changes: 4 additions & 1 deletion lib/src/entities/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ export class User {
* Moderation restrictions
*/

async setRestrictions(channel: Channel, params: { ban?: boolean; mute?: boolean }) {
async setRestrictions(
channel: Channel,
params: { ban?: boolean; mute?: boolean; reason?: string }
) {
if (!(this.chat.sdk as any)._config.secretKey)
throw "Moderation restrictions can only be set by clients initialized with a Secret Key."
return this.chat.setRestrictions(this.id, channel.id, params)
Expand Down

0 comments on commit 1da11ff

Please sign in to comment.