Skip to content

Commit

Permalink
v4.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcho committed Mar 3, 2023
1 parent 6673252 commit 0a1072d
Show file tree
Hide file tree
Showing 16 changed files with 82 additions and 25 deletions.
26 changes: 25 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
## v4.5.0 (Mar 3, 2023)
### **Features**
### **Polls in Open Channel**
Polls is now supported in both Open Channels and Group Channels!
#### **Specification**
- Added `Poll.serialize()`
- Added `PollModule.buildPollFromSerializedData()`
- Added `onPollUpdated`, `onPollVoted`, and `onPollDeleted` in `OpenChannelHandlerParams`
- Moved following methods from `GroupChannel` to `BaseChannel`:
- `updatePoll()`
- `deletePoll()`
- `closePoll()`
- `addPollOption()`
- `updatePollOption()`
- `deletePollOption()`
- `votePoll()`
- `getPollChangeLogsSinceTimestamp()`
- `getPollChangeLogsSinceToken()`
- `createPollListQuery()`
- `createPollVoterListQuery()`

### **Improvements**
- Fixed a bug where `GroupChannelFilter` using nicknames (`nicknameContainsFilter`, `nicknameExactMatchFilter`, and `nicknameExactMatchFilter`) includes current user's nickname when searching from locally cached group channels
- Fixed a bug where `BaseMessage.applyThreadInfoUpdateEvent()` always returning false
- Fixed a bug where `BaseChannel`’s `createMessageMetaArrayKeys`, `deleteMessageMetaArrayKeys`, `addMessageMetaArrayValues`, and `removeMessageMetaArrayValues` returning unexpected result when file message is given

# Changelog
## v4.4.0 (Feb 24, 2023)
### **Features**
### **Disconnect Websocket only**
Expand Down
1 change: 1 addition & 0 deletions __bundle-2605445b.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions __bundle-2c42a88c.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion __bundle-2fe65dc2.js

This file was deleted.

1 change: 0 additions & 1 deletion __bundle-477fc3b7.js

This file was deleted.

1 change: 0 additions & 1 deletion __bundle-82219c3d.js

This file was deleted.

1 change: 1 addition & 0 deletions __bundle-b7a784a9.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion __bundle-fa5be895.js

This file was deleted.

2 changes: 1 addition & 1 deletion groupChannel.js

Large diffs are not rendered by default.

30 changes: 19 additions & 11 deletions lib/__definition.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ export declare class BaseChannel {
report(category: ReportCategory, description: string): Promise<void>;
reportUser(user: User, category: ReportCategory, description: string): Promise<void>;
reportMessage(message: SendableMessage, category: ReportCategory, description: string): Promise<void>;
updatePoll(pollId: number, params: PollUpdateParams): Promise<Poll>;
deletePoll(pollId: number): Promise<void>;
closePoll(pollId: number): Promise<Poll>;
addPollOption(pollId: number, optionText: string): Promise<Poll>;
updatePollOption(pollId: number, pollOptionId: number, optionText: string): Promise<Poll>;
deletePollOption(pollId: number, pollOptionId: number): Promise<void>;
votePoll(pollId: number, pollOptionIds: number[]): Promise<PollVoteEvent>;
getPollChangeLogsSinceTimestamp(ts: number): Promise<PollChangelogs>;
getPollChangeLogsSinceToken(token: string): Promise<PollChangelogs>;
createPollListQuery(limit?: number): PollListQuery;
createPollVoterListQuery(pollId: number, pollOptionId: number, limit?: number): PollVoterListQuery;
}

declare abstract class BaseListQuery {
Expand Down Expand Up @@ -450,17 +461,6 @@ export declare class GroupChannel extends BaseChannel {
setMyPushTriggerOption(option: PushTriggerOption): Promise<PushTriggerOption>;
setMyCountPreference(preference: CountPreference): Promise<CountPreference>;
resetMyHistory(): Promise<GroupChannel>;
updatePoll(pollId: number, params: PollUpdateParams): Promise<Poll>;
deletePoll(pollId: number): Promise<void>;
closePoll(pollId: number): Promise<Poll>;
addPollOption(pollId: number, optionText: string): Promise<Poll>;
updatePollOption(pollId: number, pollOptionId: number, optionText: string): Promise<Poll>;
deletePollOption(pollId: number, pollOptionId: number): Promise<void>;
votePoll(pollId: number, pollOptionIds: number[]): Promise<PollVoteEvent>;
getPollChangeLogsSinceTimestamp(ts: number): Promise<PollChangelogs>;
getPollChangeLogsSinceToken(token: string): Promise<PollChangelogs>;
createPollListQuery(limit?: number): PollListQuery;
createPollVoterListQuery(pollId: number, pollOptionId: number, limit?: number): PollVoterListQuery;
pinMessage(messageId: number): Promise<void>;
unpinMessage(messageId: number): Promise<void>;
}
Expand Down Expand Up @@ -963,6 +963,7 @@ export declare class Poll {
votedPollOptionIds: number[];
applyPollUpdateEvent(event: PollUpdateEvent): boolean;
applyPollVoteEvent(event: PollVoteEvent): boolean;
serialize(): object;
}

export declare interface PollChangelogs {
Expand Down Expand Up @@ -996,6 +997,7 @@ export declare class PollModule extends Module {
create(params: PollCreateParams): Promise<Poll>;
get(params: PollRetrievalParams): Promise<Poll>;
getOption(params: PollOptionRetrievalParams): Promise<PollOption>;
buildPollFromSerializedData(serialized: object): Poll;
}

export declare class PollOption {
Expand Down Expand Up @@ -1317,17 +1319,20 @@ export declare class SendbirdChat {
}

export declare class SendbirdChatOptions {
websocketPayloadDecompression: boolean;
constructor({
useMemberInfoInMessage,
typingIndicatorInvalidateTime,
typingIndicatorThrottle,
websocketResponseTimeout,
websocketPayloadDecompression,
sessionTokenRefreshTimeout,
}?: {
useMemberInfoInMessage?: boolean;
typingIndicatorInvalidateTime?: number;
typingIndicatorThrottle?: number;
websocketResponseTimeout?: number;
websocketPayloadDecompression?: boolean;
sessionTokenRefreshTimeout?: number;
});
get useMemberInfoInMessage(): boolean;
Expand Down Expand Up @@ -1942,6 +1947,9 @@ declare abstract class OpenChannelHandlerParams extends BaseChannelHandlerParams
onUserEntered?: (channel: OpenChannel, user: User) => void;
onUserExited?: (channel: OpenChannel, user: User) => void;
onChannelParticipantCountChanged?: (channel: OpenChannel) => void;
onPollUpdated?: (channel: OpenChannel, event: PollUpdateEvent) => void;
onPollVoted?: (channel: OpenChannel, event: PollVoteEvent) => void;
onPollDeleted?: (channel: OpenChannel, id: number) => void;
}

export declare class OpenChannelListQuery extends BaseListQuery {
Expand Down
2 changes: 1 addition & 1 deletion message.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion openChannel.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "4.4.0",
"version": "4.5.0",
"description": "Sendbird SDK for JavaScript",
"name": "@sendbird/chat",
"author": "Sendbird <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion poll.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export{P as Poll,d as PollOption,p as PollStatus}from"./__bundle-2fe65dc2.js";export{m as PollListQuery,t as PollModule,P as PollUpdateEvent,b as PollVoteEvent,n as PollVoterListQuery}from"./__bundle-82219c3d.js";import"./__bundle-fa5be895.js";
export{P as Poll,d as PollOption,q as PollStatus}from"./__bundle-2c42a88c.js";export{Q as PollListQuery,O as PollModule,K as PollUpdateEvent,V as PollVoteEvent,T as PollVoterListQuery}from"./__bundle-b7a784a9.js";
2 changes: 1 addition & 1 deletion sendbird.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions sendbird.min.js

Large diffs are not rendered by default.

0 comments on commit 0a1072d

Please sign in to comment.