File tree Expand file tree Collapse file tree 4 files changed +28
-15
lines changed Expand file tree Collapse file tree 4 files changed +28
-15
lines changed Original file line number Diff line number Diff line change 145145 "emoji-mart" : " ^5.4.0" ,
146146 "react" : " ^18.0.0 || ^17.0.0 || ^16.8.0" ,
147147 "react-dom" : " ^18.0.0 || ^17.0.0 || ^16.8.0" ,
148- "stream-chat" : " ^8.44 .0"
148+ "stream-chat" : " ^8.45 .0"
149149 },
150150 "peerDependenciesMeta" : {
151151 "@breezystack/lamejs" : {
255255 "react-dom" : " ^18.1.0" ,
256256 "react-test-renderer" : " ^18.1.0" ,
257257 "semantic-release" : " ^19.0.5" ,
258- "stream-chat" : " ^8.44 .0" ,
258+ "stream-chat" : " ^8.45 .0" ,
259259 "ts-jest" : " ^29.1.4" ,
260260 "typescript" : " ^5.4.5"
261261 },
Original file line number Diff line number Diff line change @@ -639,14 +639,26 @@ describe('<MessageSimple />', () => {
639639 expect ( results ) . toHaveNoViolations ( ) ;
640640 } ) ;
641641
642- describe ( 'bounced message' , ( ) => {
643- const bouncedMessageOptions = {
644- moderation_details : {
645- action : 'MESSAGE_RESPONSE_ACTION_BOUNCE' ,
642+ describe . each ( [
643+ [
644+ 'v1' ,
645+ {
646+ moderation_details : {
647+ action : 'MESSAGE_RESPONSE_ACTION_BOUNCE' ,
648+ } ,
649+ type : 'error' ,
646650 } ,
647- type : 'error' ,
648- } ;
649-
651+ ] ,
652+ [
653+ 'v2' ,
654+ {
655+ moderation : {
656+ action : 'bounce' ,
657+ } ,
658+ type : 'error' ,
659+ } ,
660+ ] ,
661+ ] ) ( 'bounced message %s' , ( _ , bouncedMessageOptions ) => {
650662 it ( 'should render error badge for bounced messages' , async ( ) => {
651663 const message = generateAliceMessage ( bouncedMessageOptions ) ;
652664 const { queryByTestId } = await renderMessageSimple ( { message } ) ;
Original file line number Diff line number Diff line change @@ -485,10 +485,11 @@ export const isOnlyEmojis = (text?: string) => {
485485export const isMessageBounced = <
486486 StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
487487> (
488- message : Pick < StreamMessage < StreamChatGenerics > , 'type' | 'moderation_details' > ,
488+ message : Pick < StreamMessage < StreamChatGenerics > , 'type' | 'moderation' | ' moderation_details'> ,
489489) =>
490490 message . type === 'error' &&
491- message . moderation_details ?. action === 'MESSAGE_RESPONSE_ACTION_BOUNCE' ;
491+ ( message . moderation_details ?. action === 'MESSAGE_RESPONSE_ACTION_BOUNCE' ||
492+ message . moderation ?. action === 'bounce' ) ;
492493
493494export const isMessageEdited = <
494495 StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics
Original file line number Diff line number Diff line change 1220012200 resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63"
1220112201 integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==
1220212202
12203- stream-chat@^8.44 .0:
12204- version "8.44 .0"
12205- resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.44 .0.tgz#e48446cf91db786e80a2e7358ac4f1601e5e97f0 "
12206- integrity sha512-7HNtimD8sT/51rsFibGcD6uBgKj+vlKyYCZMDzjYQEaEsrLqyAg48dOyNM4L2FTF5aXgo9SlxZr21SPleeA2BA ==
12203+ stream-chat@^8.45 .0:
12204+ version "8.45 .0"
12205+ resolved "https://registry.yarnpkg.com/stream-chat/-/stream-chat-8.45 .0.tgz#bbb18ea897138dabb5ccd045a40958ec7242923c "
12206+ integrity sha512-re6GPh4F50ksB5/5GG5FtNAji+ZFTmIcLBIUhkGlnCwNaM8Ub59jcoI21Rtf/51+Nwrcitld2MzzlY49RlkwOA ==
1220712207 dependencies:
1220812208 "@babel/runtime" "^7.16.3"
1220912209 "@types/jsonwebtoken" "~9.0.0"
You can’t perform that action at this time.
0 commit comments