quickblox-react-ui-kit 0.4.6-beta.4 → 0.4.7

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 (177) hide show
  1. package/dist/CommonTypes/CommonTypes.d.ts +12 -0
  2. package/dist/Data/source/remote/RemoteDataSource.d.ts +5 -0
  3. package/dist/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogListItem/DialogListItem.d.ts +1 -1
  4. package/dist/Presentation/Views/Flow/CreateDialog/CreateDialog.d.ts +1 -0
  5. package/dist/Presentation/ui-components/DialogItemPreview/DialogItemPreview.d.ts +3 -3
  6. package/dist/Presentation/ui-components/Header/Header.d.ts +1 -1
  7. package/dist/index-ui.d.ts +47 -3
  8. package/dist/index-ui.js +25470 -17586
  9. package/dist/index-ui.js.map +1 -1
  10. package/global.d.ts +3 -202
  11. package/package.json +1 -1
  12. package/src/App.scss +5 -0
  13. package/src/App.tsx +58 -33
  14. package/src/CommonTypes/CommonTypes.ts +13 -0
  15. package/src/Data/DefaultConfigurations.ts +4 -0
  16. package/src/Data/source/remote/RemoteDataSource.ts +210 -148
  17. package/src/Domain/use_cases/CreateDialogUseCase.ts +0 -1
  18. package/src/Domain/use_cases/ForwardMessagesUseCase.ts +0 -1
  19. package/src/Domain/use_cases/GetAllDialogsUseCase.ts +0 -1
  20. package/src/Domain/use_cases/GetAllDialogsUseCaseWithMock.ts +0 -2
  21. package/src/Domain/use_cases/GetAllMessagesForDialog.ts +0 -1
  22. package/src/Domain/use_cases/GetAllUsersUseCase.ts +0 -1
  23. package/src/Domain/use_cases/GetDialogByIdUseCase.ts +0 -2
  24. package/src/Domain/use_cases/GetUsersByIdsUseCase.ts +0 -1
  25. package/src/Domain/use_cases/LeaveDialogUseCase.ts +0 -1
  26. package/src/Domain/use_cases/RemoveUsersFromTheDialogUseCase.ts +0 -1
  27. package/src/Domain/use_cases/ReplyMessagesUseCase.ts +0 -2
  28. package/src/Domain/use_cases/SendTextMessageUseCase.ts +0 -3
  29. package/src/Domain/use_cases/SubscribeToDialogEventsUseCase.ts +0 -26
  30. package/src/Domain/use_cases/SubscribeToDialogsUpdatesUseCase.ts +0 -1
  31. package/src/Domain/use_cases/SyncDialogsUseCase.ts +1 -2
  32. package/src/Domain/use_cases/UpdateCurrentDialogInDataSourceUseCase.ts +0 -2
  33. package/src/Domain/use_cases/UpdateDialogUseCase.ts +0 -2
  34. package/src/Domain/use_cases/UploadFileUseCase.ts +0 -2
  35. package/src/Domain/use_cases/UserTypingMessageUseCase.ts +0 -2
  36. package/src/Domain/use_cases/ai/AIAnswerAssistUseCase.ts +0 -2
  37. package/src/Domain/use_cases/ai/AIAnswerAssistWithProxyUseCase.ts +0 -3
  38. package/src/Domain/use_cases/ai/AIAnswerAssistWithSDKUseCase.ts +0 -2
  39. package/src/Domain/use_cases/ai/AIRephraseUseCase.ts +0 -3
  40. package/src/Domain/use_cases/ai/AIRephraseWithProxyUseCase.ts +0 -3
  41. package/src/Domain/use_cases/ai/AITranslateUseCase.ts +0 -2
  42. package/src/Domain/use_cases/ai/AITranslateWithProxyUseCase.ts +0 -3
  43. package/src/Domain/use_cases/ai/AITranslateWithSDKUseCase.ts +0 -3
  44. package/src/Domain/use_cases/base/Subscribable/SubscriptionPerformer.ts +0 -1
  45. package/src/Presentation/Views/Dialog/AIWidgets/AIRephraseWidget/AIRephraseWidget.tsx +1 -1
  46. package/src/Presentation/Views/Dialog/AIWidgets/AIWidgetActions/AIWidgetActions.scss +12 -6
  47. package/src/Presentation/Views/Dialog/AIWidgets/AIWidgetActions/AIWidgetActions.tsx +4 -2
  48. package/src/Presentation/Views/Dialog/Dialog.scss +7 -1
  49. package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogListItem/DialogListItem.scss +17 -29
  50. package/src/Presentation/Views/Dialog/ForwardMessageFlow/DialogsWithSearch/DialogListItem/DialogListItem.tsx +8 -13
  51. package/src/Presentation/Views/Dialog/ForwardMessageFlow/ForwardMessageFlow.scss +9 -9
  52. package/src/Presentation/Views/Dialog/ForwardMessageFlow/InputForForwarding/InputForForwarding.scss +11 -0
  53. package/src/Presentation/Views/Dialog/MessageContextMenu/MessageContextMenu.tsx +3 -2
  54. package/src/Presentation/Views/Dialog/useDialogViewModel.ts +10 -21
  55. package/src/Presentation/Views/DialogInfo/DialogInfo.scss +19 -25
  56. package/src/Presentation/Views/DialogInfo/DialogInfo.tsx +2 -2
  57. package/src/Presentation/Views/DialogInfo/DialogMemberButton/DialogMembersButton.scss +0 -17
  58. package/src/Presentation/Views/DialogInfo/MembersList/MembersList.scss +9 -1
  59. package/src/Presentation/Views/DialogInfo/UsersList/SingleUser/SingleUser.scss +0 -1
  60. package/src/Presentation/Views/DialogInfo/UsersList/useUsersListViewModel.ts +2 -4
  61. package/src/Presentation/Views/DialogList/useDialogListViewModel.ts +0 -1
  62. package/src/Presentation/Views/EditDialog/EditDialog.scss +1 -38
  63. package/src/Presentation/Views/Flow/CreateDialog/CreateDialog.scss +17 -42
  64. package/src/Presentation/Views/Flow/CreateDialog/CreateDialog.tsx +45 -39
  65. package/src/Presentation/Views/Flow/CreateDialogFlow/CreateNewDialogFlow.tsx +6 -2
  66. package/src/Presentation/Views/InviteMembers/InviteMembers.scss +4 -33
  67. package/src/Presentation/Views/InviteMembers/InviteMembers.tsx +23 -4
  68. package/src/Presentation/Views/PreviewDialog/PreviewDialog.scss +8 -0
  69. package/src/Presentation/Views/PreviewDialog/PreviewDialog.tsx +8 -5
  70. package/src/Presentation/components/UI/Buttons/MainButton/MainButton.css +5 -10
  71. package/src/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.scss +0 -5
  72. package/src/Presentation/components/containers/ColumnContainer/ColumnContainer.scss +1 -10
  73. package/src/Presentation/layouts/TestStage/LoginView/Login.scss +6 -3
  74. package/src/Presentation/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx +1 -33
  75. package/src/Presentation/themes/styles/_theme_colors_scheme.scss +1 -1
  76. package/src/Presentation/themes/styles/_theme_dark.scss +5 -4
  77. package/src/Presentation/themes/styles/_theme_light.scss +3 -2
  78. package/src/Presentation/ui-components/Avatar/Avatar.scss +8 -5
  79. package/src/Presentation/ui-components/Avatar/Avatar.tsx +2 -1
  80. package/src/Presentation/ui-components/Badge/Badge.tsx +1 -0
  81. package/src/Presentation/ui-components/Button/Button.scss +5 -6
  82. package/src/Presentation/ui-components/Button/Button.tsx +7 -2
  83. package/src/Presentation/ui-components/CheckBox/CheckBox.scss +23 -0
  84. package/src/Presentation/ui-components/CheckBox/CheckBox.tsx +19 -7
  85. package/src/Presentation/ui-components/DialogBanner/DialogBanner.tsx +1 -0
  86. package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.scss +3 -3
  87. package/src/Presentation/ui-components/DialogItemPreview/DialogItemPreview.tsx +3 -3
  88. package/src/Presentation/ui-components/DialogWindow/DialogWindow.scss +7 -4
  89. package/src/Presentation/ui-components/DialogWindow/DialogWindow.tsx +1 -1
  90. package/src/Presentation/ui-components/Dropdown/Dropdown.tsx +1 -1
  91. package/src/Presentation/ui-components/Dropdown/DropdownOption.tsx +2 -1
  92. package/src/Presentation/ui-components/Header/Header.scss +9 -2
  93. package/src/Presentation/ui-components/Header/Header.tsx +1 -1
  94. package/src/Presentation/ui-components/Loader/Loader.tsx +1 -0
  95. package/src/Presentation/ui-components/Message/Bubble/AudioBubble/AudioBubble.scss +1 -0
  96. package/src/Presentation/ui-components/Message/Bubble/FileBubble/FileBubble.tsx +1 -0
  97. package/src/Presentation/ui-components/Message/Bubble/ImageBubble/ImageBubble.tsx +1 -0
  98. package/src/Presentation/ui-components/Message/Bubble/TextBubble/TextBubble.scss +13 -3
  99. package/src/Presentation/ui-components/Message/Bubble/TextBubble/TextBubble.tsx +1 -0
  100. package/src/Presentation/ui-components/Message/Bubble/VideoBubble/VideoBubble.tsx +1 -0
  101. package/src/Presentation/ui-components/Message/FileUrl/FileUrl.scss +0 -3
  102. package/src/Presentation/ui-components/Message/FileUrl/FileUrl.tsx +1 -0
  103. package/src/Presentation/ui-components/Message/Message.scss +5 -1
  104. package/src/Presentation/ui-components/MessageInput/MessageInput.scss +5 -1
  105. package/src/Presentation/ui-components/MessageInput/MessageInput.tsx +1 -1
  106. package/src/Presentation/ui-components/MessageInput/VoiceRecordingProgress/VoiceRecordingProgress.tsx +1 -1
  107. package/src/Presentation/ui-components/MessageSeparator/MessageSeparator.scss +13 -13
  108. package/src/Presentation/ui-components/Placeholder/Placeholder.scss +5 -0
  109. package/src/Presentation/ui-components/Placeholder/Placeholder.tsx +1 -1
  110. package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.scss +4 -1
  111. package/src/Presentation/ui-components/PreviewFileMessage/PreviewFileMessage.tsx +1 -0
  112. package/src/Presentation/ui-components/SettingsItem/SettingsItem.scss +5 -1
  113. package/src/Presentation/ui-components/SettingsItem/SettingsItem.tsx +1 -1
  114. package/src/Presentation/ui-components/TextField/TextField.scss +5 -3
  115. package/src/Presentation/ui-components/Toast/Toast.scss +3 -3
  116. package/src/Presentation/ui-components/Toast/ToastProvider.tsx +2 -2
  117. package/src/Presentation/ui-components/UserListItem/UserListItem.scss +11 -3
  118. package/src/Presentation/ui-components/UserListItem/UserListItem.tsx +1 -0
  119. package/src/QBconfig.ts +2 -0
  120. package/src/hooks/useQuickBloxUIKit.ts +101 -18
  121. package/src/index-ui.ts +111 -18
  122. package/src/qb-api-calls/index.ts +52 -3
  123. package/storybook-static/{217.3c66ff1e.iframe.bundle.js → 217.07d5c7a3.iframe.bundle.js} +3 -3
  124. package/storybook-static/{217.3c66ff1e.iframe.bundle.js.map → 217.07d5c7a3.iframe.bundle.js.map} +1 -1
  125. package/storybook-static/735.6ee62079.iframe.bundle.js +2 -0
  126. package/storybook-static/{844.6041e1a5.iframe.bundle.js → 844.e8bfd664.iframe.bundle.js} +3 -3
  127. package/storybook-static/{844.6041e1a5.iframe.bundle.js.map → 844.e8bfd664.iframe.bundle.js.map} +1 -1
  128. package/storybook-static/{961.c94da456.iframe.bundle.js → 961.d47fc2bc.iframe.bundle.js} +2 -2
  129. package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.a5ba7608.iframe.bundle.js +2 -0
  130. package/storybook-static/Presentation-ui-components-Badge-Badge-stories.c8824861.iframe.bundle.js +2 -0
  131. package/storybook-static/Presentation-ui-components-Button-Button-stories.fa2aa72c.iframe.bundle.js +2 -0
  132. package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.b6998344.iframe.bundle.js +2 -0
  133. package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.a724643f.iframe.bundle.js +2 -0
  134. package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.a03feb06.iframe.bundle.js +2 -0
  135. package/storybook-static/Presentation-ui-components-Header-Header-stories.978f0af5.iframe.bundle.js +2 -0
  136. package/storybook-static/Presentation-ui-components-Loader-Loader-stories.4e80520d.iframe.bundle.js +2 -0
  137. package/storybook-static/Presentation-ui-components-Message-Message-stories.213a90f6.iframe.bundle.js +2 -0
  138. package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.be8aa2d9.iframe.bundle.js +1 -0
  139. package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.e7f5a274.iframe.bundle.js +2 -0
  140. package/storybook-static/Presentation-ui-components-TextField-TextField-stories.969cfe2e.iframe.bundle.js +2 -0
  141. package/storybook-static/Presentation-ui-components-Toast-Toast-stories.4f00432b.iframe.bundle.js +1 -0
  142. package/storybook-static/Presentation-ui-components-UserListItem-UserListItem-stories.1713eab7.iframe.bundle.js +2 -0
  143. package/storybook-static/iframe.html +2 -2
  144. package/storybook-static/project.json +1 -1
  145. package/storybook-static/{runtime~main.5a7ba727.iframe.bundle.js → runtime~main.17766d00.iframe.bundle.js} +1 -1
  146. package/storybook-static/sb-manager/globals-runtime.js +1 -1
  147. package/storybook-static/735.82f96f8a.iframe.bundle.js +0 -2
  148. package/storybook-static/Presentation-ui-components-Avatar-avatar-stories.b363e9a1.iframe.bundle.js +0 -2
  149. package/storybook-static/Presentation-ui-components-Badge-Badge-stories.85dd97b0.iframe.bundle.js +0 -2
  150. package/storybook-static/Presentation-ui-components-Button-Button-stories.1e4ae2b4.iframe.bundle.js +0 -2
  151. package/storybook-static/Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.4e25a94d.iframe.bundle.js +0 -2
  152. package/storybook-static/Presentation-ui-components-DialogWindow-DialogWindow-stories.e22e8be5.iframe.bundle.js +0 -2
  153. package/storybook-static/Presentation-ui-components-Dropdown-Dropdown-stories.8321872b.iframe.bundle.js +0 -2
  154. package/storybook-static/Presentation-ui-components-Header-Header-stories.1cff200a.iframe.bundle.js +0 -2
  155. package/storybook-static/Presentation-ui-components-Loader-Loader-stories.7391dde4.iframe.bundle.js +0 -2
  156. package/storybook-static/Presentation-ui-components-Message-Message-stories.49f0dbbf.iframe.bundle.js +0 -2
  157. package/storybook-static/Presentation-ui-components-MessageInput-MessageInput-stories.4aa88de3.iframe.bundle.js +0 -1
  158. package/storybook-static/Presentation-ui-components-SettingsItem-SettingsItem-stories.d74853ab.iframe.bundle.js +0 -2
  159. package/storybook-static/Presentation-ui-components-TextField-TextField-stories.19812f7d.iframe.bundle.js +0 -2
  160. package/storybook-static/Presentation-ui-components-Toast-Toast-stories.5e19f10e.iframe.bundle.js +0 -1
  161. package/storybook-static/Presentation-ui-components-UserListItem-UserListItem-stories.d2f60e13.iframe.bundle.js +0 -2
  162. /package/storybook-static/{217.3c66ff1e.iframe.bundle.js.LICENSE.txt → 217.07d5c7a3.iframe.bundle.js.LICENSE.txt} +0 -0
  163. /package/storybook-static/{735.82f96f8a.iframe.bundle.js.LICENSE.txt → 735.6ee62079.iframe.bundle.js.LICENSE.txt} +0 -0
  164. /package/storybook-static/{844.6041e1a5.iframe.bundle.js.LICENSE.txt → 844.e8bfd664.iframe.bundle.js.LICENSE.txt} +0 -0
  165. /package/storybook-static/{961.c94da456.iframe.bundle.js.LICENSE.txt → 961.d47fc2bc.iframe.bundle.js.LICENSE.txt} +0 -0
  166. /package/storybook-static/{Presentation-ui-components-Avatar-avatar-stories.b363e9a1.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Avatar-avatar-stories.a5ba7608.iframe.bundle.js.LICENSE.txt} +0 -0
  167. /package/storybook-static/{Presentation-ui-components-Badge-Badge-stories.85dd97b0.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Badge-Badge-stories.c8824861.iframe.bundle.js.LICENSE.txt} +0 -0
  168. /package/storybook-static/{Presentation-ui-components-Button-Button-stories.1e4ae2b4.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Button-Button-stories.fa2aa72c.iframe.bundle.js.LICENSE.txt} +0 -0
  169. /package/storybook-static/{Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.4e25a94d.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-DialogItemPreview-DialogItemPreview-stories.b6998344.iframe.bundle.js.LICENSE.txt} +0 -0
  170. /package/storybook-static/{Presentation-ui-components-DialogWindow-DialogWindow-stories.e22e8be5.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-DialogWindow-DialogWindow-stories.a724643f.iframe.bundle.js.LICENSE.txt} +0 -0
  171. /package/storybook-static/{Presentation-ui-components-Dropdown-Dropdown-stories.8321872b.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Dropdown-Dropdown-stories.a03feb06.iframe.bundle.js.LICENSE.txt} +0 -0
  172. /package/storybook-static/{Presentation-ui-components-Header-Header-stories.1cff200a.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Header-Header-stories.978f0af5.iframe.bundle.js.LICENSE.txt} +0 -0
  173. /package/storybook-static/{Presentation-ui-components-Loader-Loader-stories.7391dde4.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Loader-Loader-stories.4e80520d.iframe.bundle.js.LICENSE.txt} +0 -0
  174. /package/storybook-static/{Presentation-ui-components-Message-Message-stories.49f0dbbf.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-Message-Message-stories.213a90f6.iframe.bundle.js.LICENSE.txt} +0 -0
  175. /package/storybook-static/{Presentation-ui-components-SettingsItem-SettingsItem-stories.d74853ab.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-SettingsItem-SettingsItem-stories.e7f5a274.iframe.bundle.js.LICENSE.txt} +0 -0
  176. /package/storybook-static/{Presentation-ui-components-TextField-TextField-stories.19812f7d.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-TextField-TextField-stories.969cfe2e.iframe.bundle.js.LICENSE.txt} +0 -0
  177. /package/storybook-static/{Presentation-ui-components-UserListItem-UserListItem-stories.d2f60e13.iframe.bundle.js.LICENSE.txt → Presentation-ui-components-UserListItem-UserListItem-stories.1713eab7.iframe.bundle.js.LICENSE.txt} +0 -0
@@ -13,7 +13,6 @@ import {
13
13
  QBSession,
14
14
  QBSystemMessage,
15
15
  QBUser,
16
- QBMessageStatusParams,
17
16
  AIChatHistory,
18
17
  AIAnswerResponse,
19
18
  } from 'quickblox/quickblox';
@@ -40,7 +39,6 @@ import {
40
39
  QBChatConnect,
41
40
  QBChatDisconnect,
42
41
  qbChatGetMessagesExtended,
43
- QBChatMarkMessageDelivered,
44
42
  QBChatMarkMessageRead,
45
43
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
46
44
  // QBChatMarkMessageRead,
@@ -128,8 +126,8 @@ export class RemoteDataSource implements IRemoteDataSource {
128
126
  private _authProcessed: boolean;
129
127
 
130
128
  get authProcessed(): boolean {
131
- const QB = getQB();
132
129
  const auth = this._authProcessed;
130
+ const QB = getQB();
133
131
  const chatConnection = QB && QB.chat && QB.chat.isConnected;
134
132
 
135
133
  if (chatConnection) return true;
@@ -180,9 +178,52 @@ export class RemoteDataSource implements IRemoteDataSource {
180
178
  return dialogDTOMapper;
181
179
  }
182
180
 
181
+ //
182
+ private startUserCachePreload(): void {
183
+ if (this.userCachePreloadInterval) return;
184
+
185
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
186
+ this.userCachePreloadInterval = setInterval(async () => {
187
+ try {
188
+ const pagination = new Pagination(1, 100); // Пагинация по 100 пользователей
189
+ let hasMoreUsers = true;
190
+
191
+ while (hasMoreUsers) {
192
+ // eslint-disable-next-line no-await-in-loop
193
+ const { ResultData, PaginationResult } = await this.getAllUsers(
194
+ pagination,
195
+ );
196
+
197
+ // eslint-disable-next-line no-restricted-syntax
198
+ for (const user of ResultData) {
199
+ if (!this.userCache.has(user.id)) {
200
+ this.userCache.set(user.id, user);
201
+ }
202
+ }
203
+
204
+ if (
205
+ PaginationResult.getCurrentPage() >= PaginationResult.totalPages
206
+ ) {
207
+ hasMoreUsers = false;
208
+ } else {
209
+ pagination.setCurrentPage(pagination.getCurrentPage() + 1);
210
+ }
211
+ }
212
+
213
+ console.log(
214
+ `User cache preload complete. Loaded ${this.userCache.size} users.`,
215
+ );
216
+
217
+ clearInterval(this.userCachePreloadInterval!);
218
+ this.userCachePreloadInterval = null;
219
+ } catch (error) {
220
+ console.error('Error during user cache preload:', error);
221
+ }
222
+ }, 4500); // Интервал 10 секунд
223
+ }
224
+
183
225
  //
184
226
  constructor() {
185
- console.log('CONSTRUCTOR RemoteDataSourceMock');
186
227
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
187
228
  // @ts-ignore
188
229
  console.log('QB inside RemoteDataSource:', window.QB);
@@ -207,6 +248,8 @@ export class RemoteDataSource implements IRemoteDataSource {
207
248
  new SubscriptionPerformer<RemoteMessageDTO>();
208
249
  this.subscriptionOnSystemMessages[NotificationTypes.NEW_DIALOG] =
209
250
  new SubscriptionPerformer<RemoteMessageDTO>();
251
+
252
+ // this.startUserCachePreload(); //TODO: uncomment this line after test [CSAMPLES-4065] is done
210
253
  }
211
254
 
212
255
  // eslint-disable-next-line class-methods-use-this
@@ -227,42 +270,6 @@ export class RemoteDataSource implements IRemoteDataSource {
227
270
  return QBTranslate(smartChatAssistantId, text, languageCode);
228
271
  }
229
272
 
230
- // async updateCurrentDialog(dto: RemoteDialogDTO, qbConfig: QBUIKitConfig): Promise<void> {
231
- // this.currentDialog = dto;
232
- // //
233
- // //
234
- // const dialogsDTOtoEntityMapper: IMapper = new DialogRemoteDTOMapper();
235
- //
236
- // const dialogEntity: DialogEntity = await dialogsDTOtoEntityMapper.toEntity(
237
- // this.currentDialog,
238
- // );
239
- // const userId = this._authInformation?.userId || -1;
240
- // const dialogId = this.currentDialog.id;
241
- // const messageId = this.currentDialog.lastMessageId;
242
- // //
243
- // //
244
- // const resultMessage: DialogEventInfo = {
245
- // eventMessageType: EventMessageType.LocalMessage,
246
- // dialogInfo: dialogEntity,
247
- // messageInfo: undefined,
248
- // messageStatus: {
249
- // isTyping: false,
250
- // userId,
251
- // dialogId,
252
- // messageId,
253
- // deliveryStatus: 'delivered',
254
- // },
255
- // notificationTypes: undefined,
256
- // };
257
- //
258
- // this.subscriptionOnMessageStatus.informSubscribers(
259
- // resultMessage,
260
- // EventMessageType.LocalMessage,
261
- // );
262
- // //
263
- //
264
- // //
265
- // }
266
273
  async updateCurrentDialog(
267
274
  dto: RemoteDialogDTO,
268
275
  qbConfig: QBUIKitConfig,
@@ -863,21 +870,12 @@ export class RemoteDataSource implements IRemoteDataSource {
863
870
  //
864
871
  //
865
872
  this.initEventsHandlers();
866
- //
867
- //
868
- console.log('USER DATA : ', userRequiredParams);
869
- console.log('USER SESSION DATA : ', sessionResult);
870
- console.log('Session token : ', sessionResult.token);
871
873
 
872
874
  const session = sessionResult;
873
875
  const sessionDataTmp = JSON.stringify(session);
874
876
 
875
877
  const sessionData = JSON.parse(sessionDataTmp);
876
878
 
877
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
878
- console.log(`user_id = ${sessionData.user_id}`);
879
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
880
- console.log(`session token to chat init = ${sessionData.token}`);
881
879
  const authInformation = {
882
880
  userName: authParams.login,
883
881
  userId: sessionData.user_id,
@@ -890,71 +888,113 @@ export class RemoteDataSource implements IRemoteDataSource {
890
888
  password: authInformation.password,
891
889
  };
892
890
 
893
- console.log(paramsConnect);
894
- //
895
891
  const connectResult = await QBChatConnect(paramsConnect);
896
892
 
897
893
  if (connectResult) {
898
894
  //
899
895
  this._authInformation = authInformation;
900
896
  this.setAuthProcessedSuccessed();
901
- console.log('CHAT CONNECTED. CAN WORK!');
902
- console.log('CONNECTION DATA: ', JSON.stringify(authInformation));
903
- // //
904
- // this.initEventsHandlers();
905
- // //
906
897
  } else {
907
898
  console.log('could not connect to chat');
908
899
  }
909
900
 
910
901
  //
911
902
  }
903
+ // get dialogs flow
912
904
 
913
- async getDialogs(pagination?: Pagination): Promise<RemoteDialogsDTO> {
914
- let currentPagination: Pagination = pagination || new Pagination();
905
+ private async joinGroupDialog(dialogId: string): Promise<void> {
906
+ try {
907
+ await QBJoinGroupDialog(dialogId).catch(() => {
908
+ this.joinStatusMap.set(dialogId, false);
909
+ throw new RemoteDataSourceException(
910
+ INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE,
911
+ INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE,
912
+ );
913
+ });
914
+ this.joinStatusMap.set(dialogId, true);
915
+ } catch (reason) {
916
+ console.log(`QBJoinGroupDialog error for dialog ${dialogId}:`, reason);
917
+ this.joinStatusMap.set(dialogId, false);
918
+ }
919
+ }
920
+
921
+ // version 0.5.0-beta.11,12,14
922
+ private startJoinRetryProcess(): void {
923
+ if (this.joinCheckInterval) return;
924
+
925
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
926
+ this.joinCheckInterval = setInterval(async () => {
927
+ const dialogsToRetry = Array.from(this.joinStatusMap.entries())
928
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
929
+ .filter(([_, isJoined]) => !isJoined)
930
+ .map(([id]) => id);
931
+
932
+ if (dialogsToRetry.length === 0) {
933
+ clearInterval(this.joinCheckInterval!);
934
+ this.joinCheckInterval = null;
935
+ console.log('All dialogs successfully joined. Stopping retry process.');
936
+
937
+ return;
938
+ }
939
+
940
+ console.log(`Retrying join for ${dialogsToRetry.length} dialogs...`);
941
+ await this.processDialogs(dialogsToRetry);
942
+ }, 7000);
943
+ }
944
+
945
+ private async processDialogsInBackground(dialogIds: string[]): Promise<void> {
946
+ const BATCH_SIZE = 12;
915
947
 
916
948
  console.log(
917
- 'call getDialogs in RemoteDataSourceMock param pagination: ',
918
- JSON.stringify(pagination),
919
- );
920
- console.log(
921
- 'call getDialogs in RemoteDataSourceMock with result pagination: ',
922
- JSON.stringify(currentPagination),
949
+ `Starting background processing for ${dialogIds.length} dialogs`,
923
950
  );
924
- const pageNumber = currentPagination.getCurrentPage() || 1;
925
951
 
926
- console.log('pageNumber: ', pageNumber);
952
+ for (let i = 0; i < dialogIds.length; i += BATCH_SIZE) {
953
+ const batch = dialogIds.slice(i, i + BATCH_SIZE);
954
+
955
+ console.log(`Processing batch ${i / BATCH_SIZE + 1}:`, batch);
956
+
957
+ // eslint-disable-next-line no-await-in-loop
958
+ await Promise.all(batch.map((id) => this.joinGroupDialog(id)));
959
+ console.log(`Batch ${i / BATCH_SIZE + 1} completed.`);
960
+
961
+ // eslint-disable-next-line
962
+ await new Promise((resolve) => setTimeout(resolve, 1500));
963
+ }
964
+
965
+ console.log('Background processing complete.');
966
+ }
967
+
968
+ private async processDialogs(dialogIds: string[]): Promise<void> {
969
+ await Promise.all(dialogIds.map((id) => this.joinGroupDialog(id)));
970
+ }
971
+
972
+ async getDialogs(pagination?: Pagination): Promise<RemoteDialogsDTO> {
973
+ let currentPagination: Pagination = pagination || new Pagination();
974
+
975
+ const pageNumber = currentPagination.getCurrentPage() || 1;
927
976
  const perPage = currentPagination.perPage || 100;
928
977
 
929
- console.log('perPage: ', perPage);
930
- const params = {
931
- created_at: {
932
- lt: Date.now() / 1000,
933
- },
934
- // sort_desc: 'created_at',// artan 19.0.2024
978
+ const params: Dictionary<any> = {
979
+ created_at: { lt: Date.now() / 1000 },
935
980
  sort_desc: 'updated_at',
936
981
  page: pageNumber,
937
982
  limit: perPage,
938
- // type: {
939
- // in: [2, 3],
940
- // },
983
+ // type: { in: [2, 3] },
941
984
  };
942
985
 
943
- console.log(
944
- 'call getDialogs in RemoteDataSourceMock with params: ',
945
- JSON.stringify(params),
946
- );
986
+ // Conditionally filter dialog types unless public dialogs should be shown
987
+ if (!QBConfig.appConfig?.showPublicDialogsInList) {
988
+ params.type = {
989
+ in: [2, 3], // Only group and private dialogs
990
+ };
991
+ }
992
+
947
993
  const dialogsDTO: Array<RemoteDialogDTO> = [];
994
+ const joinDialogIds: string[] = [];
948
995
  const qbDialogs: QBGetDialogResult | undefined = await QBGetDialogs(params);
949
996
 
950
997
  if (qbDialogs) {
951
- console.log(
952
- `request completed. have: total_entries ${
953
- qbDialogs.total_entries
954
- }, limit: ${qbDialogs.limit}, skip: ${
955
- qbDialogs.skip
956
- } items: ${JSON.stringify(qbDialogs.items)}`,
957
- );
958
998
  currentPagination = new Pagination(0, perPage);
959
999
  currentPagination.totalPages = qbDialogs.total_entries / perPage;
960
1000
  currentPagination.setCurrentPage(pageNumber);
@@ -963,34 +1003,37 @@ export class RemoteDataSource implements IRemoteDataSource {
963
1003
  for (const item of qbDialogs.items) {
964
1004
  const qbEntity: QBChatDialog = item;
965
1005
 
1006
+ // eslint-disable-next-line no-continue
1007
+ if (!qbEntity) continue;
1008
+
966
1009
  const newDTO: RemoteDialogDTO =
967
1010
  // eslint-disable-next-line no-await-in-loop
968
1011
  await this.getCurrentDialogDTOMapper().toTDO(qbEntity);
969
1012
 
970
- // artan 27/06/23
971
- if (newDTO.type === DialogType.group) {
972
- // eslint-disable-next-line no-await-in-loop
973
- await QBJoinGroupDialog(newDTO.id).catch((reason) => {
974
- console.log('getDialogs. QBJoinGroupDialog error', reason);
975
- throw new RemoteDataSourceException(
976
- INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE,
977
- INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE,
978
- );
979
- });
1013
+ if (
1014
+ newDTO.type === DialogType.group &&
1015
+ !this.processedDialogs.has(newDTO.id)
1016
+ ) {
1017
+ this.processedDialogs.add(newDTO.id);
1018
+
1019
+ if (!this.joinStatusMap.has(newDTO.id)) {
1020
+ this.joinStatusMap.set(newDTO.id, false);
1021
+ joinDialogIds.push(newDTO.id);
1022
+ }
980
1023
  }
981
1024
 
982
- //
983
- const currentUserId = this._authInformation?.userId || 0;
984
- const statusMessageParams: QBMessageStatusParams = {
985
- userId: newDTO.lastMessageUserId || currentUserId,
986
- dialogId: newDTO.id,
987
- messageId: newDTO.lastMessageId,
988
- };
1025
+ dialogsDTO.push(newDTO);
1026
+ }
989
1027
 
990
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call
991
- QBChatMarkMessageDelivered(statusMessageParams);
1028
+ const firstBatch = joinDialogIds.slice(0, 24);
992
1029
 
993
- dialogsDTO.push(newDTO);
1030
+ await this.processDialogs(firstBatch);
1031
+
1032
+ const remainingDialogs = joinDialogIds.slice(24);
1033
+
1034
+ if (remainingDialogs.length) {
1035
+ await this.processDialogsInBackground(remainingDialogs);
1036
+ this.startJoinRetryProcess();
994
1037
  }
995
1038
  }
996
1039
 
@@ -1049,8 +1092,6 @@ export class RemoteDataSource implements IRemoteDataSource {
1049
1092
  if (qbEntity.name && qbEntity.name.length > 0) {
1050
1093
  data = {
1051
1094
  name: qbEntity.name,
1052
- // photo: qbEntity.photo,
1053
- // photo: 'null',
1054
1095
  ...data,
1055
1096
  };
1056
1097
  }
@@ -1181,6 +1222,7 @@ export class RemoteDataSource implements IRemoteDataSource {
1181
1222
  ),
1182
1223
  );
1183
1224
  }
1225
+
1184
1226
  let dtoUser: RemoteUserDTO | undefined;
1185
1227
 
1186
1228
  try {
@@ -1226,7 +1268,6 @@ export class RemoteDataSource implements IRemoteDataSource {
1226
1268
  return Promise.resolve(new RemoteUsersDTO(usersDTO, new Pagination()));
1227
1269
  }
1228
1270
 
1229
- //
1230
1271
  // eslint-disable-next-line class-methods-use-this
1231
1272
  public async getAllUsers(
1232
1273
  pagination: Pagination,
@@ -1312,8 +1353,6 @@ export class RemoteDataSource implements IRemoteDataSource {
1312
1353
 
1313
1354
  return { ResultData: users, PaginationResult: resultPagination };
1314
1355
  }
1315
- //
1316
- //
1317
1356
 
1318
1357
  // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment
1319
1358
  // @ts-ignore
@@ -1337,11 +1376,7 @@ export class RemoteDataSource implements IRemoteDataSource {
1337
1376
  ),
1338
1377
  );
1339
1378
  }
1340
- console.log(
1341
- `GET MESSAGES ${qbMessages.items.length} FROM SERVER: ${JSON.stringify(
1342
- qbMessages,
1343
- )} `,
1344
- );
1379
+ console.log(`GET MESSAGES ${qbMessages.items.length} FROM SERVER.`);
1345
1380
  const currentUserId = this._authInformation?.userId;
1346
1381
 
1347
1382
  await Promise.all(
@@ -1385,12 +1420,9 @@ export class RemoteDataSource implements IRemoteDataSource {
1385
1420
  await this.getCurrentDialogDTOMapper().fromDTO(dialogDTO);
1386
1421
 
1387
1422
  if (dialogDTO.type === DialogType.group) {
1388
- await QBJoinGroupDialog(dialogDTO.id).catch(() => {
1389
- throw new RemoteDataSourceException(
1390
- INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE,
1391
- INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE,
1392
- );
1393
- });
1423
+ if (!this.joinStatusMap.has(dialogDTO.id)) {
1424
+ await this.joinGroupDialog(dialogDTO.id);
1425
+ }
1394
1426
  }
1395
1427
 
1396
1428
  QBSendIsTypingStatus(qbEntity, senderId);
@@ -1414,31 +1446,46 @@ export class RemoteDataSource implements IRemoteDataSource {
1414
1446
  // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars
1415
1447
  async sendMessage(dto: RemoteMessageDTO): Promise<RemoteMessageDTO> {
1416
1448
  console.log('call sendMessage');
1417
- //
1418
1449
  const QB = getQB();
1419
- //
1420
1450
  const messageText = dto.message;
1421
1451
 
1452
+ const extension: Partial<QBUIKitChatNewMessage['extension']> = {
1453
+ save_to_history: 1,
1454
+ dialog_id: dto.dialogId,
1455
+ };
1456
+
1457
+ if (dto.notification_type) {
1458
+ extension.notification_type = dto.notification_type;
1459
+ }
1460
+
1461
+ if (dto.sender_id || dto.recipient_id) {
1462
+ extension.sender_id = dto.sender_id || dto.recipient_id;
1463
+ }
1464
+
1465
+ if (dto.qb_message_action) {
1466
+ extension.qb_message_action = dto.qb_message_action;
1467
+ }
1468
+
1469
+ if (dto.origin_sender_name) {
1470
+ extension.origin_sender_name = dto.origin_sender_name;
1471
+ }
1472
+
1473
+ const originalMessages = MessageDTOMapper.translateOriginalDataToJSON(
1474
+ MessageDTOMapper.convertToQBChatNewMessage(
1475
+ dto.qb_original_messages || [],
1476
+ ) || [],
1477
+ );
1478
+
1479
+ if (originalMessages && originalMessages.length > 0) {
1480
+ extension.qb_original_messages = originalMessages;
1481
+ }
1482
+
1422
1483
  const qbEntity: QBUIKitChatNewMessage = {
1423
1484
  type: dto.dialog_type === DialogType.private ? 'chat' : 'groupchat',
1424
1485
  body: messageText || '',
1425
- notification_type: dto.notification_type,
1426
1486
  dialog_id: dto.dialogId,
1427
- extension: {
1428
- save_to_history: 1,
1429
- dialog_id: dto.dialogId,
1430
- notification_type: dto.notification_type,
1431
- sender_id: dto.sender_id || dto.recipient_id,
1432
- qb_message_action: dto.qb_message_action, // 'forward' 'reply'
1433
- origin_sender_name: dto.origin_sender_name,
1434
- qb_original_messages: MessageDTOMapper.translateOriginalDataToJSON(
1435
- MessageDTOMapper.convertToQBChatNewMessage(
1436
- dto.qb_original_messages || [],
1437
- ) || [],
1438
- ),
1439
- },
1487
+ extension: extension as QBUIKitChatNewMessage['extension'],
1440
1488
  markable: 1,
1441
- // markable: 0, // mark_as_read ??
1442
1489
  };
1443
1490
 
1444
1491
  if (dto.attachments?.length > 0) {
@@ -1455,20 +1502,35 @@ export class RemoteDataSource implements IRemoteDataSource {
1455
1502
  qbEntity.extension.attachments?.push(chatMessageAttachment);
1456
1503
  });
1457
1504
  }
1458
- let qbMessageId: QBChatMessage['_id'];
1505
+ let qbMessageId: QBChatMessage['_id'] | undefined | null;
1459
1506
 
1460
1507
  if (dto.dialog_type === DialogType.private) {
1461
1508
  qbMessageId = await QBChatSendMessage(dto.recipient_id, qbEntity);
1462
1509
  } else {
1463
- await QBJoinGroupDialog(dto.dialogId).catch(() => {
1464
- throw new RemoteDataSourceException(
1465
- INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE,
1466
- INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE,
1467
- );
1468
- });
1510
+ await this.joinGroupDialog(dto.dialogId);
1469
1511
  const dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dto.dialogId);
1470
1512
 
1471
- qbMessageId = await QBChatSendMessage(dialogJid, qbEntity);
1513
+ try {
1514
+ qbMessageId = await QBChatSendMessage(dialogJid, qbEntity);
1515
+ console.log(
1516
+ // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
1517
+ `Dialog joined status is ${this.joinStatusMap.has(
1518
+ dto.dialogId,
1519
+ )} and message was sent with Id: ${qbMessageId}`,
1520
+ );
1521
+ } catch (e) {
1522
+ qbMessageId = undefined;
1523
+ const errorMessage = `Error in DataSource: send message throw: ${stringifyError(
1524
+ e,
1525
+ )}`;
1526
+
1527
+ console.log('Error in DataSource: send message throw: ', errorMessage);
1528
+ console.warn('Error in DataSource: send message throw: ', errorMessage);
1529
+ console.error(
1530
+ 'Error in DataSource: send message throw: ',
1531
+ errorMessage,
1532
+ );
1533
+ }
1472
1534
  }
1473
1535
 
1474
1536
  if (qbMessageId === null || qbMessageId === undefined) {
@@ -1479,7 +1541,7 @@ export class RemoteDataSource implements IRemoteDataSource {
1479
1541
  ),
1480
1542
  );
1481
1543
  }
1482
- console.log('regular message was sent');
1544
+ console.log(`DataSource: regular message was sent, id: ${qbMessageId}`);
1483
1545
  // eslint-disable-next-line no-param-reassign
1484
1546
  dto.id = qbMessageId;
1485
1547
 
@@ -23,7 +23,6 @@ export class CreateDialogUseCase implements IUseCase<void, DialogEntity> {
23
23
  newDialog: GroupDialogEntity,
24
24
  textInformationMessage: string,
25
25
  ) {
26
- console.log('CONSTRUCTOR CreateDialogUseCase');
27
26
  this.dialogRepository = dialogRepository;
28
27
  this.newDialog = newDialog;
29
28
  this.eventMessagesRepository = eventMessagesRepository;
@@ -23,7 +23,6 @@ export class ForwardMessagesUseCase implements IUseCase<void, boolean> {
23
23
  relatedMessage: MessageEntity,
24
24
  userName: string,
25
25
  ) {
26
- console.log('CONSTRUCTOR ForwardMessagesUseCase');
27
26
  this.messagesRepository = messagesRepository;
28
27
  this.relatedMessage = relatedMessage;
29
28
  this.targetDialogs = targetDialogs;
@@ -8,7 +8,6 @@ export class GetAllDialogsUseCase
8
8
  private dialogRepository: DialogsRepository;
9
9
 
10
10
  constructor(dialogRepository: DialogsRepository) {
11
- console.log('CONSTRUCTOR GetAllDialogsUseCase');
12
11
  this.dialogRepository = dialogRepository;
13
12
  }
14
13
 
@@ -11,13 +11,11 @@ export class GetAllDialogsUseCaseWithMock
11
11
  private readonly pagination: Pagination;
12
12
 
13
13
  constructor(dialogRepository: DialogsRepository, pagination?: Pagination) {
14
- console.log('CONSTRUCTOR GetAllDialogsUseCaseWithMock');
15
14
  this.dialogRepository = dialogRepository;
16
15
  this.pagination = pagination || new Pagination();
17
16
  }
18
17
 
19
18
  async execute(): Promise<PaginatedResult<DialogEntity>> {
20
- console.log('execute GetAllDialogsUseCaseWithMock');
21
19
  const fromRemote: PaginatedResult<DialogEntity> =
22
20
  await this.dialogRepository.getDialogsFromRemote(this.pagination);
23
21
 
@@ -17,7 +17,6 @@ export class GetAllMessagesForDialogMock
17
17
  dialogId: string,
18
18
  currentPagination: Pagination,
19
19
  ) {
20
- console.log('CONSTRUCTOR GetAllMessagesForDialog');
21
20
  this.messagesRepository = messagesRepository;
22
21
  this.dialogId = dialogId;
23
22
  this.currentPagination = currentPagination;
@@ -17,7 +17,6 @@ export class GetAllUsersUseCase
17
17
  currentPagination: Pagination,
18
18
  filter: string,
19
19
  ) {
20
- console.log('CONSTRUCTOR GetUsersByIdsUseCase');
21
20
  this.usersRepository = usersRepository;
22
21
  this.currentPagination = currentPagination;
23
22
  this.filter = filter;
@@ -8,13 +8,11 @@ export class GetDialogByIdUseCase implements IUseCase<void, DialogEntity> {
8
8
  private readonly dialogId: string;
9
9
 
10
10
  constructor(dialogRepository: DialogsRepository, dialogId: string) {
11
- console.log('CONSTRUCTOR GetDialogByIdUseCase');
12
11
  this.dialogRepository = dialogRepository;
13
12
  this.dialogId = dialogId;
14
13
  }
15
14
 
16
15
  async execute(): Promise<DialogEntity> {
17
- console.log('execute GetAllDialogsUseCaseWithMock');
18
16
  const fromRemote: DialogEntity =
19
17
  await this.dialogRepository.getDialogFromRemote(this.dialogId);
20
18
 
@@ -8,7 +8,6 @@ export class GetUsersByIdsUseCase implements IUseCase<void, Array<UserEntity>> {
8
8
  private userIds: Array<number>;
9
9
 
10
10
  constructor(usersRepository: UsersRepository, userIds: Array<number>) {
11
- console.log('CONSTRUCTOR GetUsersByIdsUseCase');
12
11
  this.usersRepository = usersRepository;
13
12
  this.userIds = userIds;
14
13
  }
@@ -36,7 +36,6 @@ export class LeaveDialogUseCase implements IUseCase<void, boolean> {
36
36
  leaveType: DialogLeaveTypeArcheType,
37
37
  textInformationMessage: string,
38
38
  ) {
39
- console.log('CONSTRUCTOR LeaveDialogUseCase');
40
39
  this.eventMessagesRepository = eventMessagesRepository;
41
40
  this.dialogRepository = dialogRepository;
42
41
  this.dialogToLeave = dialog;
@@ -30,7 +30,6 @@ export class RemoveUsersFromTheDialogUseCase
30
30
  usersIds: Array<number>,
31
31
  textInformationMessage: string,
32
32
  ) {
33
- console.log('CONSTRUCTOR LeaveDialogUseCase');
34
33
  this.eventMessagesRepository = eventMessagesRepository;
35
34
  this.dialogRepository = dialogRepository;
36
35
  this.dialogToLeave = dialog;
@@ -14,14 +14,12 @@ export class ReplyMessagesUseCase implements IUseCase<void, MessageEntity> {
14
14
  messagesToReply: MessageEntity[],
15
15
  relatedMessage: MessageEntity,
16
16
  ) {
17
- console.log('CONSTRUCTOR ReplyMessagesUseCase');
18
17
  this.messagesRepository = messagesRepository;
19
18
  this.relatedMessage = relatedMessage;
20
19
  this.messagesToReply = messagesToReply;
21
20
  }
22
21
 
23
22
  async execute(): Promise<MessageEntity> {
24
- console.log('execute ReplyMessagesUseCase');
25
23
  this.relatedMessage.qb_original_messages = this.messagesToReply;
26
24
  this.relatedMessage.qb_message_action = 'reply';
27
25
  this.relatedMessage.origin_sender_name =
@@ -11,14 +11,11 @@ export class SendTextMessageUseCase implements IUseCase<void, MessageEntity> {
11
11
  messagesRepository: MessagesRepository,
12
12
  messageToSend: MessageEntity,
13
13
  ) {
14
- console.log('CONSTRUCTOR SendTextMessageUseCase');
15
14
  this.messagesRepository = messagesRepository;
16
15
  this.messageToSend = messageToSend;
17
16
  }
18
17
 
19
18
  async execute(): Promise<MessageEntity> {
20
- console.log('execute SendTextMessageUseCase');
21
-
22
19
  const sentMessage: MessageEntity =
23
20
  await this.messagesRepository.sendMessageToRemote(this.messageToSend);
24
21