quickblox-react-ui-kit 0.5.1-beta.1 → 0.5.1-join-dialog-off.1

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.
Files changed (95) hide show
  1. package/dist/CommonTypes/BaseViewModel.d.ts +2 -0
  2. package/dist/CommonTypes/BaseViewModel.d.ts.map +1 -1
  3. package/dist/CommonTypes/CommonTypes.d.ts +1 -0
  4. package/dist/CommonTypes/CommonTypes.d.ts.map +1 -1
  5. package/dist/Data/Stubs.d.ts.map +1 -1
  6. package/dist/Data/dto/dialog/RemoteDialogDTO.d.ts +1 -0
  7. package/dist/Data/dto/dialog/RemoteDialogDTO.d.ts.map +1 -1
  8. package/dist/Data/mapper/DialogRemoteDTOMapper.d.ts.map +1 -1
  9. package/dist/Data/repository/DialogsRepository.d.ts +3 -0
  10. package/dist/Data/repository/DialogsRepository.d.ts.map +1 -1
  11. package/dist/Data/source/remote/IRemoteDataSource.d.ts +3 -0
  12. package/dist/Data/source/remote/IRemoteDataSource.d.ts.map +1 -1
  13. package/dist/Data/source/remote/Mapper/DialogDTOMapper.d.ts.map +1 -1
  14. package/dist/Data/source/remote/RemoteDataSource.d.ts +3 -0
  15. package/dist/Data/source/remote/RemoteDataSource.d.ts.map +1 -1
  16. package/dist/Domain/repository/IDialogsRepository.d.ts +3 -0
  17. package/dist/Domain/repository/IDialogsRepository.d.ts.map +1 -1
  18. package/dist/Domain/use_cases/CreateDialogWithAutoJoinUseCase.d.ts +13 -0
  19. package/dist/Domain/use_cases/CreateDialogWithAutoJoinUseCase.d.ts.map +1 -0
  20. package/dist/Domain/use_cases/JoinFromTheDialogUseCase.d.ts +11 -0
  21. package/dist/Domain/use_cases/JoinFromTheDialogUseCase.d.ts.map +1 -0
  22. package/dist/Domain/use_cases/UnJoinFromTheDialogUseCase.d.ts +11 -0
  23. package/dist/Domain/use_cases/UnJoinFromTheDialogUseCase.d.ts.map +1 -0
  24. package/dist/Presentation/Views/Dialog/useDialogViewModel.d.ts.map +1 -1
  25. package/dist/Presentation/Views/DialogInfo/DialogInfo.d.ts.map +1 -1
  26. package/dist/Presentation/Views/DialogList/DialogListViewModel.d.ts +4 -1
  27. package/dist/Presentation/Views/DialogList/DialogListViewModel.d.ts.map +1 -1
  28. package/dist/Presentation/Views/DialogList/useDialogListViewModel.d.ts.map +1 -1
  29. package/dist/Presentation/Views/EditDialog/EditDialog.d.ts.map +1 -1
  30. package/dist/Presentation/Views/Flow/CreateDialogFlow/CreateNewDialogFlow.d.ts.map +1 -1
  31. package/dist/QBconfig.d.ts.map +1 -1
  32. package/dist/index-ui.js +438 -90
  33. package/dist/qb-api-calls/index.d.ts +2 -0
  34. package/dist/qb-api-calls/index.d.ts.map +1 -1
  35. package/package.json +2 -2
  36. package/src/CommonTypes/BaseViewModel.ts +4 -0
  37. package/src/CommonTypes/CommonTypes.ts +1 -0
  38. package/src/Data/Stubs.ts +20 -10
  39. package/src/Data/dto/dialog/RemoteDialogDTO.ts +4 -0
  40. package/src/Data/mapper/DialogRemoteDTOMapper.ts +6 -0
  41. package/src/Data/repository/DialogsRepository.ts +57 -0
  42. package/src/Data/source/remote/IRemoteDataSource.ts +10 -0
  43. package/src/Data/source/remote/Mapper/DialogDTOMapper.ts +13 -0
  44. package/src/Data/source/remote/RemoteDataSource.ts +163 -65
  45. package/src/Domain/repository/IDialogsRepository.ts +10 -0
  46. package/src/Domain/use_cases/CreateDialogWithAutoJoinUseCase.ts +77 -0
  47. package/src/Domain/use_cases/JoinFromTheDialogUseCase.ts +61 -0
  48. package/src/Domain/use_cases/UnJoinFromTheDialogUseCase.ts +61 -0
  49. package/src/Presentation/Views/Dialog/useDialogViewModel.ts +46 -4
  50. package/src/Presentation/Views/DialogInfo/DialogInfo.tsx +36 -1
  51. package/src/Presentation/Views/DialogList/DialogListViewModel.ts +4 -1
  52. package/src/Presentation/Views/DialogList/useDialogListViewModel.ts +141 -12
  53. package/src/Presentation/Views/EditDialog/EditDialog.scss +18 -0
  54. package/src/Presentation/Views/EditDialog/EditDialog.tsx +10 -1
  55. package/src/Presentation/Views/Flow/CreateDialogFlow/CreateNewDialogFlow.tsx +25 -10
  56. package/src/Presentation/layouts/Desktop/DesktopLayout.scss +7 -0
  57. package/src/Presentation/ui-components/Header/Header.scss +7 -0
  58. package/src/QBconfig.ts +2 -0
  59. package/src/qb-api-calls/index.ts +88 -42
  60. package/storybook-static/{217.07d5c7a3.iframe.bundle.js → 217.f067a49f.iframe.bundle.js} +3 -3
  61. package/storybook-static/{217.07d5c7a3.iframe.bundle.js.map → 217.f067a49f.iframe.bundle.js.map} +1 -1
  62. package/storybook-static/{363.a2d33b79.iframe.bundle.js → 363.f6fcc1b9.iframe.bundle.js} +2 -2
  63. package/storybook-static/844.be4346f2.iframe.bundle.js +95 -0
  64. package/storybook-static/844.be4346f2.iframe.bundle.js.map +1 -0
  65. package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.46997cb0.iframe.bundle.js +2 -0
  66. package/storybook-static/Presentation-ui-components-Header-Header-stories.a4edfcc6.iframe.bundle.js +2 -0
  67. package/storybook-static/{Presentation-ui-components-MessageInput-MessageInput-stories.9b4b2514.iframe.bundle.js → Presentation-ui-components-MessageInput-MessageInput-stories.2af0de55.iframe.bundle.js} +1 -1
  68. package/storybook-static/docs-Introduction-mdx.46ed11c4.iframe.bundle.js +1 -0
  69. package/storybook-static/docs-Styling-mdx.3a86be03.iframe.bundle.js +1 -0
  70. package/storybook-static/iframe.html +2 -2
  71. package/storybook-static/project.json +1 -1
  72. package/storybook-static/{runtime~main.940703c6.iframe.bundle.js → runtime~main.ebabbef9.iframe.bundle.js} +1 -1
  73. package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js +1 -1
  74. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +8 -8
  75. package/storybook-static/sb-addons/essentials-docs-4/manager-bundle.js +4 -4
  76. package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js +1 -1
  77. package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js +1 -1
  78. package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js +1 -1
  79. package/storybook-static/sb-addons/interactions-11/manager-bundle.js +1 -1
  80. package/storybook-static/sb-addons/onboarding-1/manager-bundle.js +1 -1
  81. package/storybook-static/sb-manager/globals-module-info.js +1 -0
  82. package/storybook-static/sb-manager/globals-runtime.js +10372 -9836
  83. package/storybook-static/sb-manager/runtime.js +119 -119
  84. package/webpack.app.config.js +3 -3
  85. package/storybook-static/844.e8bfd664.iframe.bundle.js +0 -95
  86. package/storybook-static/844.e8bfd664.iframe.bundle.js.map +0 -1
  87. package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.a724643f.iframe.bundle.js +0 -2
  88. package/storybook-static/Presentation-ui-components-Header-Header-stories.978f0af5.iframe.bundle.js +0 -2
  89. package/storybook-static/docs-Introduction-mdx.5addfa61.iframe.bundle.js +0 -1
  90. package/storybook-static/docs-Styling-mdx.9f4235f1.iframe.bundle.js +0 -1
  91. /package/storybook-static/{217.07d5c7a3.iframe.bundle.js.LICENSE.txt → 217.f067a49f.iframe.bundle.js.LICENSE.txt} +0 -0
  92. /package/storybook-static/{363.a2d33b79.iframe.bundle.js.LICENSE.txt → 363.f6fcc1b9.iframe.bundle.js.LICENSE.txt} +0 -0
  93. /package/storybook-static/{844.e8bfd664.iframe.bundle.js.LICENSE.txt → 844.be4346f2.iframe.bundle.js.LICENSE.txt} +0 -0
  94. /package/storybook-static/{Presentation-ui-components-DialogWindow-DialogWindow-stories.a724643f.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-DialogWindow-DialogWindow-stories.46997cb0.iframe.bundle.js.LICENSE.txt} +0 -0
  95. /package/storybook-static/{Presentation-ui-components-Header-Header-stories.978f0af5.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Header-Header-stories.a4edfcc6.iframe.bundle.js.LICENSE.txt} +0 -0
package/dist/index-ui.js CHANGED
@@ -52,7 +52,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `:root{--primary: #3978FC;--color-backg
52
52
 
53
53
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
54
54
  // Module
55
- ___CSS_LOADER_EXPORT___.push([module.id, `.edit-container{min-height:236px;max-height:236px;height:236px;width:100%;display:flex;flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;align-items:flex-start}.edit-btn-container{min-height:34px;max-height:34px;height:34px;width:100%;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-end;align-items:flex-end}.edit-dialog-container{min-height:180px;max-height:180px;height:180px;width:100%;margin-bottom:24px}.edit-dialog-container--disable{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.5);z-index:100;display:block}.edit-dialog-container--wrapper{min-height:180px;display:flex;flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;align-items:flex-start}.edit-dialog-container--wrapper__inf{min-height:20px;font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.25px;color:var(--main-text)}.edit-dialog-container--wrapper__icon-container{min-height:56px;max-height:56px;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:flex-start}.edit-dialog-container--wrapper__icon-container__icon{min-height:56px;max-height:56px;height:56px;min-width:56px;margin-top:8px;background-color:var(--disabled-elements);border-radius:50%;text-align:center;align-content:center;display:flex;justify-content:center;align-items:center}.edit-dialog-container--wrapper__icon-container__upload{min-height:32px;max-height:32px;min-width:80px;max-width:80px;margin-top:8px;padding-left:16px;padding-top:20px;font-style:normal;font-weight:700;font-size:14px;line-height:16px;letter-spacing:.4px;color:var(--color-icon)}.edit-dialog-container--wrapper__upload-error{min-height:20px;font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.25px;margin-top:5px;color:var(--error)}.edit-dialog-container--wrapper__dialog-name-inf{min-height:20px;font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.25px;margin-top:24px;color:var(--main-text)}.edit-dialog-container--wrapper__text-field{width:100%}`, ""]);
55
+ ___CSS_LOADER_EXPORT___.push([module.id, `.edit-container{min-height:236px;max-height:236px;height:236px;width:100%;display:flex;flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;align-items:flex-start}.edit-btn-container{min-height:34px;max-height:34px;height:34px;width:100%;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-end;align-items:flex-end}.edit-dialog-container{min-height:180px;max-height:180px;height:180px;width:100%;margin-bottom:24px}.edit-dialog-container--disable{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.5);z-index:100;display:block}.edit-dialog-container--wrapper{min-height:180px;display:flex;flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;align-items:flex-start}.edit-dialog-container--wrapper__inf{min-height:20px;font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.25px;color:var(--main-text)}.edit-dialog-container--wrapper__icon-container{min-height:56px;max-height:56px;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-items:flex-start}.edit-dialog-container--wrapper__icon-container__icon{min-height:56px;max-height:56px;height:56px;min-width:56px;margin-top:8px;background-color:var(--disabled-elements);border-radius:50%;text-align:center;align-content:center;display:flex;justify-content:center;align-items:center}.edit-dialog-container--wrapper__icon-container__upload{min-height:32px;max-height:32px;min-width:80px;max-width:80px;margin-top:8px;padding-left:16px;padding-top:20px;font-style:normal;font-weight:700;font-size:14px;line-height:16px;letter-spacing:.4px;color:var(--color-icon)}.edit-dialog-container--wrapper__upload-error{min-height:20px;font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.25px;margin-top:5px;color:var(--error)}.edit-dialog-container--wrapper__dialog-name-inf{min-height:20px;font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.25px;margin-top:24px;color:var(--main-text)}.edit-dialog-container--wrapper__auto-join{min-height:20px;font-style:normal;font-weight:400;font-size:14px;line-height:20px;letter-spacing:.25px;margin-top:5px;color:var(--error);display:flex;flex-flow:row}.edit-dialog-container--wrapper__auto-join svg{margin:2px 2px 0 0;fill:var(--error)}.edit-dialog-container--wrapper__text-field{width:100%}`, ""]);
56
56
  // Exports
57
57
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
58
58
 
@@ -52560,7 +52560,23 @@ qbRTCPeerConnection.prototype.setLocalSessionDescription = function (params, cal
52560
52560
  );
52561
52561
  recvCodecs.unshift(arrayWithPreferredRecvCodec[0]);
52562
52562
  }
52563
- transceiver.setCodecPreferences(sendCodecs.concat(recvCodecs));
52563
+ // transceiver.setCodecPreferences(sendCodecs);
52564
+ // transceiver.setCodecPreferences(recvCodecs);
52565
+ //new code: without H264
52566
+ var filteredSendCodecs = sendCodecs.filter(function(codec) {
52567
+ return !codec.mimeType.toLowerCase().includes('h264');
52568
+ });
52569
+
52570
+ var filteredRecvCodecs = recvCodecs.filter(function(codec) {
52571
+ return !codec.mimeType.toLowerCase().includes('h264');
52572
+ });
52573
+
52574
+ var codecs = filteredSendCodecs.concat(filteredRecvCodecs);
52575
+
52576
+ // set up prefer codecs
52577
+ transceiver.setCodecPreferences(codecs);
52578
+ // original code
52579
+ // transceiver.setCodecPreferences(sendCodecs.concat(recvCodecs));
52564
52580
  }
52565
52581
  });
52566
52582
  }
@@ -55565,7 +55581,7 @@ module.exports = StreamManagement;
55565
55581
  */
55566
55582
 
55567
55583
  var config = {
55568
- version: '2.19.3-beta.4',
55584
+ version: '2.20.0',
55569
55585
  buildNumber: '1165',
55570
55586
  creds: {
55571
55587
  'appId': 0,
@@ -56726,7 +56742,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.message-context-menu-actions{border-r
56726
56742
 
56727
56743
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
56728
56744
  // Module
56729
- ___CSS_LOADER_EXPORT___.push([module.id, `.desktop-layout-main-container{display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:flex-start;margin:0 auto}.desktop-layout-main-container__item-left{border-bottom:1px solid var(--divider);flex:1 1 320px;height:100%}.desktop-layout-main-container__item-right{border:1px solid var(--divider);flex:1 0 320px;width:100%;height:100%}.desktop-layout-main-container__item-center{border-style:solid;border-color:var(--divider, #e7efff);border-width:1px 1px 1px 0;height:100%;width:100%}.dialog-leave-container{display:flex;align-items:center;justify-content:flex-end;margin-top:48px;gap:8px}.empty-chat-placeholder{display:flex;justify-content:center;align-items:center;height:100%}.empty-chat-history-placeholder{justify-content:center;height:100%}`, ""]);
56745
+ ___CSS_LOADER_EXPORT___.push([module.id, `.desktop-layout-main-container{display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:flex-start;margin:0 auto}.desktop-layout-main-container__item-left{border-bottom:1px solid var(--divider);flex:1 1 320px;height:100%}.desktop-layout-main-container__item-right{border:1px solid var(--divider);flex:1 0 320px;width:100%;height:100%}.desktop-layout-main-container__item-center{border-style:solid;border-color:var(--divider, #e7efff);border-width:1px 1px 1px 0;height:100%;width:100%}.dialog-leave-container{display:flex;align-items:center;justify-content:flex-end;margin-top:48px;gap:8px}.empty-chat-placeholder{display:flex;justify-content:center;align-items:center;height:100%}.empty-chat-history-placeholder{justify-content:center;height:100%}@media only screen and (max-width: 430px){.desktop-layout-main-container{display:block}}`, ""]);
56730
56746
  // Exports
56731
56747
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
56732
56748
 
@@ -59378,7 +59394,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.dialog-preview-container{display:flex
59378
59394
 
59379
59395
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
59380
59396
  // Module
59381
- ___CSS_LOADER_EXPORT___.push([module.id, `.dialog-header{width:100%;padding:12px 16px 12px 20px;display:flex;align-items:center;gap:33px}.dialog-header,.dialog-header *{box-sizing:border-box}.dialog-header__icon{cursor:pointer;width:24px;height:24px;flex-shrink:0}.dialog-header__icon svg{width:24px;height:24px;fill:var(--main-elements)}.dialog-header__back{color:var(--main-text);fill:var(--main-text)}.dialog-header__body{width:100%;display:flex;gap:33px;align-items:center;justify-content:space-between;overflow:hidden}.dialog-header__body-left{display:flex;align-items:center;justify-content:flex-start;gap:8px;overflow:hidden}.dialog-header__body-right{height:24px;display:flex;align-items:center;gap:16px}.dialog-header__title{color:var(--main-text, #0b1b0f);text-align:left;font:var(--title-title-large);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dialog-header__line{border-style:solid;border-color:var(--color-divider, #e7efff);border-width:0 0 1px 0}@media only screen and (max-width: var(--min-width-screen-desktop)){.dialog-header__body-left{gap:3px}}@media only screen and (min-width: 981px){.dialog-header__back{display:none}}`, ""]);
59397
+ ___CSS_LOADER_EXPORT___.push([module.id, `.dialog-header{width:100%;padding:12px 16px 12px 20px;display:flex;align-items:center;gap:33px}.dialog-header,.dialog-header *{box-sizing:border-box}.dialog-header__icon{cursor:pointer;width:24px;height:24px;flex-shrink:0}.dialog-header__icon svg{width:24px;height:24px;fill:var(--main-elements)}.dialog-header__back{color:var(--main-text);fill:var(--main-text)}.dialog-header__body{width:100%;display:flex;gap:33px;align-items:center;justify-content:space-between;overflow:hidden}.dialog-header__body-left{display:flex;align-items:center;justify-content:flex-start;gap:8px;overflow:hidden}.dialog-header__body-right{height:24px;display:flex;align-items:center;gap:16px}.dialog-header__title{color:var(--main-text, #0b1b0f);text-align:left;font:var(--title-title-large);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dialog-header__line{border-style:solid;border-color:var(--color-divider, #e7efff);border-width:0 0 1px 0}@media only screen and (max-width: var(--min-width-screen-desktop)){.dialog-header__body-left{gap:3px}.dialog-header__body{width:unset}}@media only screen and (min-width: 981px){.dialog-header__back{display:none}}`, ""]);
59382
59398
  // Exports
59383
59399
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
59384
59400
 
@@ -61421,6 +61437,7 @@ class RemoteDialogDTO {
61421
61437
  unreadMessageCount;
61422
61438
  name;
61423
61439
  photo;
61440
+ is_join_required;
61424
61441
  constructor() {
61425
61442
  this.id = '';
61426
61443
  this.type = 0;
@@ -61435,6 +61452,7 @@ class RemoteDialogDTO {
61435
61452
  this.unreadMessageCount = 0;
61436
61453
  this.name = '';
61437
61454
  this.photo = '';
61455
+ this.is_join_required = undefined;
61438
61456
  }
61439
61457
  }
61440
61458
 
@@ -61499,6 +61517,7 @@ class DialogDTOMapper {
61499
61517
  updated_at: dialogDTO.updatedAt,
61500
61518
  user_id: parseInt(dialogDTO.ownerId, 10),
61501
61519
  xmpp_room_jid: null,
61520
+ is_join_required: dialogDTO.is_join_required,
61502
61521
  };
61503
61522
  return Promise.resolve(dialog);
61504
61523
  }
@@ -61692,6 +61711,11 @@ class DialogDTOMapper {
61692
61711
  const { updatedAt } = v;
61693
61712
  return updatedAt !== undefined && updatedAt !== null;
61694
61713
  },
61714
+ is_join_required(v) {
61715
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
61716
+ const { is_join_required } = v;
61717
+ return true;
61718
+ },
61695
61719
  };
61696
61720
  if (!dialogDTOValidator.id(dto))
61697
61721
  throw new MapperDTOException(INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');
@@ -61784,6 +61808,11 @@ class DialogDTOMapper {
61784
61808
  const { xmpp_room_jid } = v;
61785
61809
  return xmpp_room_jid !== undefined && xmpp_room_jid !== null;
61786
61810
  },
61811
+ is_join_required(v) {
61812
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
61813
+ const { is_join_required } = v;
61814
+ return true;
61815
+ },
61787
61816
  };
61788
61817
  if (!qbDialogValidator._id(qbDialog))
61789
61818
  throw new MapperDTOException(INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty');
@@ -62354,6 +62383,63 @@ function QBCreateGroupDialog(userIds, dialogName, data) {
62354
62383
  });
62355
62384
  });
62356
62385
  }
62386
+ // START
62387
+ function QBCreatePrivateDialogWithAutojoinFalse(userId, dialogName, data) {
62388
+ console.log(`call QBCreatePrivateDialog with userid: ${userId} dialog name: ${dialogName || '-'}`);
62389
+ return new Promise((resolve, reject) => {
62390
+ // eslint-disable-next-line @typescript-eslint/no-shadow
62391
+ const QB = getQB();
62392
+ QB.chat.dialog.create({ name: dialogName || '-', occupants_ids: [userId], type: 3, data, is_join_required: 0 }, (error, chat) => {
62393
+ if (error) {
62394
+ reject(stringifyError(error));
62395
+ }
62396
+ else {
62397
+ resolve(chat);
62398
+ }
62399
+ });
62400
+ });
62401
+ }
62402
+ function QBCreateGroupDialogWithAutojoinFalse(userIds, dialogName, data) {
62403
+ console.log(`call QBCreateGroupDialog with ids: ${JSON.stringify(userIds)} name: ${dialogName || ''}`);
62404
+ let params = {};
62405
+ if (data && data?.photo) {
62406
+ params = {
62407
+ name: dialogName || '-',
62408
+ occupants_ids: [userIds],
62409
+ type: 2,
62410
+ photo: data?.photo,
62411
+ is_join_required: 0,
62412
+ };
62413
+ }
62414
+ else {
62415
+ params = {
62416
+ name: dialogName || '-',
62417
+ occupants_ids: [userIds],
62418
+ type: 2,
62419
+ is_join_required: 0
62420
+ };
62421
+ }
62422
+ return new Promise((resolve, reject) => {
62423
+ // eslint-disable-next-line @typescript-eslint/no-shadow
62424
+ const QB = getQB();
62425
+ QB.chat.dialog.create(
62426
+ // {
62427
+ // name: dialogName || '-',
62428
+ // occupants_ids: [userIds],
62429
+ // type: 2,
62430
+ // photo: data?.photo,
62431
+ // },
62432
+ params, (error, chat) => {
62433
+ if (error) {
62434
+ reject(parse_stringifyError(error));
62435
+ }
62436
+ else {
62437
+ resolve(chat);
62438
+ }
62439
+ });
62440
+ });
62441
+ }
62442
+ // END
62357
62443
  function QBUpdateDialog(dialogId, data) {
62358
62444
  return new Promise((resolve, reject) => {
62359
62445
  // eslint-disable-next-line @typescript-eslint/no-shadow
@@ -62373,15 +62459,9 @@ function QBJoinGroupDialog(dialogId) {
62373
62459
  // eslint-disable-next-line @typescript-eslint/no-shadow
62374
62460
  const QB = getQB();
62375
62461
  const dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);
62376
- // QB.chat.muc.join(dialogJid, (error, res) => {
62377
- // if (error) {
62378
- // console.log('ERROR in QBJoinGroupDialog with join group dialog:', error);
62379
- // reject(stringifyError(error));
62380
- // } else {
62381
- // console.log('QBJoinGroupDialog: join group dialog:', res);
62382
- // resolve(res);
62383
- // }
62384
- // });
62462
+ // для ВЕРСИИ ТЕСТОВОГО ПРИМЕРА СПИСОК ДИАЛГОВ БЕЗ АВТОДЖОИНА нужно просто закомментировать
62463
+ // содержимое этого
62464
+ // метода
62385
62465
  QB.chat.muc.join(dialogJid, (error, res) => {
62386
62466
  if (error) {
62387
62467
  console.log('ERROR in QBJoinGroupDialog with join group dialog:', error);
@@ -62433,9 +62513,10 @@ function QBLeaveDialog(dialogId) {
62433
62513
  // eslint-disable-next-line @typescript-eslint/no-shadow
62434
62514
  const QB = getQB();
62435
62515
  const dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);
62516
+ // unjoin
62436
62517
  QB.chat.muc.leave(dialogJid, (error, res) => {
62437
62518
  if (error) {
62438
- reject(stringifyError(error));
62519
+ reject(parse_stringifyError(error));
62439
62520
  }
62440
62521
  else {
62441
62522
  resolve(res);
@@ -62485,33 +62566,6 @@ function QBCreateAndUploadContent(paramContent) {
62485
62566
  });
62486
62567
  });
62487
62568
  }
62488
- // export function QBChatGetMessages(
62489
- // dialogId: QBChatDialog['_id'],
62490
- // skip = 0,
62491
- // limit = 100,
62492
- // ) {
62493
- // return new Promise<GetMessagesResult & { dialogId: QBChatDialog['_id'] }>(
62494
- // (resolve, reject) => {
62495
- // QB.chat.message.list(
62496
- // {
62497
- // chat_dialog_id: dialogId,
62498
- // sort_desc: 'date_sent',
62499
- // limit,
62500
- // skip,
62501
- // mark_as_read: 0,
62502
- // },
62503
- // (error, messages) => {
62504
- // if (error) {
62505
- // reject(stringifyError(error));
62506
- // } else {
62507
- // resolve({ ...messages, dialogId });
62508
- // }
62509
- // },
62510
- // );
62511
- // },
62512
- // );
62513
- // }
62514
- // //
62515
62569
  function qbChatGetMessagesExtended(dialogId, params = {}) {
62516
62570
  return new Promise((resolve, reject) => {
62517
62571
  // eslint-disable-next-line @typescript-eslint/no-shadow
@@ -62599,9 +62653,6 @@ function QBWebRTCSessionGetUserMedia(session, params) {
62599
62653
  });
62600
62654
  });
62601
62655
  }
62602
- // export interface AIAnswerResponse {
62603
- // answer: string;
62604
- // } // artim 19.05.2024
62605
62656
  function QBAnswerAssist(smartChatAssistantId, messageToAssist, history) {
62606
62657
  return new Promise((resolve, reject) => {
62607
62658
  // eslint-disable-next-line @typescript-eslint/no-shadow
@@ -63722,12 +63773,12 @@ class Stubs {
63722
63773
  id: '10231',
63723
63774
  type: FileType.image,
63724
63775
  uid: '10231',
63725
- url: 'https://files.readme.io/00b5563-small-qb-logo-docs-white-9px.png',
63776
+ url: 'https://via.placeholder.com/600/92c952',
63726
63777
  file: {
63727
63778
  id: '10231',
63728
63779
  uid: '',
63729
63780
  type: FileType.image,
63730
- url: 'https://files.readme.io/00b5563-small-qb-logo-docs-white-9px.png',
63781
+ url: 'https://via.placeholder.com/600/92c952',
63731
63782
  },
63732
63783
  };
63733
63784
  const photoAttachments = [photo];
@@ -63816,12 +63867,12 @@ class Stubs {
63816
63867
  id: '10231',
63817
63868
  type: FileType.image,
63818
63869
  uid: '10231',
63819
- url: 'https://cdn-ikpjoif.nitrocdn.com/WZsqFPiehrtwFaaeJNQAQZrkRMgaTuyL/assets/images/optimized/rev-83f47e6/quickblox.com/wp-content/themes/QuickbloxTheme2021/img/chat-api-feature-rich-sdk.jpg',
63870
+ url: 'https://via.placeholder.com/600/92c952',
63820
63871
  file: {
63821
63872
  id: '10231',
63822
63873
  uid: '',
63823
63874
  type: FileType.image,
63824
- url: 'https://cdn-ikpjoif.nitrocdn.com/WZsqFPiehrtwFaaeJNQAQZrkRMgaTuyL/assets/images/optimized/rev-83f47e6/quickblox.com/wp-content/themes/QuickbloxTheme2021/img/chat-api-feature-rich-sdk.jpg',
63875
+ url: 'https://via.placeholder.com/600/92c952',
63825
63876
  },
63826
63877
  };
63827
63878
  const photoAttachments = [photo];
@@ -64050,6 +64101,7 @@ class Stubs {
64050
64101
  lastMessageId: '',
64051
64102
  unreadMessageCount: 0,
64052
64103
  updatedAt: '',
64104
+ is_join_required: undefined,
64053
64105
  },
64054
64106
  {
64055
64107
  id: '2',
@@ -64065,6 +64117,7 @@ class Stubs {
64065
64117
  lastMessageId: '',
64066
64118
  unreadMessageCount: 0,
64067
64119
  updatedAt: '',
64120
+ is_join_required: undefined,
64068
64121
  },
64069
64122
  {
64070
64123
  id: '3',
@@ -64080,6 +64133,7 @@ class Stubs {
64080
64133
  lastMessageId: '',
64081
64134
  unreadMessageCount: 0,
64082
64135
  updatedAt: '',
64136
+ is_join_required: undefined,
64083
64137
  },
64084
64138
  {
64085
64139
  id: '4',
@@ -64095,6 +64149,7 @@ class Stubs {
64095
64149
  lastMessageId: '',
64096
64150
  unreadMessageCount: 0,
64097
64151
  updatedAt: '',
64152
+ is_join_required: undefined,
64098
64153
  },
64099
64154
  {
64100
64155
  id: '5',
@@ -64110,6 +64165,7 @@ class Stubs {
64110
64165
  lastMessageId: '',
64111
64166
  unreadMessageCount: 0,
64112
64167
  updatedAt: '',
64168
+ is_join_required: undefined,
64113
64169
  },
64114
64170
  {
64115
64171
  id: '6',
@@ -64125,6 +64181,7 @@ class Stubs {
64125
64181
  lastMessageId: '',
64126
64182
  unreadMessageCount: 0,
64127
64183
  updatedAt: '',
64184
+ is_join_required: undefined,
64128
64185
  },
64129
64186
  {
64130
64187
  id: '7',
@@ -64140,6 +64197,7 @@ class Stubs {
64140
64197
  lastMessageId: '',
64141
64198
  unreadMessageCount: 0,
64142
64199
  updatedAt: '',
64200
+ is_join_required: undefined,
64143
64201
  },
64144
64202
  ];
64145
64203
  return dialogs;
@@ -64161,6 +64219,7 @@ class Stubs {
64161
64219
  updated_at: '02.03.2023',
64162
64220
  user_id: 0,
64163
64221
  xmpp_room_jid: null,
64222
+ is_join_required: undefined,
64164
64223
  };
64165
64224
  return qbDialog;
64166
64225
  }
@@ -64181,6 +64240,7 @@ class Stubs {
64181
64240
  updated_at: '02.03.2023',
64182
64241
  user_id: 0,
64183
64242
  xmpp_room_jid: null,
64243
+ is_join_required: undefined,
64184
64244
  };
64185
64245
  return qbDialog;
64186
64246
  }
@@ -64201,6 +64261,7 @@ class Stubs {
64201
64261
  updated_at: '02.03.2023',
64202
64262
  user_id: 0,
64203
64263
  xmpp_room_jid: null,
64264
+ is_join_required: undefined,
64204
64265
  };
64205
64266
  return qbDialog;
64206
64267
  }
@@ -64304,12 +64365,12 @@ class Stubs {
64304
64365
  id: '10231',
64305
64366
  type: FileType.image,
64306
64367
  uid: '10231',
64307
- url: 'https://files.readme.io/00b5563-small-qb-logo-docs-white-9px.png',
64368
+ url: 'https://via.placeholder.com/600/92c952',
64308
64369
  file: {
64309
64370
  id: '10231',
64310
64371
  uid: '',
64311
64372
  type: FileType.image,
64312
- url: 'https://files.readme.io/00b5563-small-qb-logo-docs-white-9px.png',
64373
+ url: 'https://via.placeholder.com/600/92c952',
64313
64374
  },
64314
64375
  };
64315
64376
  const photoAttachments = [photo];
@@ -65381,6 +65442,11 @@ class DialogRemoteDTOMapper {
65381
65442
  const { updatedAt } = v;
65382
65443
  return updatedAt !== undefined;
65383
65444
  },
65445
+ is_join_required(v) {
65446
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
65447
+ const { is_join_required } = v;
65448
+ return true;
65449
+ },
65384
65450
  };
65385
65451
  if (!dtoValidator.id(data))
65386
65452
  throw new MapperDTOException(INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE, INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE, 'field {id} does not exist or empty in DTO');
@@ -65703,6 +65769,8 @@ const QBConfig = {
65703
65769
  },
65704
65770
  pingLocalhostTimeInterval: 5,
65705
65771
  chatReconnectionTimeInterval: 3,
65772
+ showPublicDialogsInList: false,
65773
+ allowPublicDialogCreation: false,
65706
65774
  debug: true,
65707
65775
  enableForwarding: true,
65708
65776
  enableReplying: true,
@@ -66311,17 +66379,26 @@ class RemoteDataSource {
66311
66379
  }
66312
66380
  //get dialogs flow
66313
66381
  async joinGroupDialog(dialogId) {
66314
- try {
66315
- await QBJoinGroupDialog(dialogId).catch(() => {
66316
- this.joinStatusMap.set(dialogId, false);
66317
- throw new RemoteDataSourceException(INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);
66318
- });
66319
- this.joinStatusMap.set(dialogId, true);
66320
- }
66321
- catch (reason) {
66322
- console.log(`QBJoinGroupDialog error for dialog ${dialogId}:`, reason);
66382
+ // try {
66383
+ // await QBJoinGroupDialog(dialogId).catch(() => {
66384
+ // this.joinStatusMap.set(dialogId, false);
66385
+ // throw new RemoteDataSourceException(
66386
+ // INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE,
66387
+ // INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE,
66388
+ // );
66389
+ // });
66390
+ // this.joinStatusMap.set(dialogId, true);
66391
+ // } catch (reason) {
66392
+ // console.log(`QBJoinGroupDialog error for dialog ${dialogId}:`, reason);
66393
+ // this.joinStatusMap.set(dialogId, false);
66394
+ // }
66395
+ }
66396
+ async joinDialog(dialogDto) {
66397
+ const dialogId = dialogDto.id;
66398
+ await QBJoinGroupDialog(dialogId).catch(() => {
66323
66399
  this.joinStatusMap.set(dialogId, false);
66324
- }
66400
+ throw new RemoteDataSourceException(INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);
66401
+ });
66325
66402
  }
66326
66403
  //version 0.5.0-beta.11,12,14
66327
66404
  startJoinRetryProcess() {
@@ -66385,7 +66462,8 @@ class RemoteDataSource {
66385
66462
  if (!qbEntity)
66386
66463
  continue;
66387
66464
  const newDTO = await this.getCurrentDialogDTOMapper().toTDO(qbEntity);
66388
- if (newDTO.type === DialogType.group && !this.processedDialogs.has(newDTO.id)) {
66465
+ if (newDTO.type === DialogType.group &&
66466
+ !this.processedDialogs.has(newDTO.id)) {
66389
66467
  this.processedDialogs.add(newDTO.id);
66390
66468
  if (!this.joinStatusMap.has(newDTO.id)) {
66391
66469
  this.joinStatusMap.set(newDTO.id, false);
@@ -66620,6 +66698,26 @@ class RemoteDataSource {
66620
66698
  console.log('have result in createDialog in remote ds: ', JSON.stringify(newDTO));
66621
66699
  return Promise.resolve(newDTO);
66622
66700
  }
66701
+ async createDialogWithAutojoin(dto) {
66702
+ console.log('call createDialogWithAutoJoin in remote with params: ', JSON.stringify(dto));
66703
+ const qbEntity = await this.getCurrentDialogDTOMapper().fromDTO(dto);
66704
+ let qbDialog;
66705
+ if (qbEntity.type === DialogType.private) {
66706
+ const participantId = qbEntity.occupants_ids[0];
66707
+ qbDialog = await QBCreatePrivateDialog(participantId, qbEntity.name);
66708
+ }
66709
+ else if (qbEntity.type === DialogType.group) {
66710
+ const participants = qbEntity.occupants_ids;
66711
+ const data = { photo: qbEntity.photo };
66712
+ qbDialog = await QBCreateGroupDialogWithAutojoinFalse(participants, qbEntity.name, data);
66713
+ }
66714
+ if (qbDialog === null || qbDialog === undefined) {
66715
+ return Promise.reject(new RemoteDataSourceException(INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE));
66716
+ }
66717
+ const newDTO = await this.getCurrentDialogDTOMapper().toTDO(qbDialog);
66718
+ console.log('have result in createDialog in remote ds: ', JSON.stringify(newDTO));
66719
+ return Promise.resolve(newDTO);
66720
+ }
66623
66721
  async updateDialog(dto) {
66624
66722
  const qbEntity = await this.getCurrentDialogDTOMapper().fromDTO(dto);
66625
66723
  let data = {};
@@ -66687,6 +66785,14 @@ class RemoteDataSource {
66687
66785
  }
66688
66786
  return Promise.resolve();
66689
66787
  }
66788
+ async unjoinUsersFromDialog(dialogDTO) {
66789
+ const qbEntity = await this.getCurrentDialogDTOMapper().fromDTO(dialogDTO);
66790
+ const qbResult = await QBLeaveDialog(qbEntity._id);
66791
+ if (qbResult === null || qbResult === undefined) {
66792
+ return Promise.reject(new RemoteDataSourceException(INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE));
66793
+ }
66794
+ return Promise.resolve();
66795
+ }
66690
66796
  // async getUser(dto: RemoteUserDTO): Promise<RemoteUserDTO> {
66691
66797
  // const currentItem: QBUser | undefined = await QBUsersGetById(
66692
66798
  // parseInt(dto.id, 10),
@@ -67152,6 +67258,20 @@ class DialogsRepository {
67152
67258
  return Promise.reject(e);
67153
67259
  }
67154
67260
  }
67261
+ async createDialogWithAutojoinInRemote(entity) {
67262
+ console.log('call createDialogInRemote in Repository with param: ', JSON.stringify(entity));
67263
+ const remoteDialogDTO = await this.dialogRemoteDTOMapper.fromEntity(entity);
67264
+ console.log('have remoteDialogDTO: ', JSON.stringify(remoteDialogDTO));
67265
+ try {
67266
+ const resultDTO = await this.remoteDataSource.createDialogWithAutojoin(remoteDialogDTO);
67267
+ const resultEntity = await this.dialogRemoteDTOMapper.toEntity(resultDTO);
67268
+ console.log('have result entity in createDialogInRemote:', JSON.stringify(resultEntity));
67269
+ return Promise.resolve(resultEntity);
67270
+ }
67271
+ catch (e) {
67272
+ return Promise.reject(e);
67273
+ }
67274
+ }
67155
67275
  async updateDialogInLocal(entity) {
67156
67276
  try {
67157
67277
  const dto = await this.dialogLocalDTOMapper.fromEntity(entity);
@@ -67308,6 +67428,18 @@ class DialogsRepository {
67308
67428
  return Promise.reject(e);
67309
67429
  }
67310
67430
  }
67431
+ async unjoinUsersFromDialog(dialogId) {
67432
+ const dialogDTO = new RemoteDialogDTO();
67433
+ dialogDTO.id = dialogId;
67434
+ await this.remoteDataSource.unjoinUsersFromDialog(dialogDTO);
67435
+ return Promise.resolve(true);
67436
+ }
67437
+ async joinUsersFromDialog(dialogId) {
67438
+ const dialogDTO = new RemoteDialogDTO();
67439
+ dialogDTO.id = dialogId;
67440
+ await this.remoteDataSource.joinDialog(dialogDTO);
67441
+ return Promise.resolve(true);
67442
+ }
67311
67443
  }
67312
67444
 
67313
67445
  ;// ./src/Domain/use_cases/base/BaseUseCase.ts
@@ -69816,6 +69948,84 @@ class UpdateCurrentDialogInDataSourceUseCase {
69816
69948
  }
69817
69949
  }
69818
69950
 
69951
+ ;// ./src/Domain/use_cases/CreateDialogWithAutoJoinUseCase.ts
69952
+
69953
+
69954
+
69955
+
69956
+ class CreateDialogWithAutoJoinUseCase {
69957
+ dialogRepository;
69958
+ eventMessagesRepository;
69959
+ newDialog;
69960
+ textInformationMessage;
69961
+ constructor(eventMessagesRepository, dialogRepository, newDialog, textInformationMessage) {
69962
+ this.dialogRepository = dialogRepository;
69963
+ this.newDialog = newDialog;
69964
+ this.eventMessagesRepository = eventMessagesRepository;
69965
+ this.textInformationMessage = textInformationMessage;
69966
+ }
69967
+ async execute() {
69968
+ console.log('execute CreateDialogWithAutoJoinUseCase', JSON.stringify(this.newDialog));
69969
+ const result = await this.dialogRepository
69970
+ .createDialogWithAutojoinInRemote(this.newDialog)
69971
+ .catch((e) => {
69972
+ const message = parse_stringifyError(e);
69973
+ console.log('EXCEPTION IN CREATE DIALOG WITH AUTO JOIN USE CASE', message);
69974
+ throw Error(message);
69975
+ });
69976
+ await this.dialogRepository.saveDialogToLocal(result);
69977
+ this.eventMessagesRepository.dispatchEvent(EventMessageType.LocalMessage, result, []);
69978
+ const remoteMessageDTO = new RemoteMessageDTO();
69979
+ remoteMessageDTO.dialogId = result.id;
69980
+ remoteMessageDTO.notification_type = NotificationTypes.NEW_DIALOG;
69981
+ this.eventMessagesRepository.dispatchEvent(EventMessageType.SystemMessage, remoteMessageDTO, [...this.newDialog.participantIds]);
69982
+ remoteMessageDTO.dialogId = result.id;
69983
+ remoteMessageDTO.notification_type = NotificationTypes.NEW_DIALOG;
69984
+ remoteMessageDTO.date_sent = Date.now() / 1000;
69985
+ remoteMessageDTO.message =
69986
+ this.textInformationMessage && this.textInformationMessage.length > 0
69987
+ ? this.textInformationMessage
69988
+ : `User ${this.newDialog.ownerId} create new dialog ${this.newDialog.name}`;
69989
+ this.eventMessagesRepository.dispatchEvent(EventMessageType.RegularMessage, remoteMessageDTO, [...this.newDialog.participantIds]);
69990
+ return Promise.resolve(result);
69991
+ }
69992
+ }
69993
+
69994
+ ;// ./src/Domain/use_cases/UnJoinFromTheDialogUseCase.ts
69995
+
69996
+
69997
+
69998
+ class UnJoinFromTheDialogUseCase {
69999
+ dialogRepository;
70000
+ eventMessagesRepository;
70001
+ dialogToLeave;
70002
+ constructor(eventMessagesRepository, dialogRepository, dialog) {
70003
+ this.eventMessagesRepository = eventMessagesRepository;
70004
+ this.dialogRepository = dialogRepository;
70005
+ this.dialogToLeave = dialog;
70006
+ }
70007
+ async execute() {
70008
+ console.log('execute UnJoinFromTheDialogUseCase');
70009
+ let resultOperation = false;
70010
+ const remoteMessageDTO = new RemoteMessageDTO();
70011
+ remoteMessageDTO.dialogId = this.dialogToLeave.id;
70012
+ remoteMessageDTO.notification_type = NotificationTypes.DELETE_LEAVE_DIALOG;
70013
+ remoteMessageDTO.date_sent = Date.now();
70014
+ await this.dialogRepository
70015
+ .unjoinUsersFromDialog(this.dialogToLeave.id)
70016
+ .then(() => {
70017
+ resultOperation = true;
70018
+ console.log('Leave from Dialog successes');
70019
+ return resultOperation;
70020
+ })
70021
+ .catch((reason) => {
70022
+ console.log('have exception in leave Dialog : ', parse_stringifyError(reason));
70023
+ resultOperation = false;
70024
+ });
70025
+ return resultOperation;
70026
+ }
70027
+ }
70028
+
69819
70029
  ;// ./src/Presentation/Views/DialogList/useDialogListViewModel.ts
69820
70030
 
69821
70031
 
@@ -69836,6 +70046,8 @@ class UpdateCurrentDialogInDataSourceUseCase {
69836
70046
 
69837
70047
 
69838
70048
 
70049
+
70050
+
69839
70051
 
69840
70052
 
69841
70053
 
@@ -69963,18 +70175,34 @@ function useDialogListViewModel(currentContext, initPagination) {
69963
70175
  .then((newItem) => {
69964
70176
  //
69965
70177
  setDialogs((prevDialogs) => {
69966
- const newDialogs = [
69967
- ...prevDialogs,
69968
- newItem,
69969
- ];
69970
- const sortedData = [...newDialogs].sort((a, b) => {
69971
- return b.lastMessage.dateSent && a.lastMessage.dateSent
69972
- ? new Date(b.lastMessage.dateSent).getTime() -
69973
- new Date(a.lastMessage.dateSent).getTime()
69974
- : new Date(b.updatedAt).getTime() -
69975
- new Date(a.updatedAt).getTime();
70178
+ let updatedDialogs;
70179
+ if (newItem.type === DialogType.private) {
70180
+ const filteredDialogs = prevDialogs.filter(d => d.id !== newItem.id);
70181
+ updatedDialogs = [...filteredDialogs, newItem];
70182
+ }
70183
+ else {
70184
+ updatedDialogs = [...prevDialogs, newItem];
70185
+ }
70186
+ const sortedDialogs = updatedDialogs.sort((a, b) => {
70187
+ const aDate = a.lastMessage?.dateSent ?? a.updatedAt;
70188
+ const bDate = b.lastMessage?.dateSent ?? b.updatedAt;
70189
+ return new Date(bDate).getTime() - new Date(aDate).getTime();
69976
70190
  });
69977
- return sortedData;
70191
+ return sortedDialogs;
70192
+ // const newDialogs = [
70193
+ // ...prevDialogs,
70194
+ // newItem as PublicDialogEntity,
70195
+ // ];
70196
+ //
70197
+ // const sortedData = [...newDialogs].sort((a, b) => {
70198
+ // return b.lastMessage.dateSent && a.lastMessage.dateSent
70199
+ // ? new Date(b.lastMessage.dateSent).getTime() -
70200
+ // new Date(a.lastMessage.dateSent).getTime()
70201
+ // : new Date(b.updatedAt).getTime() -
70202
+ // new Date(a.updatedAt).getTime();
70203
+ // });
70204
+ //
70205
+ // return sortedData;
69978
70206
  });
69979
70207
  //
69980
70208
  })
@@ -70055,6 +70283,22 @@ function useDialogListViewModel(currentContext, initPagination) {
70055
70283
  }
70056
70284
  return Promise.reject(resultDialog);
70057
70285
  };
70286
+ const createDialogForAutoJoin = async (dialogInfo, disableAutoJoin) => {
70287
+ const textInformationMessage = `${currentUserName} create the chat`;
70288
+ const createDialogWitAutoJoinUseCase = new CreateDialogWithAutoJoinUseCase(eventMessageRepository, new DialogsRepository(currentContext.storage.LOCAL_DATA_SOURCE, remoteDataSourceMock), dialogInfo, textInformationMessage);
70289
+ const resultDialog = await createDialogWitAutoJoinUseCase
70290
+ .execute()
70291
+ .catch((e) => {
70292
+ console.log('EXCEPTION IN CREATE NEW DIALOG WITH AUTO JOIN: ', parse_stringifyError(e));
70293
+ setNewDialog(undefined);
70294
+ throw new Error(parse_stringifyError(e));
70295
+ });
70296
+ if (resultDialog) {
70297
+ setNewDialog(resultDialog);
70298
+ return Promise.resolve(resultDialog);
70299
+ }
70300
+ return Promise.reject(resultDialog);
70301
+ };
70058
70302
  const updateDialog = async (
70059
70303
  // eslint-disable-next-line @typescript-eslint/no-shadow,@typescript-eslint/no-unused-vars
70060
70304
  dialog) => {
@@ -70110,6 +70354,42 @@ function useDialogListViewModel(currentContext, initPagination) {
70110
70354
  }
70111
70355
  return Promise.reject(leaveResult);
70112
70356
  };
70357
+ const unJoinDialog = async (
70358
+ // eslint-disable-next-line @typescript-eslint/no-shadow,@typescript-eslint/no-unused-vars
70359
+ dialogToDelete) => {
70360
+ let unJoinResult = false;
70361
+ if (dialogToDelete.type === DialogType.group) {
70362
+ const usersForDeleteFromDialog = new Array();
70363
+ const userToDeleteId = remoteDataSourceMock?.authInformation?.userId || 0;
70364
+ usersForDeleteFromDialog.push(userToDeleteId);
70365
+ const unjoinFromDialog = new UnJoinFromTheDialogUseCase(eventMessageRepository, new DialogsRepository(currentContext.storage.LOCAL_DATA_SOURCE, remoteDataSourceMock), dialogToDelete);
70366
+ unJoinResult = await unjoinFromDialog.execute().catch((e) => {
70367
+ console.log('Error delete users from UnJoinFromTheDialogUseCase: ', parse_stringifyError(e));
70368
+ throw new Error(parse_stringifyError(e));
70369
+ });
70370
+ }
70371
+ if (unJoinResult) {
70372
+ return Promise.resolve(unJoinResult);
70373
+ }
70374
+ return Promise.reject(unJoinResult);
70375
+ };
70376
+ // нужно вызвать из разметки в режиме редактирования
70377
+ const joinToDialog = async (
70378
+ // eslint-disable-next-line @typescript-eslint/no-shadow,@typescript-eslint/no-unused-vars
70379
+ dialogToDelete) => {
70380
+ let joinResult = false;
70381
+ if (dialogToDelete.type === DialogType.group) {
70382
+ const unjoinFromDialog = new UnJoinFromTheDialogUseCase(eventMessageRepository, new DialogsRepository(currentContext.storage.LOCAL_DATA_SOURCE, remoteDataSourceMock), dialogToDelete);
70383
+ joinResult = await unjoinFromDialog.execute().catch((e) => {
70384
+ console.log('Error delete users from UnJoinFromTheDialogUseCase: ', parse_stringifyError(e));
70385
+ throw new Error(parse_stringifyError(e));
70386
+ });
70387
+ }
70388
+ if (joinResult) {
70389
+ return Promise.resolve(joinResult);
70390
+ }
70391
+ return Promise.reject(joinResult);
70392
+ };
70113
70393
  const removeMembers = async (dialog) => {
70114
70394
  let leaveResult = false;
70115
70395
  if (dialog.participantsToRemoveIds &&
@@ -70169,8 +70449,11 @@ function useDialogListViewModel(currentContext, initPagination) {
70169
70449
  getDialogs,
70170
70450
  release,
70171
70451
  createDialog,
70452
+ createDialogForAutoJoin,
70172
70453
  updateDialog,
70173
70454
  deleteDialog,
70455
+ unJoinDialog,
70456
+ joinToDialog,
70174
70457
  uploadFile,
70175
70458
  removeMembers,
70176
70459
  setWaitLoadingStatus,
@@ -71193,15 +71476,15 @@ const SvgSearch = props => /*#__PURE__*/external_commonjs_react_commonjs2_react_
71193
71476
  var settings_filledreact_path;
71194
71477
  function settings_filledreact_extends() { return settings_filledreact_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, settings_filledreact_extends.apply(null, arguments); }
71195
71478
 
71196
- const SvgSettingsFilled = props => /*#__PURE__*/React.createElement("svg", settings_filledreact_extends({
71479
+ const SvgSettingsFilled = props => /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement("svg", settings_filledreact_extends({
71197
71480
  xmlns: "http://www.w3.org/2000/svg",
71198
71481
  viewBox: "0 0 44 44",
71199
71482
  width: "1em",
71200
71483
  height: "1em"
71201
- }, props), settings_filledreact_path || (settings_filledreact_path = /*#__PURE__*/React.createElement("path", {
71484
+ }, props), settings_filledreact_path || (settings_filledreact_path = /*#__PURE__*/external_commonjs_react_commonjs2_react_amd_react_root_React_.createElement("path", {
71202
71485
  d: "M35.09 23.723c.073-.55.11-1.118.11-1.723 0-.587-.037-1.173-.128-1.723l3.721-2.897c.33-.257.422-.752.22-1.118l-3.52-6.087c-.22-.403-.678-.532-1.081-.403l-4.382 1.76c-.917-.697-1.888-1.284-2.97-1.724l-.66-4.656a.89.89 0 0 0-.88-.752h-7.04c-.44 0-.788.312-.862.752l-.66 4.656c-1.081.44-2.071 1.045-2.97 1.724l-4.381-1.76a.875.875 0 0 0-1.082.403l-3.502 6.087c-.22.385-.146.861.22 1.118l3.722 2.897A11 11 0 0 0 8.8 22c0 .568.037 1.173.128 1.723L5.207 26.62c-.33.257-.422.752-.22 1.118l3.52 6.087c.22.403.678.532 1.081.403l4.382-1.76c.917.697 1.888 1.284 2.97 1.724l.66 4.656c.092.44.44.752.88.752h7.04c.44 0 .807-.312.862-.752l.66-4.656a12.6 12.6 0 0 0 2.97-1.724l4.381 1.76c.404.147.862 0 1.082-.403l3.52-6.087c.22-.403.128-.861-.22-1.118zM22 28.6c-3.63 0-6.6-2.97-6.6-6.6s2.97-6.6 6.6-6.6 6.6 2.97 6.6 6.6-2.97 6.6-6.6 6.6"
71203
71486
  })));
71204
- /* harmony default export */ const settings_filledreact = ((/* unused pure expression or super */ null && (SvgSettingsFilled)));
71487
+ /* harmony default export */ const settings_filledreact = (SvgSettingsFilled);
71205
71488
  ;// ./src/Presentation/icons/navigation/index.ts
71206
71489
 
71207
71490
 
@@ -73491,6 +73774,7 @@ var EditDialog_update = injectStylesIntoStyleTag_default()(EditDialog/* default
73491
73774
 
73492
73775
 
73493
73776
 
73777
+
73494
73778
  const TypeOpenDialog = {
73495
73779
  edit: 'edit',
73496
73780
  create: 'create',
@@ -73508,6 +73792,7 @@ const EditDialog_EditDialog_EditDialog = ({ nameDialog = '', typeDialog, ulrIcon
73508
73792
  const [disabledButton, setDisabledButton] = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(nameDialog.length < minLengthNameDialog ||
73509
73793
  nameDialog.length > maxLengthNameDialog);
73510
73794
  const [errorMessageUpload, setErrorMessageUpload] = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)('');
73795
+ const [disableAutoJoin, setDisableAutoJoin] = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(false);
73511
73796
  const handleUploadAvatar = (event) => {
73512
73797
  const allowedExtensions = ['jpg', 'jpeg', 'gif', 'png'];
73513
73798
  setErrorMessageUpload('');
@@ -73565,6 +73850,7 @@ const EditDialog_EditDialog_EditDialog = ({ nameDialog = '', typeDialog, ulrIcon
73565
73850
  dialogTitle: dialogName,
73566
73851
  // dialogAvatar: urlAvatar.length ? fileUploadAvatar : '',
73567
73852
  dialogAvatar: urlAvatar === 'null' ? 'null' : fileUploadAvatar,
73853
+ disableAutoJoin: disableAutoJoin,
73568
73854
  };
73569
73855
  clickUpdatedHandler(params);
73570
73856
  }
@@ -73582,7 +73868,7 @@ const EditDialog_EditDialog_EditDialog = ({ nameDialog = '', typeDialog, ulrIcon
73582
73868
  cursor: typeDialog !== DialogType.private ? 'pointer' : '',
73583
73869
  }, children: [(0,jsx_runtime_.jsx)("div", { children: typeDialog !== DialogType.private ? 'Upload' : '' }), (0,jsx_runtime_.jsx)("input", { id: "uploadBtn", type: "file", accept: "image/*", style: { display: 'none' }, onChange: (event) => {
73584
73870
  handleUploadAvatar(event);
73585
- }, disabled: typeDialog === DialogType.private })] }) })] }), errorMessageUpload.length > 0 ? ((0,jsx_runtime_.jsx)("div", { className: "edit-dialog-container--wrapper__upload-error", children: errorMessageUpload })) : null, (0,jsx_runtime_.jsx)("div", { className: "edit-dialog-container--wrapper__dialog-name-inf", children: "Dialog name" }), (0,jsx_runtime_.jsx)(ui_components_TextField_TextField, { value: dialogName, onChange: (value) => setDialogName(value), placeholder: "Enter name", className: "edit-dialog-container--wrapper__text-field" })] }) }), (0,jsx_runtime_.jsx)("div", { className: "edit-btn-container", children: (0,jsx_runtime_.jsx)(containers_RowRightContainer_RowRightContainer, { minHeightContainer: "32px", gapBetweenItem: "8px", RightContainerSize: {
73871
+ }, disabled: typeDialog === DialogType.private })] }) })] }), errorMessageUpload.length > 0 ? ((0,jsx_runtime_.jsx)("div", { className: "edit-dialog-container--wrapper__upload-error", children: errorMessageUpload })) : null, (0,jsx_runtime_.jsx)("div", { className: "edit-dialog-container--wrapper__dialog-name-inf", children: "Dialog name" }), (0,jsx_runtime_.jsx)(ui_components_TextField_TextField, { value: dialogName, onChange: (value) => setDialogName(value), placeholder: "Enter name", className: "edit-dialog-container--wrapper__text-field" }), (0,jsx_runtime_.jsxs)("div", { className: "edit-dialog-container--wrapper__auto-join", children: [(0,jsx_runtime_.jsx)(CheckBox_CheckBox_CheckBox, { disabled: false, checked: disableAutoJoin, onChange: () => setDisableAutoJoin(!disableAutoJoin) }), (0,jsx_runtime_.jsx)(settings_filledreact, {}), "Disable AutoJoin"] })] }) }), (0,jsx_runtime_.jsx)("div", { className: "edit-btn-container", children: (0,jsx_runtime_.jsx)(containers_RowRightContainer_RowRightContainer, { minHeightContainer: "32px", gapBetweenItem: "8px", RightContainerSize: {
73586
73872
  flexBasis: '63px',
73587
73873
  minWidth: '63px',
73588
73874
  maxWidth: '63px',
@@ -74128,6 +74414,7 @@ const InviteMembers_InviteMembers_InviteMembers = ({ typeDialog, idOwnerDialog,
74128
74414
 
74129
74415
 
74130
74416
 
74417
+
74131
74418
 
74132
74419
 
74133
74420
  // eslint-disable-next-line react/function-component-definition
@@ -74344,7 +74631,29 @@ theme = undefined, subHeaderContent = undefined, upHeaderContent = undefined, ro
74344
74631
  'dialog-information-profile-edit-button--disable': disableAction,
74345
74632
  }), children: [(0,jsx_runtime_.jsx)(Button_Button_Button, { variant: "text", onClick: editModal.toggleModal, disabled: disableAction, children: "Edit" }), (0,jsx_runtime_.jsx)(DialogWindow_DialogWindow_DialogWindow, { title: "Edit dialog", onClose: editModal.toggleModal, open: editModal.isOpen, children: (0,jsx_runtime_.jsx)(Views_EditDialog_EditDialog, { disableActions: disableAction, nameDialog: dialogViewModel?.entity?.name || dialog?.name, typeDialog: dialogViewModel?.entity?.type || dialog?.type, ulrIcon: getUrlAvatar(dialogViewModel?.entity || dialog), typeAddEditDialog: TypeOpenDialog.edit, clickUpdatedHandler: getDialogUpdatedInfoHandler, clickCancelHandler: editModal.toggleModal }) })] })) : null })] }), dialog.type !== DialogType.private ? ((0,jsx_runtime_.jsx)(SettingsItem_SettingsItem_SettingsItem, { icon: (0,jsx_runtime_.jsx)(group_chatreact, {}), title: "Members", rightSection: (0,jsx_runtime_.jsx)(Badge_Badge_Badge, { mute: true, count: users.length, limit: 100 }), className: "dialog-info-members", children: (0,jsx_runtime_.jsxs)(containers_ColumnContainer_ColumnContainer, { children: [users && users.length > 0 && ((0,jsx_runtime_.jsx)("div", { className: "dialog-info-action-wrapper-settings no-padding", children: (0,jsx_runtime_.jsx)(DialogInfo_UsersList_UsersList, { maxHeight: 75, usersFirstPageToView: users, allUsers: users, usersInDialogCount: users.length }) })), (0,jsx_runtime_.jsxs)("div", { className: "dialog-info-action-wrapper-settings", children: [(0,jsx_runtime_.jsx)(DialogWindow_DialogWindow_DialogWindow, { disableActions: disableAction, title: "Edit dialog", open: inviteMembersModal.isOpen, onClose: inviteMembersModal.toggleModal, children: (0,jsx_runtime_.jsx)(Views_InviteMembers_InviteMembers, { participants: PublicDialogEntity.getParticipants(dialogViewModel?.entity || dialog), applyInviteUsersHandler: applyInviteUsersHandler, cancelInviteMembersHandler: inviteMembersModal.toggleModal, typeAddEditDialog: TypeOpenDialog.edit, typeDialog: dialog.type, idOwnerDialog: dialog.ownerId }) }), (0,jsx_runtime_.jsx)(Button_Button_Button, { className: "dialog-info-action-wrapper-button", onClick: inviteMembersModal.toggleModal, variant: "outlined", disabled: dialog.ownerId !== currentUserId || disableAction, children: "Invite members" }), (0,jsx_runtime_.jsx)(Button_Button_Button, { className: "dialog-info-action-wrapper-button", onClick: () => onShowAllMemberClick(true), variant: "outlined", disabled: disableAction, children: "See all members" })] })] }) })) : null, (0,jsx_runtime_.jsx)(SettingsItem_SettingsItem_SettingsItem, { icon: (0,jsx_runtime_.jsx)(leavereact, {}), title: "Leave dialog", onClick: !disableAction ? leaveModal.toggleModal : undefined, className: classnames_default()('dialog-info-leave', {
74346
74633
  'dialog-info-leave--disable': disableAction,
74347
- }) }), (0,jsx_runtime_.jsx)(DialogWindow_DialogWindow_DialogWindow, { open: leaveModal.isOpen, title: "Leave dialog?", onClose: leaveModal.toggleModal, children: (0,jsx_runtime_.jsxs)("div", { className: "dialog-leave-container", children: [(0,jsx_runtime_.jsx)(Button_Button_Button, { variant: "outlined", onClick: leaveModal.toggleModal, children: "Cancel" }), (0,jsx_runtime_.jsx)(Button_Button_Button, { variant: "danger", onClick: leaveDialogHandler, children: "Leave" })] }) })] })] }));
74634
+ }) }), (0,jsx_runtime_.jsx)(DialogWindow_DialogWindow_DialogWindow, { open: leaveModal.isOpen, title: "Leave dialog?", onClose: leaveModal.toggleModal, children: (0,jsx_runtime_.jsxs)("div", { className: "dialog-leave-container", children: [(0,jsx_runtime_.jsx)(Button_Button_Button, { variant: "outlined", onClick: leaveModal.toggleModal, children: "Cancel" }), (0,jsx_runtime_.jsx)(Button_Button_Button, { variant: "danger", onClick: leaveDialogHandler, children: "Leave" })] }) }), (0,jsx_runtime_.jsx)(SettingsItem_SettingsItem_SettingsItem, { icon: (0,jsx_runtime_.jsx)(settings_filledreact, {}), title: "UnJoin dialog", onClick: !disableAction ? () => {
74635
+ dialogViewModel
74636
+ .unJoinDialog(dialog)
74637
+ .then((result) => {
74638
+ return result;
74639
+ })
74640
+ .catch((e) => {
74641
+ console.log('exception in UnJoinDialogFlow', parse_stringifyError(e));
74642
+ });
74643
+ } : undefined, className: classnames_default()('dialog-info-leave', {
74644
+ 'dialog-info-leave--disable': disableAction,
74645
+ }) }), (0,jsx_runtime_.jsx)(SettingsItem_SettingsItem_SettingsItem, { icon: (0,jsx_runtime_.jsx)(settings_filledreact, {}), title: "Join dialog", onClick: !disableAction ? () => {
74646
+ dialogViewModel
74647
+ .joinToDialog(dialog)
74648
+ .then((result) => {
74649
+ return result;
74650
+ })
74651
+ .catch((e) => {
74652
+ console.log('exception in JoinDialogFlow', parse_stringifyError(e));
74653
+ });
74654
+ } : undefined, className: classnames_default()('dialog-info-leave', {
74655
+ 'dialog-info-leave--disable': disableAction,
74656
+ }) })] })] }));
74348
74657
  };
74349
74658
  /* harmony default export */ const Views_DialogInfo_DialogInfo = (DialogInfo_DialogInfo_DialogInfo);
74350
74659
 
@@ -76744,6 +77053,7 @@ const CreateNewDialogFlow = ({ dialogsViewModel, onFinished, onCancel, isOnline,
76744
77053
  const [selectedDialogType, setSelectedDialogType] = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)();
76745
77054
  const [dialogName, setDialogName] = external_commonjs_react_commonjs2_react_amd_react_root_React_default().useState('NOT DEFINE');
76746
77055
  const [uidAvatar, setUidAvatar] = external_commonjs_react_commonjs2_react_amd_react_root_React_default().useState(undefined);
77056
+ const [disableAutoJoin, setDisableAutoJoin] = (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useState)(false);
76747
77057
  const { allowPublicDialogCreation } = currentContext.InitParams.qbConfig.appConfig;
76748
77058
  (0,external_commonjs_react_commonjs2_react_amd_react_root_React_.useEffect)(() => {
76749
77059
  if (
@@ -76758,6 +77068,7 @@ const CreateNewDialogFlow = ({ dialogsViewModel, onFinished, onCancel, isOnline,
76758
77068
  const getDialogNameHandler = (params) => {
76759
77069
  console.log(params.dialogTitle);
76760
77070
  setDialogName(params.dialogTitle);
77071
+ setDisableAutoJoin(params.disableAutoJoin);
76761
77072
  let newUidAvatar = '';
76762
77073
  console.log('before urlPhoto: ', newUidAvatar);
76763
77074
  if (params.dialogAvatar) {
@@ -76798,17 +77109,29 @@ const CreateNewDialogFlow = ({ dialogsViewModel, onFinished, onCancel, isOnline,
76798
77109
  dialog.photo = uidAvatar || '';
76799
77110
  dialog.participantIds = participants;
76800
77111
  dialog.type = selectedDialogType;
76801
- // eslint-disable-next-line promise/always-return
76802
- await dialogsViewModel
76803
- .createDialog(dialog)
77112
+ if (disableAutoJoin) {
76804
77113
  // eslint-disable-next-line promise/always-return
76805
- .then((newEntity) => {
76806
- onFinished(newEntity);
76807
- })
76808
- .catch((e) => {
76809
- console.log('Have exception: ', parse_stringifyError(e));
76810
- });
76811
- // }
77114
+ await dialogsViewModel
77115
+ .createDialog(dialog)
77116
+ // eslint-disable-next-line promise/always-return
77117
+ .then((newEntity) => {
77118
+ onFinished(newEntity);
77119
+ })
77120
+ .catch((e) => {
77121
+ console.log('Have exception: ', parse_stringifyError(e));
77122
+ });
77123
+ // }
77124
+ }
77125
+ else {
77126
+ await dialogsViewModel.createDialogForAutoJoin(dialog, disableAutoJoin)
77127
+ // eslint-disable-next-line promise/always-return
77128
+ .then((newEntity) => {
77129
+ onFinished(newEntity);
77130
+ })
77131
+ .catch((e) => {
77132
+ console.log('Have exception: ', parse_stringifyError(e));
77133
+ });
77134
+ }
76812
77135
  }
76813
77136
  };
76814
77137
  const closeModal = () => {
@@ -77880,8 +78203,13 @@ function useDialogViewModel(dialogType, dialogEntity) {
77880
78203
  setLoading(false);
77881
78204
  setError(e.message);
77882
78205
  });
77883
- //
77884
- const senderIds = Array.from(new Set(messagesDialog.map((msg) => msg.sender_id)));
78206
+ const senderIds = Array.from(new Set(messagesDialog.flatMap((msg) => {
78207
+ const ids = [msg.sender_id];
78208
+ if (Array.isArray(msg.qb_original_messages) && msg.qb_original_messages.length > 0) {
78209
+ ids.push(msg.qb_original_messages[0].sender_id);
78210
+ }
78211
+ return ids;
78212
+ })));
77885
78213
  const missingSenderIds = senderIds.filter((id) => !(id in userDictionary));
77886
78214
  const getMissingSenderUsersFromDialogByIdsUseCase = new GetUsersByIdsUseCase(new UsersRepository(LOCAL_DATA_SOURCE, REMOTE_DATA_SOURCE), missingSenderIds);
77887
78215
  await getMissingSenderUsersFromDialogByIdsUseCase
@@ -78226,6 +78554,7 @@ function useDialogViewModel(dialogType, dialogEntity) {
78226
78554
  };
78227
78555
  const replyMessage = async (messagesToReply, relatedMessage) => {
78228
78556
  //
78557
+ const senderRepliedMessage = messagesToReply[0].sender;
78229
78558
  const replyMessagesUseCase = new ReplyMessagesUseCase(new MessagesRepository(LOCAL_DATA_SOURCE, REMOTE_DATA_SOURCE), messagesToReply, relatedMessage);
78230
78559
  // eslint-disable-next-line promise/catch-or-return
78231
78560
  await replyMessagesUseCase
@@ -78242,6 +78571,25 @@ function useDialogViewModel(dialogType, dialogEntity) {
78242
78571
  })
78243
78572
  .finally(() => {
78244
78573
  setMessages((prevState) => {
78574
+ if (messageEntity.qb_original_messages) {
78575
+ const nestedObj = messageEntity.qb_original_messages;
78576
+ if (nestedObj && nestedObj.length > 0) {
78577
+ nestedObj[0].sender = senderRepliedMessage;
78578
+ if (nestedObj[0].sender &&
78579
+ nestedObj[0].sender.full_name &&
78580
+ regex &&
78581
+ !regex.test(nestedObj[0].sender.full_name)) {
78582
+ nestedObj[0].sender.full_name = 'Unknown';
78583
+ }
78584
+ messageEntity.qb_original_messages = nestedObj;
78585
+ }
78586
+ }
78587
+ if (messageEntity.sender &&
78588
+ messageEntity.sender.full_name &&
78589
+ regex &&
78590
+ !regex.test(messageEntity.sender.full_name)) {
78591
+ messageEntity.sender.full_name = 'Unknown';
78592
+ }
78245
78593
  const newState = [...prevState, messageEntity];
78246
78594
  return newState;
78247
78595
  });