@cometchat/chat-uikit-react-native 4.3.16 → 4.3.17
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.
- package/package.json +1 -1
- package/src/AI/AIAssistBot/AIAssistBotDecorator.tsx +20 -15
- package/src/AI/AIAssistBot/AIAssistBotStyle.ts +2 -2
- package/src/AI/AIAssistBot/AIAssistBotView.tsx +16 -14
- package/src/AI/AIAssistBot/configuration.ts +8 -7
- package/src/AI/AIAssistBot/resources/index.ts +1 -0
- package/src/AI/AIBaseConfiguration.ts +1 -0
- package/src/AI/AIConversationStarter/AIConversationStarterDecorator.tsx +27 -26
- package/src/AI/AIConversationStarter/AIConversationStarterStyle.ts +1 -0
- package/src/AI/AIConversationStarter/style.ts +29 -31
- package/src/AI/AIConversationSummary/AIConversationSummaryDecorator.tsx +14 -13
- package/src/AI/AIConversationSummary/AIConversationSummaryView.tsx +5 -4
- package/src/AI/AIConversationSummary/resources/index.ts +1 -0
- package/src/AI/AIExtensionDataSource.ts +1 -0
- package/src/AI/AISmartReplies/AISmartRepliesDecorator.tsx +28 -27
- package/src/AI/AISmartReplies/configuration.ts +2 -0
- package/src/AI/CardView.tsx +5 -5
- package/src/AI/resources/index.ts +3 -0
- package/src/AI/style.ts +68 -80
- package/src/CometChatAddMembers/AddMembersConfiguration.tsx +1 -0
- package/src/CometChatAddMembers/CometChatAddMembers.tsx +12 -12
- package/src/CometChatAddMembers/index.ts +10 -8
- package/src/CometChatBannedMembers/BannedMembersConfiguration.tsx +1 -0
- package/src/CometChatBannedMembers/CometChatBannedMembers.tsx +8 -8
- package/src/CometChatBannedMembers/index.ts +12 -7
- package/src/CometChatBannedMembers/resources/index.ts +1 -0
- package/src/CometChatContacts/CometChatContacts.tsx +9 -9
- package/src/CometChatContacts/ContactsConfiguration.tsx +1 -0
- package/src/CometChatContacts/Header.tsx +4 -4
- package/src/CometChatContacts/index.ts +5 -3
- package/src/CometChatConversations/CometChatConversations.tsx +204 -172
- package/src/CometChatConversations/index.ts +21 -10
- package/src/CometChatConversations/resources/index.ts +14 -0
- package/src/CometChatConversationsWithMessages/CometChatConversationsWithMessages.tsx +6 -5
- package/src/CometChatConversationsWithMessages/index.ts +6 -5
- package/src/CometChatConversationsWithMessages/resources/index.ts +1 -0
- package/src/CometChatCreateGroup/CometChatCreateGroup.tsx +30 -30
- package/src/CometChatCreateGroup/CreateGroupConfiguration.ts +1 -0
- package/src/CometChatCreateGroup/Header.tsx +1 -1
- package/src/CometChatCreateGroup/index.ts +5 -6
- package/src/CometChatCreateGroup/resources/index.ts +3 -0
- package/src/CometChatDetails/CometChatDetails.tsx +29 -28
- package/src/CometChatDetails/DetailsConfiguration.tsx +1 -0
- package/src/CometChatDetails/Header.tsx +1 -1
- package/src/CometChatDetails/index.ts +17 -15
- package/src/CometChatDetails/listners.ts +16 -16
- package/src/CometChatDetails/resources/index.ts +5 -0
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +52 -52
- package/src/CometChatGroupMembers/GroupMemberConfiguration.ts +1 -1
- package/src/CometChatGroupMembers/GroupMemberStyle.ts +3 -3
- package/src/CometChatGroupMembers/index.ts +8 -16
- package/src/CometChatGroupMembers/resources/index.ts +5 -0
- package/src/CometChatGroups/CometChatGroups.tsx +46 -46
- package/src/CometChatGroups/GroupsConfiguration.ts +10 -9
- package/src/CometChatGroups/GroupsStyle.ts +1 -1
- package/src/CometChatGroups/index.ts +11 -10
- package/src/CometChatGroups/resources/index.ts +10 -0
- package/src/CometChatGroupsWithMessages/CometChatGroupsWithMessages.tsx +9 -8
- package/src/CometChatGroupsWithMessages/index.ts +6 -5
- package/src/CometChatGroupsWithMessages/resources/index.ts +1 -0
- package/src/CometChatJoinProtectedGroup/CometChatJoinProtectedGroup.tsx +22 -21
- package/src/CometChatJoinProtectedGroup/Header.tsx +1 -1
- package/src/CometChatJoinProtectedGroup/JoinProtectedGroupConfiguration.ts +1 -0
- package/src/CometChatJoinProtectedGroup/index.ts +5 -6
- package/src/CometChatJoinProtectedGroup/resources/index.ts +2 -0
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +62 -59
- package/src/CometChatMessageComposer/MessageComposerConfiguration.tsx +1 -0
- package/src/CometChatMessageComposer/index.ts +6 -7
- package/src/CometChatMessageComposer/resources/index.ts +10 -0
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +33 -31
- package/src/CometChatMessageHeader/MessageHeaderConfiguration.tsx +1 -0
- package/src/CometChatMessageHeader/index.ts +12 -13
- package/src/CometChatMessageHeader/listners.ts +18 -18
- package/src/CometChatMessageHeader/resources/index.ts +3 -0
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +28 -24
- package/src/CometChatMessageInformation/index.ts +8 -8
- package/src/CometChatMessageInformation/resources/index.ts +1 -0
- package/src/CometChatMessageList/CometChatMessageList.tsx +214 -195
- package/src/CometChatMessageList/MessageListConfiguration.ts +26 -25
- package/src/CometChatMessageList/index.ts +16 -18
- package/src/CometChatMessageList/resources/index.ts +7 -0
- package/src/CometChatMessages/CometChatMessages.tsx +29 -26
- package/src/CometChatMessages/MessagesConfiguration.ts +2 -0
- package/src/CometChatMessages/index.ts +8 -7
- package/src/CometChatMessages/resources/index.ts +1 -0
- package/src/CometChatTabs/CometChatTabs.tsx +13 -23
- package/src/CometChatTabs/CometChatTabsStyle.ts +2 -0
- package/src/CometChatTabs/index.ts +3 -8
- package/src/CometChatThreadedMessages/CometChatThreadedMessages.tsx +37 -37
- package/src/CometChatThreadedMessages/Header.tsx +2 -2
- package/src/CometChatThreadedMessages/ThreadedMessagesConfiguration.ts +1 -0
- package/src/CometChatThreadedMessages/index.ts +11 -12
- package/src/CometChatThreadedMessages/resources/index.ts +6 -0
- package/src/CometChatTransferOwnership/CometChatTransferOwnership.tsx +5 -5
- package/src/CometChatTransferOwnership/TransferOwnershipConfiguration.ts +1 -0
- package/src/CometChatTransferOwnership/index.ts +10 -11
- package/src/CometChatUsers/CometChatUsers.tsx +11 -11
- package/src/CometChatUsers/UsersConfiguration.tsx +1 -0
- package/src/CometChatUsers/index.ts +8 -6
- package/src/CometChatUsersWithMessages/CometChatUsersWithMessages.tsx +6 -5
- package/src/CometChatUsersWithMessages/index.ts +6 -5
- package/src/calls/CallUtils.ts +4 -3
- package/src/calls/CallingDetailsUtils.tsx +9 -8
- package/src/calls/CallingExtension.tsx +2 -2
- package/src/calls/CallingExtentionDecorator.tsx +17 -17
- package/src/calls/CometChatCallBubble/CometChatCallBubble.tsx +3 -2
- package/src/calls/CometChatCallBubble/index.ts +14 -10
- package/src/calls/CometChatCallBubble/resources/index.ts +3 -0
- package/src/calls/CometChatCallButtons/CometChatCallButtonConfiguration.ts +1 -0
- package/src/calls/CometChatCallButtons/CometChatCallButtons.tsx +19 -18
- package/src/calls/CometChatCallButtons/index.ts +10 -8
- package/src/calls/CometChatCallButtons/resources/index.ts +2 -0
- package/src/calls/CometChatCallLogDetails/CallLogDetailsConfiguration.ts +2 -0
- package/src/calls/CometChatCallLogDetails/CometChatCallLogDetails.tsx +14 -13
- package/src/calls/CometChatCallLogDetails/index.ts +21 -10
- package/src/calls/CometChatCallLogDetails/resources/index.ts +1 -0
- package/src/calls/CometChatCallLogHistory/CallLogHistoryConfiguration.ts +3 -1
- package/src/calls/CometChatCallLogHistory/CometChatCallLogHistory.tsx +25 -24
- package/src/calls/CometChatCallLogHistory/index.ts +21 -10
- package/src/calls/CometChatCallLogHistory/resources/index.ts +13 -0
- package/src/calls/CometChatCallLogParticipants/CallLogParticipantsConfiguration.ts +4 -2
- package/src/calls/CometChatCallLogParticipants/CometChatCallLogParticipants.tsx +13 -12
- package/src/calls/CometChatCallLogParticipants/index.ts +21 -10
- package/src/calls/CometChatCallLogParticipants/resources/index.ts +1 -0
- package/src/calls/CometChatCallLogRecordings/CallLogRecordingsConfiguration.ts +5 -3
- package/src/calls/CometChatCallLogRecordings/CometChatCallLogRecordings.tsx +14 -13
- package/src/calls/CometChatCallLogRecordings/index.ts +21 -10
- package/src/calls/CometChatCallLogRecordings/resources/index.ts +2 -0
- package/src/calls/CometChatCallLogs/CallLogsConfiguration.ts +5 -3
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +37 -36
- package/src/calls/CometChatCallLogs/index.ts +14 -10
- package/src/calls/CometChatCallLogs/resources/index.ts +11 -0
- package/src/calls/CometChatCallLogsWithDetails/CallLogsWithDetailsConfiguration.ts +1 -0
- package/src/calls/CometChatCallLogsWithDetails/CometChatCallLogsWithDetails.tsx +3 -2
- package/src/calls/CometChatCallLogsWithDetails/index.ts +2 -4
- package/src/calls/CometChatIncomingCall/CometChatIncomingCall.tsx +19 -15
- package/src/calls/CometChatIncomingCall/index.ts +10 -8
- package/src/calls/CometChatIncomingCall/resources/index.ts +4 -0
- package/src/calls/CometChatIncomingCall/styles.ts +0 -1
- package/src/calls/CometChatOngoingCall/CometChatOngoingCall.tsx +5 -4
- package/src/calls/CometChatOngoingCall/index.ts +6 -6
- package/src/calls/CometChatOutgoingCall/CometChatOutgoingCall.tsx +15 -13
- package/src/calls/CometChatOutgoingCall/index.ts +8 -6
- package/src/calls/CometChatOutgoingCall/resources/index.ts +1 -0
- package/src/calls/index.ts +99 -60
- package/src/calls/resources/index.ts +3 -0
- package/src/extensions/CollaborativeBubble/CometChatCollaborativeBubble.tsx +1 -0
- package/src/extensions/CollaborativeBubble/resources/index.ts +1 -0
- package/src/extensions/CollaborativeBubble/styles.ts +1 -1
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentConfiguration.tsx +1 -1
- package/src/extensions/CollaborativeDocument/CollaborativeDocumentExtensionDecorator.tsx +10 -9
- package/src/extensions/CollaborativeDocument/index.ts +12 -9
- package/src/extensions/CollaborativeDocument/resources/index.ts +2 -0
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardConfiguration.tsx +1 -1
- package/src/extensions/CollaborativeWhiteboard/CollaborativeWhiteboardExtensionDecorator.tsx +15 -14
- package/src/extensions/CollaborativeWhiteboard/index.ts +12 -9
- package/src/extensions/CollaborativeWhiteboard/resources/index.ts +2 -0
- package/src/extensions/ExtensionModerator.tsx +4 -4
- package/src/extensions/ImageModeration/ImageModerationDecorator.tsx +1 -1
- package/src/extensions/ImageModeration/ImageModerationFilter.tsx +2 -1
- package/src/extensions/ImageModeration/index.ts +15 -7
- package/src/extensions/ImageModeration/resources/index.ts +1 -0
- package/src/extensions/LinkPreview/LinkPreviewBubble.tsx +8 -8
- package/src/extensions/LinkPreview/LinkPreviewExtention.tsx +1 -1
- package/src/extensions/LinkPreview/LinkPreviewExtentionDecorator.tsx +2 -1
- package/src/extensions/LinkPreview/index.ts +18 -10
- package/src/extensions/LinkPreview/resources/index.ts +1 -0
- package/src/extensions/MessageTranslation/MessageTranslationBubble.tsx +7 -7
- package/src/extensions/MessageTranslation/MessageTranslationDecorator.tsx +19 -17
- package/src/extensions/MessageTranslation/index.ts +7 -7
- package/src/extensions/MessageTranslation/resources/index.ts +1 -0
- package/src/extensions/Polls/Header.tsx +8 -8
- package/src/extensions/Polls/Polls.tsx +38 -33
- package/src/extensions/Polls/PollsBubble.tsx +35 -33
- package/src/extensions/Polls/PollsDecorator.tsx +7 -7
- package/src/extensions/Polls/index.ts +4 -5
- package/src/extensions/Polls/resources/index.ts +5 -0
- package/src/extensions/SmartReplies/SmartRepliesDecorator.tsx +11 -11
- package/src/extensions/SmartReplies/SmartRepliesView.tsx +4 -3
- package/src/extensions/SmartReplies/index.ts +6 -2
- package/src/extensions/SmartReplies/resources/index.ts +1 -0
- package/src/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.tsx +12 -10
- package/src/extensions/Stickers/CometChatStickerKeyboard/StickerKeyboardConfiguration.ts +2 -1
- package/src/extensions/Stickers/CometChatStickerKeyboard/hooks.ts +19 -17
- package/src/extensions/Stickers/StickersBubble.tsx +4 -4
- package/src/extensions/Stickers/StickersExtensionDecorator.tsx +11 -10
- package/src/extensions/Stickers/index.ts +13 -8
- package/src/extensions/Stickers/resources/index.ts +1 -0
- package/src/extensions/TextModeration/TextModerationConfiguration.tsx +1 -1
- package/src/extensions/TextModeration/TextModerationExtension.tsx +1 -0
- package/src/extensions/TextModeration/TextModerationExtensionDecorator.tsx +1 -0
- package/src/extensions/TextModeration/index.ts +5 -4
- package/src/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.tsx +5 -5
- package/src/extensions/ThumbnailGeneration/index.ts +6 -2
- package/src/extensions/ThumbnailGeneration/resources/index.ts +1 -0
- package/src/extensions/index.ts +92 -47
- package/src/index.ts +225 -232
- package/src/shared/CometChatContext.tsx +1 -1
- package/src/shared/CometChatUiKit/CometChatUIKit.ts +40 -36
- package/src/shared/CometChatUiKit/CometChatUIKitHelper.ts +1 -0
- package/src/shared/assets/images/index.ts +16 -0
- package/src/shared/assets/images/search.png +0 -0
- package/src/shared/base/FontStyle.ts +2 -2
- package/src/shared/base/index.ts +8 -11
- package/src/shared/base/vars.ts +2 -2
- package/src/shared/constants/UIKitConstants.ts +16 -1
- package/src/shared/events/CometChatMessageEvents/index.ts +6 -4
- package/src/shared/events/CometChatUIEventHandler/CometChatUIEventHandler.ts +221 -219
- package/src/shared/events/CometChatUIEventHandler/Listener.ts +39 -37
- package/src/shared/events/ListenerInitializer.ts +8 -1
- package/src/shared/events/messages.ts +2 -0
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +11 -15
- package/src/shared/formatters/CometChatTextFormatter.ts +6 -5
- package/src/shared/formatters/CometChatUrlsFormatter/index.tsx +8 -10
- package/src/shared/framework/DataSource.ts +17 -17
- package/src/shared/framework/DataSourceDecorator.tsx +3 -2
- package/src/shared/framework/ExtensionsDataSource.tsx +1 -0
- package/src/shared/framework/MessageDataSource.tsx +125 -117
- package/src/shared/framework/index.ts +12 -6
- package/src/shared/framework/resources/index.ts +20 -0
- package/src/shared/helper/helperFunctions.ts +7 -5
- package/src/shared/index.ts +109 -100
- package/src/shared/libs/CometChatCalendar/Calendars/BaseCalendar.tsx +6 -3
- package/src/shared/libs/CometChatCalendar/Calendars/DateSelectionCalendar.tsx +2 -0
- package/src/shared/libs/CometChatCalendar/Calendars/MultiDateSelectionCalendar.tsx +2 -0
- package/src/shared/libs/CometChatCalendar/Components/Day.tsx +2 -0
- package/src/shared/libs/CometChatCalendar/Components/Days.tsx +1 -0
- package/src/shared/libs/CometChatCalendar/Components/Month.tsx +1 -0
- package/src/shared/libs/CometChatCalendar/Components/Months.tsx +1 -0
- package/src/shared/libs/CometChatCalendar/Components/Title.tsx +2 -0
- package/src/shared/libs/CometChatCalendar/Hooks/useSurroundingTimeUnits.ts +3 -0
- package/src/shared/libs/CometChatCalendar/Locales/index.ts +1 -0
- package/src/shared/libs/CometChatCalendar/Utils/dateRange.ts +1 -0
- package/src/shared/libs/CometChatCalendar/Utils/getExtraDays.ts +1 -0
- package/src/shared/libs/CometChatCalendar/Utils/getSurroundingTimeUnits.ts +1 -0
- package/src/shared/libs/ImageZoom/ReactNativeZoomableView.tsx +45 -42
- package/src/shared/libs/ImageZoom/ReactNativeZoomableViewWithGestures.tsx +13 -11
- package/src/shared/libs/ImageZoom/types/index.ts +12 -12
- package/src/shared/libs/VideoPlayerControls/OSSupport/TVOSSupport.tsx +1 -0
- package/src/shared/libs/VideoPlayerControls/VideoPlayer.tsx +1 -0
- package/src/shared/libs/datePickerModal/Modal.js +1 -1
- package/src/shared/modals/CometChatDetailsOption.ts +2 -2
- package/src/shared/modals/CometChatMessageTemplate.ts +13 -12
- package/src/shared/modals/InteractiveData/InteractiveElements/DateTimeElement.ts +7 -7
- package/src/shared/modals/InteractiveData/InteractiveMessage/CardMessage.ts +1 -0
- package/src/shared/modals/InteractiveData/InteractiveMessage/CustomInteractiveMessage.ts +1 -0
- package/src/shared/modals/InteractiveData/InteractiveMessage/FormMessage.ts +1 -0
- package/src/shared/modals/InteractiveData/InteractiveMessage/SchedulerMessage.ts +6 -7
- package/src/shared/modals/index.ts +37 -14
- package/src/shared/resources/CometChatLocalize/CometChatLocalize.ts +5 -5
- package/src/shared/resources/CometChatSoundManager/index.ts +1 -0
- package/src/shared/resources/CometChatTheme/Palette.ts +57 -55
- package/src/shared/resources/CometChatTheme/Typography.ts +30 -30
- package/src/shared/utils/CometChatLiveReactions/CometChatLiveReaction.tsx +17 -13
- package/src/shared/utils/CometChatLiveReactions/resources/index.ts +1 -0
- package/src/shared/utils/CometChatMessageHelper/index.ts +2 -2
- package/src/shared/utils/CometChatMessagePreview/{index.js → index.ts} +3 -0
- package/src/shared/utils/CometChatMessagePreview/resources/index.ts +1 -0
- package/src/shared/utils/CommonUtils.ts +76 -0
- package/src/shared/utils/DetailsUtils/DetailsUtils.tsx +3 -2
- package/src/shared/utils/DetailsUtils/resources/index.ts +7 -0
- package/src/shared/utils/InteractiveMessageUtils.ts +6 -5
- package/src/shared/utils/MessageUtils.tsx +103 -15
- package/src/shared/utils/NetworkUtils.tsx +1 -1
- package/src/shared/utils/PermissionUtil.ts +7 -6
- package/src/shared/utils/SchedulerUtils.ts +8 -6
- package/src/shared/utils/TypeUtils.ts +3 -0
- package/src/shared/utils/conversationUtils.ts +7 -5
- package/src/shared/utils/index.ts +2 -0
- package/src/shared/views/CometChatAICard/CometChatAICard.tsx +7 -6
- package/src/shared/views/CometChatAICard/resources/index.ts +2 -0
- package/src/shared/views/CometChatActionSheet/ActionSheetStyle.ts +3 -0
- package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +5 -5
- package/src/shared/views/CometChatActionSheet/hooks.ts +2 -2
- package/src/shared/views/CometChatActionSheet/index.ts +5 -3
- package/src/shared/views/CometChatActionSheet/resources/index.ts +2 -0
- package/src/shared/views/CometChatAudioBubble/CometChatAudioBubble.tsx +6 -6
- package/src/shared/views/CometChatAudioBubble/index.ts +8 -12
- package/src/shared/views/CometChatAudioBubble/resources/index.ts +2 -0
- package/src/shared/views/CometChatAvatar/CometChatAvatar.tsx +6 -5
- package/src/shared/views/CometChatAvatar/index.ts +7 -9
- package/src/shared/views/CometChatBadge/CometChatBadge.tsx +3 -3
- package/src/shared/views/CometChatBadge/index.ts +7 -9
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +51 -48
- package/src/shared/views/CometChatBottomSheet/index.ts +6 -2
- package/src/shared/views/CometChatButton/CometChatButton.tsx +5 -5
- package/src/shared/views/CometChatButton/index.ts +4 -14
- package/src/shared/views/CometChatCard/CometChatCard.tsx +3 -3
- package/src/shared/views/CometChatCard/index.ts +6 -7
- package/src/shared/views/CometChatCardBubble/CometChatCardBubble.tsx +11 -10
- package/src/shared/views/CometChatCardBubble/index.tsx +2 -1
- package/src/shared/views/CometChatCheckBox/CometChatCheckBox.tsx +6 -6
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +9 -9
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialogStyle.ts +1 -0
- package/src/shared/views/CometChatConfirmDialog/index.ts +9 -6
- package/src/shared/views/CometChatDate/CometChatDate.tsx +2 -2
- package/src/shared/views/CometChatDate/index.ts +12 -11
- package/src/shared/views/CometChatDateTimePicker/CometChatDateTimePicker.tsx +20 -17
- package/src/shared/views/CometChatDateTimePicker/index.ts +3 -5
- package/src/shared/views/CometChatDropDown/CometChatDropDown.tsx +8 -7
- package/src/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.tsx +24 -33
- package/src/shared/views/CometChatEmojiKeyboard/Emoji.ts +1 -1
- package/src/shared/views/CometChatEmojiKeyboard/EmojiCategory.ts +1 -1
- package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardConfiguration.ts +2 -1
- package/src/shared/views/CometChatEmojiKeyboard/EmojiKeyboardStyle.ts +2 -1
- package/src/shared/views/CometChatEmojiKeyboard/emojis.ts +8 -0
- package/src/shared/views/CometChatEmojiKeyboard/resources/index.ts +8 -0
- package/src/shared/views/CometChatEmojiKeyboard/style.ts +2 -2
- package/src/shared/views/CometChatFileBubble/CometChatFileBubble.tsx +3 -3
- package/src/shared/views/CometChatFileBubble/FileBubbleStyle.ts +1 -1
- package/src/shared/views/CometChatFileBubble/index.ts +7 -8
- package/src/shared/views/CometChatFileBubble/resources/index.ts +2 -0
- package/src/shared/views/CometChatFormBubble/CometChatFormBubble.tsx +33 -29
- package/src/shared/views/CometChatFormBubble/index.tsx +2 -1
- package/src/shared/views/CometChatImageBubble/CometChatImageBubble.tsx +63 -17
- package/src/shared/views/CometChatImageBubble/ImageBubbleStyle.ts +1 -1
- package/src/shared/views/CometChatImageBubble/assets/default_image.png +0 -0
- package/src/shared/views/CometChatImageBubble/assets/index.ts +3 -0
- package/src/shared/views/CometChatImageBubble/index.ts +10 -8
- package/src/shared/views/CometChatImageViewerModal/ImageViewerModal.tsx +1 -1
- package/src/shared/views/CometChatImageViewerModal/resources/index.ts +1 -0
- package/src/shared/views/CometChatLabel/CometChatLabel.tsx +2 -2
- package/src/shared/views/CometChatList/CometChatList.tsx +46 -42
- package/src/shared/views/CometChatList/index.ts +3 -3
- package/src/shared/views/CometChatList/resources/index.ts +5 -0
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +18 -13
- package/src/shared/views/CometChatListItem/ListItemConfiguration.tsx +1 -0
- package/src/shared/views/CometChatListItem/index.ts +8 -7
- package/src/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.tsx +34 -31
- package/src/shared/views/CometChatMediaRecorder/index.ts +8 -9
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +19 -12
- package/src/shared/views/CometChatMessageBubble/index.ts +6 -5
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +10 -9
- package/src/shared/views/CometChatMessageInput/index.ts +2 -1
- package/src/shared/views/CometChatPanel/CometChatPanel.tsx +3 -3
- package/src/shared/views/CometChatPanel/resources/index.ts +1 -0
- package/src/shared/views/CometChatQuickReactions/CometChatQuickReactions.tsx +4 -4
- package/src/shared/views/CometChatQuickReactions/QuickReactionsConfiguration.tsx +1 -0
- package/src/shared/views/CometChatQuickReactions/index.ts +3 -7
- package/src/shared/views/CometChatQuickReactions/resources/index.ts +1 -0
- package/src/shared/views/CometChatQuickView/CometChatQuickView.tsx +6 -6
- package/src/shared/views/CometChatRadioButton/CometChatRadioButton.tsx +4 -4
- package/src/shared/views/CometChatReactionList/CometChatReactionList.tsx +29 -28
- package/src/shared/views/CometChatReactionList/ReactionListConfiguration.tsx +1 -0
- package/src/shared/views/CometChatReactionList/index.ts +3 -7
- package/src/shared/views/CometChatReactionList/resources/index.ts +1 -0
- package/src/shared/views/CometChatReactions/CometChatReactions.tsx +14 -14
- package/src/shared/views/CometChatReactions/ReactionsConfiguration.tsx +1 -0
- package/src/shared/views/CometChatReactions/index.ts +15 -11
- package/src/shared/views/CometChatReceipt/CometChatReceipt.tsx +5 -5
- package/src/shared/views/CometChatReceipt/index.ts +10 -8
- package/src/shared/views/CometChatSchedulerBubble/CometChatSchedulerBubble.tsx +59 -53
- package/src/shared/views/CometChatSchedulerBubble/index.ts +3 -5
- package/src/shared/views/CometChatSchedulerBubble/styles.ts +1 -1
- package/src/shared/views/CometChatSingleSelect/CometChatSingleSelect.tsx +4 -4
- package/src/shared/views/CometChatStatusIndicator/CometChatStatusIndicator.tsx +4 -4
- package/src/shared/views/CometChatStatusIndicator/StatusIndicatorConfiguration.ts +2 -2
- package/src/shared/views/CometChatStatusIndicator/index.ts +21 -10
- package/src/shared/views/CometChatSuggestionList/CometChatSuggestionList.tsx +1 -1
- package/src/shared/views/CometChatSuggestionList/SuggestionItem.ts +5 -5
- package/src/shared/views/CometChatSuggestionList/SuggestionListConfiguration.ts +3 -3
- package/src/shared/views/CometChatSuggestionList/index.ts +14 -10
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +6 -5
- package/src/shared/views/CometChatTextBubble/index.ts +6 -7
- package/src/shared/views/CometChatTextInput/CometChatTextInput.tsx +2 -2
- package/src/shared/views/CometChatTimeSlotSelector/CometChatTimeSlotSelector.tsx +5 -5
- package/src/shared/views/CometChatTimeSlotSelector/index.ts +3 -5
- package/src/shared/views/CometChatVideoBubble/CometChatVideoBubble.tsx +9 -8
- package/src/shared/views/CometChatVideoBubble/index.ts +10 -8
- package/src/shared/views/CometChatVideoBubble/resources/index.ts +2 -0
- package/src/shared/views/CometChatVideoPlayer/CometChatVideoPlayer.tsx +1 -1
- package/src/shared/views/SwipeRow/SwipeRow.tsx +4 -3
- package/src/shared/views/index.ts +151 -86
- package/ios/CometchatUiKit.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/CometchatUiKit.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/src/shared/libs/CometChatCalendar/Components/Arrow.test.tsx +0 -112
- package/src/shared/libs/CometChatCalendar/Components/Day.test.tsx +0 -396
- package/src/shared/libs/CometChatCalendar/Components/Days.test.tsx +0 -216
- package/src/shared/libs/CometChatCalendar/Components/Month.test.tsx +0 -160
- package/src/shared/libs/CometChatCalendar/Components/Months.test.tsx +0 -262
- package/src/shared/libs/CometChatCalendar/Components/Title.test.tsx +0 -111
- package/src/shared/libs/CometChatCalendar/Components/Weekdays.test.tsx +0 -69
- package/src/shared/libs/CometChatCalendar/Hooks/useSurroundingTimeUnits.test.ts +0 -44
- package/src/shared/libs/CometChatCalendar/Utils/addOpacity.test.ts +0 -49
- package/src/shared/libs/CometChatCalendar/Utils/clamp.test.ts +0 -39
- package/src/shared/libs/CometChatCalendar/Utils/dateRange.test.ts +0 -20
- package/src/shared/libs/CometChatCalendar/Utils/getExtraDays.test.ts +0 -48
- package/src/shared/libs/CometChatCalendar/Utils/getSurroundingTimeUnits.test.ts +0 -60
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext } from "react";
|
|
2
|
-
import { View, Text } from "react-native";
|
|
2
|
+
import { View, Text, TextStyle, ViewProps } from "react-native";
|
|
3
3
|
//@ts-ignore
|
|
4
4
|
import { CometChat } from "@cometchat/chat-sdk-react-native";
|
|
5
5
|
import {
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "./resources";
|
|
27
27
|
import { ConversationsStyle, ConversationsStyleInterface } from "./ConversationsStyle";
|
|
28
28
|
import { ImageType } from "../shared";
|
|
29
|
-
import { GroupTypeConstants, MessageCategoryConstants, MessageStatusConstants, PASSWORD_GROUP_COLOR, PRIVATE_GROUP_COLOR, ReceiverTypeConstants } from "../shared/constants/UIKitConstants";
|
|
29
|
+
import { ConversationTypeConstants, GroupTypeConstants, MessageCategoryConstants, MessageStatusConstants, PASSWORD_GROUP_COLOR, PRIVATE_GROUP_COLOR, ReceiverTypeConstants } from "../shared/constants/UIKitConstants";
|
|
30
30
|
import { AvatarStyle, BadgeStyle, CometChatBadge, CometChatDate, CometChatListItem, CometChatReceipt, DateStyle, StatusIndicatorStyle } from "../shared";
|
|
31
31
|
import { ListItemStyle, ListItemStyleInterface } from "../shared";
|
|
32
32
|
import { CometChatContextType, MessageReceipt, SelectionMode } from "../shared/base/Types";
|
|
@@ -285,13 +285,13 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
285
285
|
|
|
286
286
|
//context
|
|
287
287
|
const { theme } = useContext<CometChatContextType>(CometChatContext);
|
|
288
|
-
const activeSwipeRows = React.useRef({});
|
|
288
|
+
const activeSwipeRows = React.useRef<any>({});
|
|
289
289
|
|
|
290
290
|
const conversationListRef = React.useRef<CometChatListActionsInterface>(null);
|
|
291
|
-
const loggedInUser = React.useRef(null);
|
|
291
|
+
const loggedInUser = React.useRef<CometChat.User | null | any>(null);
|
|
292
292
|
const [confirmDelete, setConfirmDelete] = React.useState(undefined);
|
|
293
293
|
const [selecting, setSelecting] = React.useState(selectionMode === 'none' ? false : true);
|
|
294
|
-
const [selectedConversation, setSelectedConversations] = React.useState([]);
|
|
294
|
+
const [selectedConversation, setSelectedConversations] = React.useState<any[]>([]);
|
|
295
295
|
const onMemberAddedToGroupDebounceTimer = React.useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
296
296
|
|
|
297
297
|
const _style = new ConversationsStyle({
|
|
@@ -345,7 +345,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
345
345
|
const ErrorView = () => {
|
|
346
346
|
return (
|
|
347
347
|
<View style={Style.listContainer}>
|
|
348
|
-
<Text style={{ ..._style?.errorTextFont, color: _style?.errorTextColor }}>
|
|
348
|
+
<Text style={{ ..._style?.errorTextFont, color: _style?.errorTextColor } as TextStyle}>
|
|
349
349
|
{errorStateText || localize("SOMETHING_WRONG")}
|
|
350
350
|
</Text>
|
|
351
351
|
</View>
|
|
@@ -358,17 +358,17 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
358
358
|
else
|
|
359
359
|
return (
|
|
360
360
|
<View style={Style.listContainer}>
|
|
361
|
-
<Text style={{ ..._style.emptyTextFont, color: _style.emptyTextColor }}>
|
|
361
|
+
<Text style={{ ..._style.emptyTextFont, color: _style.emptyTextColor } as TextStyle}>
|
|
362
362
|
{emptyStateText || localize("NO_CHATS_FOUND")}
|
|
363
363
|
</Text>
|
|
364
364
|
</View>
|
|
365
365
|
)
|
|
366
366
|
}
|
|
367
367
|
|
|
368
|
-
const userEventHandler = (...args) => {
|
|
368
|
+
const userEventHandler = (...args: any[]) => {
|
|
369
369
|
const { uid, blockedByMe, status } = args[0];
|
|
370
370
|
if (!blockedByMe) {
|
|
371
|
-
let item: CometChat.Conversation = conversationListRef.current
|
|
371
|
+
let item: CometChat.Conversation | any = conversationListRef.current?.getListItem(`${uid}_user_${loggedInUser.current?.uid}`) || conversationListRef.current?.getListItem(`${loggedInUser.current?.uid}_user_${uid}`);
|
|
372
372
|
if (item) {
|
|
373
373
|
let updatedConversation = CommonUtils.clone(item);
|
|
374
374
|
updatedConversation.setConversationWith(args[0]);
|
|
@@ -379,8 +379,8 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
379
379
|
|
|
380
380
|
|
|
381
381
|
const getConversationRefFromTypingIndicator = (typingIndicator: CometChat.TypingIndicator) => {
|
|
382
|
-
let list = conversationListRef.current
|
|
383
|
-
return list
|
|
382
|
+
let list = conversationListRef.current?.getAllListItems();
|
|
383
|
+
return list?.find((item: CometChat.Conversation) => {
|
|
384
384
|
return (
|
|
385
385
|
(typingIndicator.getReceiverType() == ReceiverTypeConstants.user &&
|
|
386
386
|
item.getConversationType() == ReceiverTypeConstants.user
|
|
@@ -395,19 +395,19 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
395
395
|
* Listener callback for typing event
|
|
396
396
|
* @param {...any} args
|
|
397
397
|
*/
|
|
398
|
-
const typingEventHandler = (...args) => {
|
|
398
|
+
const typingEventHandler = (...args: any[]) => {
|
|
399
399
|
let conversation: CometChat.Conversation = getConversationRefFromTypingIndicator(args[0]);
|
|
400
400
|
if (conversation) {
|
|
401
401
|
let isTyping = args[1];
|
|
402
402
|
let newConversation = conversation
|
|
403
403
|
if (isTyping && !newConversation?.['lastMessage']?.["typing"]) {
|
|
404
404
|
newConversation['lastMessage']["typing"] = args[0]?.receiverType === 'group' ?
|
|
405
|
-
`${args[0].sender.name} ${localize("IS_TYPING")}` :
|
|
405
|
+
`${args[0].sender.name.trim()} ${localize("IS_TYPING")}` :
|
|
406
406
|
localize("IS_TYPING");
|
|
407
407
|
} else {
|
|
408
408
|
delete newConversation['lastMessage']['typing'];
|
|
409
409
|
}
|
|
410
|
-
conversationListRef.current
|
|
410
|
+
conversationListRef.current?.updateList(newConversation);
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
}
|
|
@@ -420,12 +420,12 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
420
420
|
*/
|
|
421
421
|
const checkAndUpdateLastMessage = (newMessage: CometChat.BaseMessage) => {
|
|
422
422
|
CometChat.CometChatHelper.getConversationFromMessage(newMessage)
|
|
423
|
-
.then(conversation => {
|
|
424
|
-
let conver: any = conversationListRef.current
|
|
423
|
+
.then((conversation: any) => {
|
|
424
|
+
let conver: any = conversationListRef.current?.getListItem(conversation.getConversationId())
|
|
425
425
|
if (!conver) return;
|
|
426
426
|
let lastMessageId = conver['lastMessage']['id']
|
|
427
427
|
if (lastMessageId == newMessage['id']) {
|
|
428
|
-
conversationListRef.current
|
|
428
|
+
conversationListRef.current?.updateList(conversation)
|
|
429
429
|
}
|
|
430
430
|
})
|
|
431
431
|
|
|
@@ -484,27 +484,27 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
484
484
|
const updateLastMessage = (newMessage: CometChat.BaseMessage) => {
|
|
485
485
|
|
|
486
486
|
CometChat.CometChatHelper.getConversationFromMessage(newMessage)
|
|
487
|
-
.then(conversation => {
|
|
487
|
+
.then((conversation: any) => {
|
|
488
488
|
if (newMessage.getCategory() === MessageCategoryConstants.interactive) {
|
|
489
489
|
newMessage = InteractiveMessageUtils.convertInteractiveMessage(newMessage);
|
|
490
490
|
}
|
|
491
|
-
const oldConversation: CometChat.Conversation = conversationListRef.current
|
|
491
|
+
const oldConversation: CometChat.Conversation | any = conversationListRef.current?.getListItem(conversation['conversationId']);
|
|
492
492
|
if (oldConversation == undefined) {
|
|
493
493
|
CometChat.CometChatHelper.getConversationFromMessage(newMessage)
|
|
494
|
-
.then(newConversation => {
|
|
494
|
+
.then((newConversation: any) => {
|
|
495
495
|
if (newConversation?.lastMessage?.sender?.uid !== loggedInUser.current?.['uid'])
|
|
496
496
|
newConversation.setUnreadMessageCount(1);
|
|
497
|
-
conversationListRef.current
|
|
497
|
+
conversationListRef.current?.updateAndMoveToFirst(newConversation);
|
|
498
498
|
})
|
|
499
|
-
.catch(err => onError && onError(err))
|
|
499
|
+
.catch((err: any) => onError && onError(err))
|
|
500
500
|
return;
|
|
501
501
|
}
|
|
502
502
|
oldConversation['lastMessage'] = newMessage;
|
|
503
|
-
if (newMessage['sender']['uid'] != loggedInUser.current?.['uid'])
|
|
503
|
+
if ((newMessage as any)['sender']['uid'] != loggedInUser.current?.['uid'])
|
|
504
504
|
oldConversation.setUnreadMessageCount(oldConversation.getUnreadMessageCount() + 1);
|
|
505
|
-
conversationListRef.current
|
|
505
|
+
conversationListRef.current?.updateAndMoveToFirst(oldConversation);
|
|
506
506
|
})
|
|
507
|
-
.catch(err => {
|
|
507
|
+
.catch((err: any) => {
|
|
508
508
|
console.log("Error", err);
|
|
509
509
|
})
|
|
510
510
|
}
|
|
@@ -527,7 +527,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
527
527
|
/**
|
|
528
528
|
* marking the incoming messages as delivered
|
|
529
529
|
*/
|
|
530
|
-
const markMessageAsDelivered = (message) => {
|
|
530
|
+
const markMessageAsDelivered = (message: object) => {
|
|
531
531
|
if (message.hasOwnProperty('deletedAt')) return;
|
|
532
532
|
|
|
533
533
|
if (shouldMarkAsDelivered(message)) {
|
|
@@ -536,25 +536,51 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
|
|
539
|
-
const updateMessageReceipt = (receipt) => {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
conversationListRef.current.
|
|
539
|
+
const updateMessageReceipt = (receipt: CometChat.MessageReceipt) => {
|
|
540
|
+
const conv: CometChat.Conversation =
|
|
541
|
+
receipt?.getReceiverType() === ReceiverTypeConstants.user
|
|
542
|
+
? conversationListRef.current.getListItem(
|
|
543
|
+
`${receipt?.getReceiver()}_user_${receipt?.getSender().getUid()}`
|
|
544
|
+
) ||
|
|
545
|
+
conversationListRef.current.getListItem(
|
|
546
|
+
`${receipt?.getSender()?.getUid()}_user_${receipt?.getReceiver()}`
|
|
547
|
+
)
|
|
548
|
+
: [receipt.RECEIPT_TYPE.DELIVERED_TO_ALL_RECEIPT, receipt.RECEIPT_TYPE.READ_BY_ALL_RECEIPT].includes(receipt?.getReceiptType()) &&
|
|
549
|
+
conversationListRef.current.getListItem(
|
|
550
|
+
`group_${receipt?.getReceiver()}`
|
|
551
|
+
);
|
|
552
|
+
|
|
553
|
+
if (
|
|
554
|
+
conv &&
|
|
555
|
+
conv.getConversationType() == ConversationTypeConstants.group &&
|
|
556
|
+
conv.getLastMessage().getSender().getUid() !== loggedInUser.current.getUid()
|
|
557
|
+
) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
if (
|
|
562
|
+
conv &&
|
|
563
|
+
conv?.getLastMessage &&
|
|
564
|
+
(conv.getLastMessage().id == receipt['messageId'] ||
|
|
565
|
+
conv.getLastMessage().messageId == receipt['messageId'])
|
|
566
|
+
) {
|
|
567
|
+
let newConversation = CommonUtils.clone(conv);
|
|
568
|
+
if (receipt['readAt']) {
|
|
569
|
+
newConversation.getLastMessage().setReadAt(receipt['readAt']);
|
|
550
570
|
}
|
|
551
|
-
|
|
571
|
+
if (receipt['deliveredAt']) {
|
|
572
|
+
newConversation.getLastMessage().setDeliveredAt(receipt['deliveredAt']);
|
|
573
|
+
}
|
|
574
|
+
conversationListRef.current.updateList(newConversation);
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
|
|
552
578
|
|
|
553
579
|
/**
|
|
554
580
|
*
|
|
555
581
|
* When a text message / media message / custom message is received
|
|
556
582
|
*/
|
|
557
|
-
const messageEventHandler = (...args) => {
|
|
583
|
+
const messageEventHandler = (...args: any[]) => {
|
|
558
584
|
let message = args[0];
|
|
559
585
|
!disableReadReceipt && markMessageAsDelivered(message);
|
|
560
586
|
updateLastMessage(message);
|
|
@@ -564,34 +590,34 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
564
590
|
* callback handler for group Add / Kicked / Banned / Scope Change
|
|
565
591
|
* @param {obj} message
|
|
566
592
|
*/
|
|
567
|
-
const groupHandler = (message, otherDetails: {
|
|
568
|
-
let conversation: CometChat.Conversation = (conversationListRef.current
|
|
569
|
-
let {
|
|
570
|
-
|
|
571
|
-
if ((["kicked", "banned", "left"].includes(action)) && (actionOn
|
|
572
|
-
conversationListRef.current
|
|
593
|
+
const groupHandler = (message: any, otherDetails: {action?: string, actionOn?: CometChat.User, actionBy?: CometChat.User, group?: CometChat.Group} = {}) => {
|
|
594
|
+
let conversation : CometChat.Conversation = (conversationListRef.current?.getListItem(message['conversationId']) as unknown as CometChat.Conversation);
|
|
595
|
+
let {action, actionOn, actionBy, group} = otherDetails;
|
|
596
|
+
if (conversation) {
|
|
597
|
+
if ((action && ["kicked", "banned", "left"].includes(action)) && (actionOn?.getUid() == loggedInUser.current?.getUid())){
|
|
598
|
+
conversationListRef.current?.removeItemFromList(message.conversationId);
|
|
573
599
|
return;
|
|
574
600
|
} else {
|
|
575
601
|
if (!CometChatUIKit.getConversationUpdateSettings().shouldUpdateOnGroupActions()) {
|
|
576
602
|
return;
|
|
577
603
|
}
|
|
578
604
|
conversation.setLastMessage(message);
|
|
579
|
-
conversationListRef.current
|
|
605
|
+
conversationListRef.current?.updateList(conversation);
|
|
580
606
|
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
607
|
+
} else {
|
|
608
|
+
CometChat.CometChatHelper.getConversationFromMessage(message)
|
|
609
|
+
.then((newConversation: any) => {
|
|
610
|
+
const conversation : CometChat.Conversation = (conversationListRef.current?.getListItem(message['conversationId']) as unknown as CometChat.Conversation);
|
|
611
|
+
if (conversation) {
|
|
612
|
+
groupHandler(message);
|
|
613
|
+
} else {
|
|
614
|
+
conversationListRef.current?.addItemToList(newConversation, 0);
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
}
|
|
592
618
|
}
|
|
593
619
|
|
|
594
|
-
const conversationClicked = (conversation) => {
|
|
620
|
+
const conversationClicked = (conversation: any) => {
|
|
595
621
|
if (onItemPress) {
|
|
596
622
|
onItemPress(conversation);
|
|
597
623
|
return;
|
|
@@ -603,7 +629,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
603
629
|
|
|
604
630
|
if (selectionMode == "none") return;
|
|
605
631
|
|
|
606
|
-
let index = selectedConversation.findIndex(tmpConver => tmpConver.conversationWith.conversationId == conversation.conversationWith.conversationId);
|
|
632
|
+
let index = selectedConversation.findIndex((tmpConver: any) => tmpConver.conversationWith.conversationId == conversation.conversationWith.conversationId);
|
|
607
633
|
if (index < 0) {
|
|
608
634
|
if (selectionMode == "single")
|
|
609
635
|
setSelectedConversations([conversation])
|
|
@@ -616,7 +642,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
616
642
|
}
|
|
617
643
|
}
|
|
618
644
|
|
|
619
|
-
const conversationLongPressed = (conversation) => {
|
|
645
|
+
const conversationLongPressed = (conversation: any) => {
|
|
620
646
|
if (onItemLongPress) {
|
|
621
647
|
onItemLongPress(conversation);
|
|
622
648
|
return;
|
|
@@ -628,7 +654,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
628
654
|
setSelectedConversations([...selectedConversation, conversation]);
|
|
629
655
|
}
|
|
630
656
|
|
|
631
|
-
const removeItemFromSelectionList = (id) => {
|
|
657
|
+
const removeItemFromSelectionList = (id: any) => {
|
|
632
658
|
if (selecting) {
|
|
633
659
|
let index = selectedConversation.find(member => member['uid'] == id);
|
|
634
660
|
if (index > -1) {
|
|
@@ -639,19 +665,19 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
639
665
|
}
|
|
640
666
|
}
|
|
641
667
|
|
|
642
|
-
const removeConversation = (id) => {
|
|
643
|
-
let conversation = conversationListRef.current
|
|
668
|
+
const removeConversation = (id: string | number) => {
|
|
669
|
+
let conversation: any = conversationListRef.current?.getListItem(id);
|
|
644
670
|
const { conversationWith, conversationType } = conversation;
|
|
645
671
|
let conversationWithId = conversationType == "group" ? conversationWith.guid : conversationWith.uid;
|
|
646
672
|
CometChat.deleteConversation(conversationWithId, conversationType)
|
|
647
|
-
.then(success => {
|
|
648
|
-
conversationListRef.current
|
|
673
|
+
.then((success: any) => {
|
|
674
|
+
conversationListRef.current?.removeItemFromList(id);
|
|
649
675
|
removeItemFromSelectionList(id);
|
|
650
676
|
})
|
|
651
|
-
.catch(err => console.log(err))
|
|
677
|
+
.catch((err: any) => console.log(err))
|
|
652
678
|
}
|
|
653
679
|
|
|
654
|
-
const getMessagePreview = (conversations: CometChat.Conversation, uid) => {
|
|
680
|
+
const getMessagePreview = (conversations: CometChat.Conversation, uid: any) => {
|
|
655
681
|
|
|
656
682
|
let lastMessage: CometChat.BaseMessage = conversations?.getLastMessage && conversations.getLastMessage();
|
|
657
683
|
if (!lastMessage) return null;
|
|
@@ -670,7 +696,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
670
696
|
if (lastMessage.getSender().getUid() == uid) {
|
|
671
697
|
groupText = localize("YOU") + ": "
|
|
672
698
|
} else {
|
|
673
|
-
groupText = lastMessage.getSender()
|
|
699
|
+
groupText = (lastMessage.getSender()?.getName() || "").trim() + ": ";
|
|
674
700
|
}
|
|
675
701
|
}
|
|
676
702
|
|
|
@@ -678,7 +704,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
678
704
|
<Text numberOfLines={1} ellipsizeMode={"tail"} style={[Style.subtitleTextStyle, {
|
|
679
705
|
color: theme.palette.getAccent600(), fontSize: theme.typography.subtitle1.fontSize,
|
|
680
706
|
fontWeight: theme.typography.subtitle1.fontWeight
|
|
681
|
-
}]}>
|
|
707
|
+
}] as TextStyle}>
|
|
682
708
|
{groupText}{messageText}
|
|
683
709
|
</Text>
|
|
684
710
|
)
|
|
@@ -690,17 +716,17 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
690
716
|
|
|
691
717
|
if (!disableMentions && message.getMentionedUsers().length) {
|
|
692
718
|
let mentionsFormatter = ChatConfigurator.getDataSource().getMentionsFormatter();
|
|
693
|
-
mentionsFormatter.setLoggedInUser(CometChatUIKit.loggedInUser);
|
|
719
|
+
CometChatUIKit.loggedInUser && mentionsFormatter.setLoggedInUser(CometChatUIKit.loggedInUser);
|
|
694
720
|
mentionsFormatter.setMentionsStyle(
|
|
695
721
|
new MentionTextStyle({
|
|
696
722
|
loggedInUserTextStyle: {
|
|
697
723
|
color: theme.palette.getPrimary(),
|
|
698
724
|
...theme.typography.title2,
|
|
699
|
-
},
|
|
725
|
+
} as TextStyle,
|
|
700
726
|
textStyle: {
|
|
701
727
|
color: theme.palette.getPrimary(),
|
|
702
728
|
...theme.typography.subtitle1,
|
|
703
|
-
}
|
|
729
|
+
} as TextStyle
|
|
704
730
|
})
|
|
705
731
|
);
|
|
706
732
|
|
|
@@ -733,7 +759,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
733
759
|
<Text numberOfLines={1} ellipsizeMode={"tail"} style={[Style.subtitleTextStyle, {
|
|
734
760
|
color: theme.palette.getPrimary(),
|
|
735
761
|
fontSize: theme.typography.subtitle1.fontSize, fontWeight: theme.typography.subtitle1.fontWeight
|
|
736
|
-
}]} >{params.typingText}</Text>
|
|
762
|
+
}] as TextStyle} >{params.typingText}</Text>
|
|
737
763
|
</View>
|
|
738
764
|
}
|
|
739
765
|
|
|
@@ -813,34 +839,34 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
813
839
|
/>
|
|
814
840
|
}
|
|
815
841
|
|
|
816
|
-
const getDefaultOptions = (conversation) => {
|
|
842
|
+
const getDefaultOptions = (conversation: any) => {
|
|
817
843
|
let _defaultOptions = CometChatConversationUtils.getDefaultOptions();
|
|
818
844
|
_defaultOptions[0].backgroundColor = theme?.palette.getError();
|
|
819
845
|
_defaultOptions[0].icon = deleteIcon;
|
|
820
846
|
_defaultOptions[0].title = localize("DELETE");
|
|
821
847
|
_defaultOptions[0].titleStyle = { fontSize: 14, color: theme?.palette.getSecondary() };
|
|
822
848
|
_defaultOptions[0].iconTint = theme?.palette.getSecondary();
|
|
823
|
-
_defaultOptions[0].onPress = (id) => {
|
|
849
|
+
_defaultOptions[0].onPress = (id: any) => {
|
|
824
850
|
setConfirmDelete(id);
|
|
825
851
|
};
|
|
826
852
|
return _defaultOptions
|
|
827
853
|
}
|
|
828
854
|
|
|
829
|
-
const updateConversationLastMessage = (message) => {
|
|
830
|
-
if
|
|
855
|
+
const updateConversationLastMessage = (message: any) => {
|
|
856
|
+
if(!CometChatUIKit.getConversationUpdateSettings().shouldUpdateOnGroupActions()) {
|
|
831
857
|
return;
|
|
832
858
|
}
|
|
833
859
|
try {
|
|
834
|
-
let conversation: CometChat.Conversation = conversationListRef.current?.getListItem(message.conversationId)
|
|
860
|
+
let conversation: CometChat.Conversation | any = conversationListRef.current?.getListItem(message.conversationId)
|
|
835
861
|
conversation.lastMessage = message
|
|
836
862
|
conversationListRef.current?.updateAndMoveToFirst(conversation);
|
|
837
|
-
} catch (error) {
|
|
863
|
+
} catch (error: any) {
|
|
838
864
|
onError && onError(error)
|
|
839
865
|
}
|
|
840
866
|
}
|
|
841
867
|
|
|
842
868
|
const updateUnreadMessageCount = (conversation: CometChat.Conversation) => {
|
|
843
|
-
const oldConversation: CometChat.Conversation = (conversationListRef.current
|
|
869
|
+
const oldConversation: CometChat.Conversation = (conversationListRef.current?.getListItem(conversation['conversationId']) as unknown as CometChat.Conversation);
|
|
844
870
|
if (oldConversation == undefined) {
|
|
845
871
|
conversation.setUnreadMessageCount(1);
|
|
846
872
|
return conversation;
|
|
@@ -851,8 +877,8 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
851
877
|
|
|
852
878
|
React.useEffect(() => {
|
|
853
879
|
CometChat.getLoggedinUser()
|
|
854
|
-
.then(u => { loggedInUser.current = u })
|
|
855
|
-
.catch(err => console.log(err));
|
|
880
|
+
.then((u: any) => { loggedInUser.current = u })
|
|
881
|
+
.catch((err: any) => console.log(err));
|
|
856
882
|
|
|
857
883
|
CometChat.addUserListener(
|
|
858
884
|
userListenerId,
|
|
@@ -871,59 +897,59 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
871
897
|
CometChat.addCallListener(
|
|
872
898
|
callListenerId,
|
|
873
899
|
new CometChat.CallListener({
|
|
874
|
-
onIncomingCallReceived: (call) => {
|
|
900
|
+
onIncomingCallReceived: (call: any) => {
|
|
875
901
|
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
876
|
-
.then((conversation) => {
|
|
877
|
-
if
|
|
902
|
+
.then((conversation: any) => {
|
|
903
|
+
if(!CometChatUIKit.getConversationUpdateSettings().shouldUpdateOnCallActivities()) {
|
|
878
904
|
return;
|
|
879
905
|
}
|
|
880
906
|
conversation = updateUnreadMessageCount(conversation);
|
|
881
907
|
conversation.setLastMessage(call);
|
|
882
|
-
conversationListRef.current
|
|
908
|
+
conversationListRef.current?.updateList(conversation);
|
|
883
909
|
})
|
|
884
|
-
.catch((e) => {
|
|
910
|
+
.catch((e: any) => {
|
|
885
911
|
onError && onError(e);
|
|
886
912
|
})
|
|
887
913
|
},
|
|
888
|
-
onOutgoingCallAccepted: (call) => {
|
|
914
|
+
onOutgoingCallAccepted: (call: any) => {
|
|
889
915
|
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
890
|
-
.then((conversation) => {
|
|
891
|
-
if
|
|
916
|
+
.then((conversation: any) => {
|
|
917
|
+
if(!CometChatUIKit.getConversationUpdateSettings().shouldUpdateOnCallActivities()) {
|
|
892
918
|
return;
|
|
893
919
|
}
|
|
894
920
|
conversation = updateUnreadMessageCount(conversation);
|
|
895
921
|
conversation.setLastMessage(call);
|
|
896
|
-
conversationListRef.current
|
|
922
|
+
conversationListRef.current?.updateList(conversation);
|
|
897
923
|
})
|
|
898
|
-
.catch((e) => {
|
|
924
|
+
.catch((e: any) => {
|
|
899
925
|
onError && onError(e);
|
|
900
926
|
})
|
|
901
927
|
},
|
|
902
|
-
onOutgoingCallRejected: (call) => {
|
|
928
|
+
onOutgoingCallRejected: (call: any) => {
|
|
903
929
|
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
904
|
-
.then((conversation) => {
|
|
905
|
-
if
|
|
930
|
+
.then((conversation: any) => {
|
|
931
|
+
if(!CometChatUIKit.getConversationUpdateSettings().shouldUpdateOnCallActivities()) {
|
|
906
932
|
return;
|
|
907
933
|
}
|
|
908
934
|
conversation = updateUnreadMessageCount(conversation);
|
|
909
935
|
conversation.setLastMessage(call);
|
|
910
|
-
conversationListRef.current
|
|
936
|
+
conversationListRef.current?.updateList(conversation);
|
|
911
937
|
})
|
|
912
|
-
.catch((e) => {
|
|
938
|
+
.catch((e: any) => {
|
|
913
939
|
onError && onError(e);
|
|
914
940
|
})
|
|
915
941
|
},
|
|
916
|
-
onIncomingCallCancelled: (call) => {
|
|
942
|
+
onIncomingCallCancelled: (call: any) => {
|
|
917
943
|
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
918
|
-
.then((conversation) => {
|
|
919
|
-
if
|
|
944
|
+
.then((conversation: any) => {
|
|
945
|
+
if(!CometChatUIKit.getConversationUpdateSettings().shouldUpdateOnCallActivities()) {
|
|
920
946
|
return;
|
|
921
947
|
}
|
|
922
948
|
conversation = updateUnreadMessageCount(conversation);
|
|
923
949
|
conversation.setLastMessage(call);
|
|
924
|
-
conversationListRef.current
|
|
950
|
+
conversationListRef.current?.updateList(conversation);
|
|
925
951
|
})
|
|
926
|
-
.catch((e) => {
|
|
952
|
+
.catch((e: any) => {
|
|
927
953
|
onError && onError(e);
|
|
928
954
|
})
|
|
929
955
|
}
|
|
@@ -933,7 +959,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
933
959
|
CometChat.addGroupListener(
|
|
934
960
|
groupListenerId,
|
|
935
961
|
new CometChat.GroupListener({
|
|
936
|
-
onGroupMemberScopeChanged: (message) => {
|
|
962
|
+
onGroupMemberScopeChanged: (message: any) => {
|
|
937
963
|
groupHandler(
|
|
938
964
|
message
|
|
939
965
|
);
|
|
@@ -953,7 +979,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
953
979
|
{ action: 'left', actionOn: leavingUser, group }
|
|
954
980
|
);
|
|
955
981
|
},
|
|
956
|
-
onGroupMemberUnbanned: (message) => {
|
|
982
|
+
onGroupMemberUnbanned: (message: any) => {
|
|
957
983
|
groupHandler(message);
|
|
958
984
|
},
|
|
959
985
|
onGroupMemberBanned: (
|
|
@@ -981,7 +1007,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
981
1007
|
);
|
|
982
1008
|
}, 50)
|
|
983
1009
|
},
|
|
984
|
-
onGroupMemberJoined: (message) => {
|
|
1010
|
+
onGroupMemberJoined: (message: any) => {
|
|
985
1011
|
groupHandler(
|
|
986
1012
|
message
|
|
987
1013
|
);
|
|
@@ -993,13 +1019,13 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
993
1019
|
conversationListenerId,
|
|
994
1020
|
{
|
|
995
1021
|
ccConversationDeleted:
|
|
996
|
-
({ conversation }: { conversation: CometChat.Conversation }) => {
|
|
1022
|
+
({ conversation }: { conversation: CometChat.Conversation | any }) => {
|
|
997
1023
|
CometChat.deleteConversation(conversation.getConversationId(), conversation.getConversationType())
|
|
998
|
-
.then(res => {
|
|
999
|
-
conversationListRef.current
|
|
1024
|
+
.then((res: any) => {
|
|
1025
|
+
conversationListRef.current?.removeItemFromList(conversation);
|
|
1000
1026
|
removeItemFromSelectionList(conversation.getConversationId())
|
|
1001
1027
|
})
|
|
1002
|
-
.catch(err => {
|
|
1028
|
+
.catch((err: any) => {
|
|
1003
1029
|
console.log("Error", err);
|
|
1004
1030
|
});
|
|
1005
1031
|
}
|
|
@@ -1008,7 +1034,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
1008
1034
|
CometChatUIEventHandler.addMessageListener(
|
|
1009
1035
|
messageListenerId,
|
|
1010
1036
|
{
|
|
1011
|
-
ccMessageSent: ({ message, status }) => {
|
|
1037
|
+
ccMessageSent: ({ message, status }: any) => {
|
|
1012
1038
|
if (status == MessageStatusConstants.success) {
|
|
1013
1039
|
if (!shouldUpdateLastMessageAndUnreadCount(message)) {
|
|
1014
1040
|
return;
|
|
@@ -1016,77 +1042,83 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
1016
1042
|
updateLastMessage(message);
|
|
1017
1043
|
}
|
|
1018
1044
|
},
|
|
1019
|
-
ccMessageRead: ({ message }) => {
|
|
1045
|
+
ccMessageRead: ({ message }: any) => {
|
|
1020
1046
|
checkAndUpdateLastMessage(message)
|
|
1021
1047
|
},
|
|
1022
|
-
ccMessageDeleted: ({ message }) => {
|
|
1048
|
+
ccMessageDeleted: ({ message }: any) => {
|
|
1023
1049
|
checkAndUpdateLastMessage(message)
|
|
1024
1050
|
},
|
|
1025
|
-
ccMessageEdited: ({ message }) => {
|
|
1051
|
+
ccMessageEdited: ({ message }: any) => {
|
|
1026
1052
|
checkAndUpdateLastMessage(message)
|
|
1027
1053
|
},
|
|
1028
|
-
onTextMessageReceived: (textMessage) => {
|
|
1029
|
-
if
|
|
1054
|
+
onTextMessageReceived: (textMessage: any) => {
|
|
1055
|
+
if(!shouldUpdateLastMessageAndUnreadCount(textMessage)) {
|
|
1030
1056
|
return;
|
|
1031
1057
|
}
|
|
1032
1058
|
messageEventHandler(textMessage);
|
|
1033
1059
|
!disableSoundForMessages && CometChatSoundManager.play("incomingMessage");
|
|
1034
1060
|
},
|
|
1035
|
-
onMediaMessageReceived: (mediaMessage) => {
|
|
1036
|
-
if
|
|
1061
|
+
onMediaMessageReceived: (mediaMessage: any) => {
|
|
1062
|
+
if(!shouldUpdateLastMessageAndUnreadCount(mediaMessage)) {
|
|
1037
1063
|
return;
|
|
1038
1064
|
}
|
|
1039
1065
|
messageEventHandler(mediaMessage);
|
|
1040
1066
|
!disableSoundForMessages && CometChatSoundManager.play("incomingMessage");
|
|
1041
1067
|
},
|
|
1042
|
-
onCustomMessageReceived: (customMessage) => {
|
|
1043
|
-
if
|
|
1068
|
+
onCustomMessageReceived: (customMessage: any) => {
|
|
1069
|
+
if(!shouldUpdateLastMessageAndUnreadCount(customMessage)) {
|
|
1044
1070
|
return;
|
|
1045
1071
|
}
|
|
1046
1072
|
messageEventHandler(customMessage);
|
|
1047
1073
|
!disableSoundForMessages && CometChatSoundManager.play("incomingMessage");
|
|
1048
1074
|
},
|
|
1049
|
-
onMessageDeleted: (deletedMessage) => {
|
|
1075
|
+
onMessageDeleted: (deletedMessage: any) => {
|
|
1050
1076
|
checkAndUpdateLastMessage(deletedMessage)
|
|
1051
1077
|
},
|
|
1052
|
-
onMessageEdited: (editedMessage) => {
|
|
1078
|
+
onMessageEdited: (editedMessage: any) => {
|
|
1053
1079
|
checkAndUpdateLastMessage(editedMessage)
|
|
1054
1080
|
},
|
|
1055
|
-
onMessagesRead: (messageReceipt) => {
|
|
1056
|
-
|
|
1081
|
+
onMessagesRead: (messageReceipt: any) => {
|
|
1082
|
+
messageEventHandler(messageReceipt);
|
|
1057
1083
|
},
|
|
1058
|
-
onMessagesDelivered: (messageReceipt) => {
|
|
1059
|
-
|
|
1084
|
+
onMessagesDelivered: (messageReceipt: any) => {
|
|
1085
|
+
messageEventHandler(messageReceipt);
|
|
1060
1086
|
},
|
|
1061
|
-
|
|
1087
|
+
onMessagesDeliveredToAll: (messageReceipt: CometChat.MessageReceipt) => {
|
|
1088
|
+
updateMessageReceipt(messageReceipt);
|
|
1089
|
+
},
|
|
1090
|
+
onMessagesReadByAll: (messageReceipt: CometChat.MessageReceipt) => {
|
|
1091
|
+
updateMessageReceipt(messageReceipt);
|
|
1092
|
+
},
|
|
1093
|
+
onTypingStarted: (typingIndicator: any) => {
|
|
1062
1094
|
typingEventHandler(typingIndicator, true);
|
|
1063
1095
|
},
|
|
1064
|
-
onTypingEnded: (typingIndicator) => {
|
|
1096
|
+
onTypingEnded: (typingIndicator: any) => {
|
|
1065
1097
|
typingEventHandler(typingIndicator, false);
|
|
1066
1098
|
},
|
|
1067
|
-
onFormMessageReceived: (formMessage) => {
|
|
1068
|
-
if
|
|
1099
|
+
onFormMessageReceived: (formMessage: any) => {
|
|
1100
|
+
if(!shouldUpdateLastMessageAndUnreadCount(formMessage)) {
|
|
1069
1101
|
return;
|
|
1070
1102
|
}
|
|
1071
1103
|
messageEventHandler(formMessage);
|
|
1072
1104
|
!disableSoundForMessages && CometChatSoundManager.play("incomingMessage");
|
|
1073
1105
|
},
|
|
1074
|
-
onCardMessageReceived: (cardMessage) => {
|
|
1075
|
-
if
|
|
1106
|
+
onCardMessageReceived: (cardMessage: any) => {
|
|
1107
|
+
if(!shouldUpdateLastMessageAndUnreadCount(cardMessage)) {
|
|
1076
1108
|
return;
|
|
1077
1109
|
}
|
|
1078
1110
|
messageEventHandler(cardMessage);
|
|
1079
1111
|
!disableSoundForMessages && CometChatSoundManager.play("incomingMessage");
|
|
1080
1112
|
},
|
|
1081
|
-
onSchedulerMessageReceived: (schedulerMessage) => {
|
|
1082
|
-
if
|
|
1113
|
+
onSchedulerMessageReceived: (schedulerMessage: any) => {
|
|
1114
|
+
if(!shouldUpdateLastMessageAndUnreadCount(schedulerMessage)) {
|
|
1083
1115
|
return;
|
|
1084
1116
|
}
|
|
1085
1117
|
messageEventHandler(schedulerMessage);
|
|
1086
1118
|
!disableSoundForMessages && CometChatSoundManager.play("incomingMessage");
|
|
1087
1119
|
},
|
|
1088
|
-
onCustomInteractiveMessageReceived: (customInteractiveMessage) => {
|
|
1089
|
-
if
|
|
1120
|
+
onCustomInteractiveMessageReceived: (customInteractiveMessage: any) => {
|
|
1121
|
+
if(!shouldUpdateLastMessageAndUnreadCount(customInteractiveMessage)) {
|
|
1090
1122
|
return;
|
|
1091
1123
|
}
|
|
1092
1124
|
messageEventHandler(customInteractiveMessage);
|
|
@@ -1097,18 +1129,18 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
1097
1129
|
CometChatUIEventHandler.addGroupListener(
|
|
1098
1130
|
groupListenerId,
|
|
1099
1131
|
{
|
|
1100
|
-
ccGroupCreated: ({ group }) => {
|
|
1132
|
+
ccGroupCreated: ({ group }: any) => {
|
|
1101
1133
|
CometChat.getConversation(group.getGuid(), CometChatUiKitConstants.ConversationTypeConstants.group).then(
|
|
1102
|
-
conversation => {
|
|
1134
|
+
(conversation: any) => {
|
|
1103
1135
|
conversationListRef.current?.addItemToList(conversation, 0);
|
|
1104
1136
|
}
|
|
1105
1137
|
)
|
|
1106
1138
|
},
|
|
1107
|
-
ccGroupDeleted: ({ group }) => {
|
|
1139
|
+
ccGroupDeleted: ({ group }: any) => {
|
|
1108
1140
|
conversationListRef.current?.removeItemFromList(group['conversationId']);
|
|
1109
1141
|
removeItemFromSelectionList(group['conversationId'])
|
|
1110
1142
|
},
|
|
1111
|
-
ccGroupLeft: ({ leftGroup }) => {
|
|
1143
|
+
ccGroupLeft: ({ leftGroup }: any) => {
|
|
1112
1144
|
conversationListRef.current?.removeItemFromList(leftGroup['conversationId']);
|
|
1113
1145
|
removeItemFromSelectionList(leftGroup['conversationId'])
|
|
1114
1146
|
},
|
|
@@ -1118,27 +1150,27 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
1118
1150
|
}
|
|
1119
1151
|
updateConversationLastMessage(message)
|
|
1120
1152
|
},
|
|
1121
|
-
ccGroupMemberBanned: ({ message }) => {
|
|
1122
|
-
if
|
|
1153
|
+
ccGroupMemberBanned: ({ message }: any) => {
|
|
1154
|
+
if(!(shouldUpdateLastMessageAndUnreadCount(message))) {
|
|
1123
1155
|
return;
|
|
1124
1156
|
}
|
|
1125
1157
|
groupHandler(message);
|
|
1126
1158
|
},
|
|
1127
|
-
ccGroupMemberUnBanned: ({ message }) => {
|
|
1128
|
-
if
|
|
1159
|
+
ccGroupMemberUnBanned: ({ message }: any) => {
|
|
1160
|
+
if(!(shouldUpdateLastMessageAndUnreadCount(message))) {
|
|
1129
1161
|
return;
|
|
1130
1162
|
}
|
|
1131
1163
|
groupHandler(message)
|
|
1132
1164
|
},
|
|
1133
|
-
ccOwnershipChanged: ({ message }) => {
|
|
1134
|
-
if
|
|
1165
|
+
ccOwnershipChanged: ({ message }: any) => {
|
|
1166
|
+
if(!(shouldUpdateLastMessageAndUnreadCount(message))) {
|
|
1135
1167
|
return;
|
|
1136
1168
|
}
|
|
1137
1169
|
CometChat.CometChatHelper.getConversationFromMessage(message)
|
|
1138
|
-
.then(conversation => {
|
|
1170
|
+
.then((conversation: any) => {
|
|
1139
1171
|
conversationListRef.current?.updateList(conversation);
|
|
1140
1172
|
})
|
|
1141
|
-
.catch(e => {
|
|
1173
|
+
.catch((e: any) => {
|
|
1142
1174
|
onError && onError(e);
|
|
1143
1175
|
})
|
|
1144
1176
|
},
|
|
@@ -1151,7 +1183,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
1151
1183
|
CometChatUIEventHandler.addUserListener(
|
|
1152
1184
|
userListenerId,
|
|
1153
1185
|
{
|
|
1154
|
-
ccUserBlocked: ({ user }) => {
|
|
1186
|
+
ccUserBlocked: ({ user }: any) => {
|
|
1155
1187
|
conversationListRef?.current?.removeItemFromList(user['conversationId']);
|
|
1156
1188
|
removeItemFromSelectionList(user['conversationId']);
|
|
1157
1189
|
}
|
|
@@ -1161,55 +1193,55 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
1161
1193
|
CometChatUIEventHandler.addCallListener(
|
|
1162
1194
|
callListenerId,
|
|
1163
1195
|
{
|
|
1164
|
-
ccOutgoingCall: ({ call }) => {
|
|
1196
|
+
ccOutgoingCall: ({ call }: any) => {
|
|
1165
1197
|
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
1166
|
-
.then((conversation) => {
|
|
1167
|
-
if
|
|
1198
|
+
.then((conversation: any) => {
|
|
1199
|
+
if(!CometChatUIKit.getConversationUpdateSettings().shouldUpdateOnCallActivities()) {
|
|
1168
1200
|
return;
|
|
1169
1201
|
}
|
|
1170
1202
|
conversation = updateUnreadMessageCount(conversation);
|
|
1171
|
-
conversationListRef.current
|
|
1203
|
+
conversationListRef.current?.updateList(conversation);
|
|
1172
1204
|
})
|
|
1173
|
-
.catch((e) => {
|
|
1205
|
+
.catch((e: any) => {
|
|
1174
1206
|
onError && onError(e);
|
|
1175
1207
|
})
|
|
1176
1208
|
},
|
|
1177
|
-
ccCallAccepted: ({ call }) => {
|
|
1209
|
+
ccCallAccepted: ({ call }: any) => {
|
|
1178
1210
|
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
1179
|
-
.then((conversation) => {
|
|
1180
|
-
if
|
|
1211
|
+
.then((conversation: any) => {
|
|
1212
|
+
if(!CometChatUIKit.getConversationUpdateSettings().shouldUpdateOnCallActivities()) {
|
|
1181
1213
|
return;
|
|
1182
1214
|
}
|
|
1183
1215
|
conversation = updateUnreadMessageCount(conversation);
|
|
1184
|
-
conversationListRef.current
|
|
1216
|
+
conversationListRef.current?.updateList(conversation);
|
|
1185
1217
|
})
|
|
1186
|
-
.catch((e) => {
|
|
1218
|
+
.catch((e: any) => {
|
|
1187
1219
|
onError && onError(e);
|
|
1188
1220
|
})
|
|
1189
1221
|
},
|
|
1190
|
-
ccCallRejected: ({ call }) => {
|
|
1222
|
+
ccCallRejected: ({ call }: any) => {
|
|
1191
1223
|
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
1192
|
-
.then((conversation) => {
|
|
1193
|
-
if
|
|
1224
|
+
.then((conversation: any) => {
|
|
1225
|
+
if(!CometChatUIKit.getConversationUpdateSettings().shouldUpdateOnCallActivities()) {
|
|
1194
1226
|
return;
|
|
1195
1227
|
}
|
|
1196
1228
|
conversation = updateUnreadMessageCount(conversation);
|
|
1197
|
-
conversationListRef.current
|
|
1229
|
+
conversationListRef.current?.updateList(conversation);
|
|
1198
1230
|
})
|
|
1199
|
-
.catch((e) => {
|
|
1231
|
+
.catch((e: any) => {
|
|
1200
1232
|
onError && onError(e);
|
|
1201
1233
|
})
|
|
1202
1234
|
},
|
|
1203
|
-
ccCallEnded: ({ call }) => {
|
|
1235
|
+
ccCallEnded: ({ call }: any) => {
|
|
1204
1236
|
CometChat.CometChatHelper.getConversationFromMessage(call)
|
|
1205
|
-
.then((conversation) => {
|
|
1206
|
-
if
|
|
1237
|
+
.then((conversation: any) => {
|
|
1238
|
+
if(!CometChatUIKit.getConversationUpdateSettings().shouldUpdateOnCallActivities()) {
|
|
1207
1239
|
return;
|
|
1208
1240
|
}
|
|
1209
1241
|
conversation = updateUnreadMessageCount(conversation);
|
|
1210
|
-
conversationListRef.current
|
|
1242
|
+
conversationListRef.current?.updateList(conversation);
|
|
1211
1243
|
})
|
|
1212
|
-
.catch((e) => {
|
|
1244
|
+
.catch((e: any) => {
|
|
1213
1245
|
onError && onError(e);
|
|
1214
1246
|
})
|
|
1215
1247
|
}
|
|
@@ -1227,7 +1259,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
1227
1259
|
}
|
|
1228
1260
|
}, []);
|
|
1229
1261
|
|
|
1230
|
-
const ConversationItemView = ({ item: conversation }) => {
|
|
1262
|
+
const ConversationItemView = ({ item: conversation }: any) => {
|
|
1231
1263
|
if (!conversation) return null;
|
|
1232
1264
|
//custom view check
|
|
1233
1265
|
if (ListItemView)
|
|
@@ -1235,7 +1267,7 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
1235
1267
|
const { conversationWith, conversationType } = conversation;
|
|
1236
1268
|
const lastMessage = CometChatConversationUtils.getLastMessage(conversation);
|
|
1237
1269
|
const { name, type, conversationId } = conversationWith || {};
|
|
1238
|
-
let image
|
|
1270
|
+
let image!: ImageType, backgroundColor!: string, avatarIcon = conversationWith[conversationType == "group" ? 'icon' : "avatar"];
|
|
1239
1271
|
if (type == GroupTypeConstants.password) {
|
|
1240
1272
|
image = props?.protectedGroupIcon || passwordGroupIcon;
|
|
1241
1273
|
backgroundColor = PASSWORD_GROUP_COLOR;
|
|
@@ -1267,12 +1299,12 @@ export const CometChatConversations = (props: ConversationInterface) => {
|
|
|
1267
1299
|
statusIndicatorColor={disableUsersPresence ? "transparent" : backgroundColor}
|
|
1268
1300
|
listItemStyle={_listItemStyle}
|
|
1269
1301
|
TailView={() => <TailView
|
|
1270
|
-
customPattern={() => datePattern &&
|
|
1302
|
+
customPattern={() => datePattern && datePattern(conversation)}
|
|
1271
1303
|
timestamp={lastMessage && lastMessage['sentAt'] || conversationWith['createdAt']}
|
|
1272
1304
|
unreadCount={conversation.unreadMessageCount}
|
|
1273
1305
|
/>}
|
|
1274
1306
|
avatarStyle={_avatarStyle}
|
|
1275
|
-
statusIndicatorStyle={_statusIndicatorStyle}
|
|
1307
|
+
statusIndicatorStyle={_statusIndicatorStyle as ViewProps}
|
|
1276
1308
|
onPress={conversationClicked.bind(this, conversation)}
|
|
1277
1309
|
onLongPress={conversationLongPressed.bind(this, conversation)}
|
|
1278
1310
|
options={() => options ? options(conversation) : getDefaultOptions(conversation)}
|