@cometchat/chat-uikit-react-native 4.3.12 → 4.3.14
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/lib/AI/AIConversationStarter/style.d.ts +8 -8
- package/lib/AI/style.d.ts +15 -15
- package/lib/CometChatAddMembers/CometChatAddMembers.js +1 -0
- package/lib/CometChatAddMembers/CometChatAddMembers.js.map +1 -1
- package/lib/CometChatDetails/CometChatDetails.js +4 -2
- package/lib/CometChatDetails/CometChatDetails.js.map +1 -1
- package/lib/CometChatGroupMembers/CometChatGroupMembers.js +15 -4
- package/lib/CometChatGroupMembers/CometChatGroupMembers.js.map +1 -1
- package/lib/CometChatMessageComposer/CometChatMessageComposer.js +11 -3
- package/lib/CometChatMessageComposer/CometChatMessageComposer.js.map +1 -1
- package/lib/CometChatMessageHeader/CometChatMessageHeader.js +1 -1
- package/lib/CometChatMessageHeader/CometChatMessageHeader.js.map +1 -1
- package/lib/CometChatMessageInformation/CometChatMessageInformation.js +3 -1
- package/lib/CometChatMessageInformation/CometChatMessageInformation.js.map +1 -1
- package/lib/CometChatMessageList/CometChatMessageList.js +3 -1
- package/lib/CometChatMessageList/CometChatMessageList.js.map +1 -1
- package/lib/CometChatMessageList/MessageListConfiguration.js +1 -0
- package/lib/CometChatMessageList/MessageListConfiguration.js.map +1 -1
- package/lib/calls/CallingPackage.d.ts +1 -1
- package/lib/extensions/CollaborativeBubble/CometChatCollaborativeBubble.d.ts +2 -2
- package/lib/extensions/ExtensionModerator.d.ts +1 -1
- package/lib/extensions/SmartReplies/SmartRepliesView.d.ts +2 -2
- package/lib/extensions/Stickers/CometChatStickerKeyboard/StickerKeyboardConfiguration.d.ts +2 -2
- package/lib/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.js +5 -5
- package/lib/extensions/ThumbnailGeneration/ThumbnailGenerationDecorator.js.map +1 -1
- package/lib/extensions/ThumbnailGeneration/resources/index.d.ts +2 -2
- package/lib/extensions/ThumbnailGeneration/resources/index.js +2 -2
- package/lib/extensions/ThumbnailGeneration/resources/index.js.map +1 -1
- package/lib/shared/constants/UIKitConstants.d.ts +9 -0
- package/lib/shared/constants/UIKitConstants.js +12 -1
- package/lib/shared/constants/UIKitConstants.js.map +1 -1
- package/lib/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.js +40 -1
- package/lib/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.js.map +1 -1
- package/lib/shared/helper/SwipeRow.d.ts +5 -5
- package/lib/shared/helper/functions.d.ts +1 -1
- package/lib/shared/libs/ImageZoom/ReactNativeZoomableView.d.ts +8 -5
- package/lib/shared/libs/ImageZoom/ReactNativeZoomableViewWithGestures.d.ts +2 -2
- package/lib/shared/libs/VideoPlayerControls/OSSupport/TVOSSupport.d.ts +1 -1
- package/lib/shared/libs/datePickerModal/DateTimePickerModal.d.ts +1 -1
- package/lib/shared/libs/datePickerModal/DateTimePickerModal.ios.d.ts +2 -2
- package/lib/shared/libs/datePickerModal/Modal.d.ts +3 -3
- package/lib/shared/libs/luxon/src/datetime.d.ts +81 -81
- package/lib/shared/libs/luxon/src/duration.d.ts +24 -24
- package/lib/shared/libs/luxon/src/impl/english.d.ts +3 -3
- package/lib/shared/libs/luxon/src/impl/locale.d.ts +1 -1
- package/lib/shared/libs/luxon/src/impl/util.d.ts +7 -7
- package/lib/shared/libs/luxon/src/info.d.ts +28 -28
- package/lib/shared/libs/luxon/src/interval.d.ts +14 -14
- package/lib/shared/libs/luxon/src/settings.d.ts +2 -2
- package/lib/shared/libs/luxon/src/zones/IANAZone.d.ts +1 -1
- package/lib/shared/libs/luxon/src/zones/invalidZone.d.ts +1 -1
- package/lib/shared/libs/luxon/src/zones/systemZone.d.ts +1 -1
- package/lib/shared/modals/InteractiveData/InteractiveMessage/SchedulerMessage.d.ts +8 -8
- package/lib/shared/resources/CometChatSoundManager/CometChatSoundManager.d.ts +2 -2
- package/lib/shared/resources/CometChatTheme/CometChatTheme.d.ts +2 -2
- package/lib/shared/resources/CometChatTheme/Palette.d.ts +24 -24
- package/lib/shared/resources/CometChatTheme/Typography.d.ts +23 -23
- package/lib/shared/utils/CometChatMessagePreview/CometChatMessagePreview.d.ts +1 -1
- package/lib/shared/utils/CometChatMessagePreview/MessagePreviewConfiguration.d.ts +3 -3
- package/lib/shared/utils/CometChatMessagePreview/MessagePreviewStyle.d.ts +10 -10
- package/lib/shared/utils/DetailsUtils/DetailsUtils.d.ts +1 -1
- package/lib/shared/utils/SchedulerUtils.d.ts +4 -4
- package/lib/shared/views/CometChatActionSheet/ActionItem.d.ts +9 -9
- package/lib/shared/views/CometChatActionSheet/CometChatActionSheet.d.ts +3 -3
- package/lib/shared/views/CometChatDate/CometChatDate.d.ts +1 -1
- package/lib/shared/views/CometChatEmojiKeyboard/Emoji.d.ts +1 -1
- package/lib/shared/views/CometChatEmojiKeyboard/EmojiKeyboardConfiguration.d.ts +3 -3
- package/lib/shared/views/CometChatEmojiKeyboard/EmojiKeyboardStyle.d.ts +3 -3
- package/lib/shared/views/CometChatImageBubble/CometChatImageBubble.js +8 -2
- package/lib/shared/views/CometChatImageBubble/CometChatImageBubble.js.map +1 -1
- package/lib/shared/views/CometChatList/CometChatList.js +0 -1
- package/lib/shared/views/CometChatList/CometChatList.js.map +1 -1
- package/lib/shared/views/CometChatMessageBubble/style.js +1 -0
- package/lib/shared/views/CometChatReactions/CometChatReactions.d.ts +1 -1
- package/lib/shared/views/CometChatReceipt/CometChatReceipt.d.ts +1 -1
- package/lib/shared/views/CometChatVideoBubble/CometChatVideoBubble.js +7 -1
- package/lib/shared/views/CometChatVideoBubble/CometChatVideoBubble.js.map +1 -1
- package/lib/shared/views/CometChatVideoBubble/VideoBubbleStyle.js +1 -1
- package/lib/shared/views/CometChatVideoBubble/VideoBubbleStyle.js.map +1 -1
- package/package.json +1 -1
- package/src/AI/AIConversationSummary/resources/close.png +0 -0
- package/src/CometChatConversations/CometChatConversations.tsx +85 -72
- package/src/CometChatConversations/resources/close.png +0 -0
- package/src/CometChatConversations/resources/rightTick.png +0 -0
- package/src/CometChatCreateGroup/resources/close.png +0 -0
- package/src/CometChatCreateGroup/resources/rightTick.png +0 -0
- package/src/CometChatDetails/CometChatDetails.tsx +4 -2
- package/src/CometChatDetails/resources/close.png +0 -0
- package/src/CometChatGroupMembers/CometChatGroupMembers.tsx +26 -11
- package/src/CometChatGroupMembers/resources/rightTick.png +0 -0
- package/src/CometChatGroups/resources/close.png +0 -0
- package/src/CometChatGroups/resources/rightTick.png +0 -0
- package/src/CometChatJoinProtectedGroup/resources/close.png +0 -0
- package/src/CometChatJoinProtectedGroup/resources/rightTick.png +0 -0
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +43 -48
- package/src/CometChatMessageComposer/resources/Info.png +0 -0
- package/src/CometChatMessageComposer/resources/circle_add.png +0 -0
- package/src/CometChatMessageComposer/resources/close.png +0 -0
- package/src/CometChatMessageComposer/resources/image.png +0 -0
- package/src/CometChatMessageComposer/resources/send_message.png +0 -0
- package/src/CometChatMessageComposer/resources/stickers.png +0 -0
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +1 -1
- package/src/CometChatMessageInformation/CometChatMessageInformation.tsx +9 -6
- package/src/CometChatMessageList/CometChatMessageList.tsx +53 -64
- package/src/CometChatMessageList/MessageListConfiguration.ts +2 -0
- package/src/CometChatMessageList/resources/close.png +0 -0
- package/src/CometChatMessageList/resources/leftarrowcurve.png +0 -0
- package/src/CometChatMessages/CometChatMessages.tsx +1 -2
- package/src/CometChatMessages/resources/info.png +0 -0
- package/src/CometChatMessages/style.ts +0 -1
- package/src/CometChatThreadedMessages/resources/close.png +0 -0
- package/src/calls/CometChatCallButtons/resources/Call.png +0 -0
- package/src/calls/CometChatCallButtons/resources/Video.png +0 -0
- package/src/calls/CometChatCallLogHistory/resources/Info.png +0 -0
- package/src/calls/CometChatCallLogRecordings/resources/download.png +0 -0
- package/src/calls/CometChatCallLogs/CallLogsConfiguration.ts +4 -4
- package/src/calls/CometChatCallLogs/CometChatCallLogs.tsx +2 -2
- package/src/calls/CometChatCallLogs/resources/Info.png +0 -0
- package/src/calls/CometChatOutgoingCall/resources/Close.png +0 -0
- package/src/calls/resources/Call.png +0 -0
- package/src/calls/resources/Video.png +0 -0
- package/src/extensions/CollaborativeDocument/resources/collaborative_document.png +0 -0
- package/src/extensions/CollaborativeWhiteboard/resources/collaborative_whiteboard.png +0 -0
- package/src/extensions/MessageTranslation/resources/translate.png +0 -0
- package/src/extensions/Polls/resources/close.png +0 -0
- package/src/extensions/Polls/resources/document.png +0 -0
- package/src/extensions/Polls/resources/kickIcon.png +0 -0
- package/src/extensions/Polls/resources/rightTick.png +0 -0
- package/src/extensions/SmartReplies/resources/close.png +0 -0
- package/src/extensions/Stickers/resources/Stickers.png +0 -0
- package/src/shared/assets/images/checkmark.png +0 -0
- package/src/shared/assets/images/grey-double-tick-icon.png +0 -0
- package/src/shared/assets/images/grey-tick-icon.png +0 -0
- package/src/shared/constants/UIKitConstants.ts +12 -1
- package/src/shared/formatters/CometChatMentionsFormatter/CometChatMentionsFormatter.tsx +46 -1
- package/src/shared/framework/resources/audio-file.png +0 -0
- package/src/shared/framework/resources/circle_add.png +0 -0
- package/src/shared/framework/resources/copy.png +0 -0
- package/src/shared/framework/resources/delete.png +0 -0
- package/src/shared/framework/resources/edit.png +0 -0
- package/src/shared/framework/resources/file_upload.png +0 -0
- package/src/shared/framework/resources/image.png +0 -0
- package/src/shared/framework/resources/info.png +0 -0
- package/src/shared/framework/resources/messageInPrivate.png +0 -0
- package/src/shared/framework/resources/pause.png +0 -0
- package/src/shared/framework/resources/play.png +0 -0
- package/src/shared/framework/resources/send_message.png +0 -0
- package/src/shared/framework/resources/share.png +0 -0
- package/src/shared/framework/resources/thread.png +0 -0
- package/src/shared/framework/resources/video_upload.png +0 -0
- package/src/shared/utils/CometChatMessagePreview/resources/close.png +0 -0
- package/src/shared/utils/CommonUtils.ts +43 -9
- package/src/shared/utils/DetailsUtils/resources/close.png +0 -0
- package/src/shared/views/CometChatActionSheet/resources/grid.png +0 -0
- package/src/shared/views/CometChatActionSheet/resources/list.png +0 -0
- package/src/shared/views/CometChatAudioBubble/resources/pause.png +0 -0
- package/src/shared/views/CometChatAudioBubble/resources/play.png +0 -0
- package/src/shared/views/CometChatFileBubble/resources/download.png +0 -0
- package/src/shared/views/CometChatFileBubble/resources/file_upload.png +0 -0
- package/src/shared/views/CometChatFileBubble/style.ts +2 -0
- package/src/shared/views/CometChatList/CometChatList.tsx +13 -5
- package/src/shared/views/CometChatList/resources/checkmark.png +0 -0
- package/src/shared/views/CometChatSchedulerBubble/CometChatSchedulerBubble.tsx +7 -4
- package/src/shared/views/CometChatVideoBubble/resources/play.png +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -39,6 +39,7 @@ import { CometChatGroupsMembers } from '../CometChatGroupMembers';
|
|
|
39
39
|
import { CometChatContextType } from '../shared/base/Types';
|
|
40
40
|
import { CometChatUIEventHandler } from '../shared/events/CometChatUIEventHandler/CometChatUIEventHandler';
|
|
41
41
|
import { CometChatTransferOwnershipInterface } from '../CometChatTransferOwnership/CometChatTransferOwnership';
|
|
42
|
+
import { CommonUtils } from '../shared/utils/CommonUtils';
|
|
42
43
|
|
|
43
44
|
export interface ModalDetailsInterface {
|
|
44
45
|
title: string;
|
|
@@ -737,8 +738,9 @@ export const CometChatDetails = (props: CometChatDetailsInterface) => {
|
|
|
737
738
|
|
|
738
739
|
const handleUserStatus = (user) => {
|
|
739
740
|
setUserDetails((prev) => {
|
|
740
|
-
|
|
741
|
-
|
|
741
|
+
const clonedUserDetails = CommonUtils.clone(prev);
|
|
742
|
+
clonedUserDetails.setStatus(user.getStatus());
|
|
743
|
+
return clonedUserDetails;
|
|
742
744
|
});
|
|
743
745
|
};
|
|
744
746
|
|
|
Binary file
|
|
@@ -19,6 +19,7 @@ import { getUnixTimestamp, getUnixTimestampInMilliseconds } from "../shared/util
|
|
|
19
19
|
import { CometChatContextType } from "../shared/base/Types";
|
|
20
20
|
import { CometChatUIEventHandler } from "../shared/events/CometChatUIEventHandler/CometChatUIEventHandler";
|
|
21
21
|
import { StatusIndicatorStyleInterface } from "../shared/views/CometChatStatusIndicator/StatusIndicatorStyle";
|
|
22
|
+
import { CommonUtils } from "../shared/utils/CommonUtils";
|
|
22
23
|
|
|
23
24
|
// Note: Omit all the unwanted props
|
|
24
25
|
export interface CometChatGroupsMembersInterface extends
|
|
@@ -333,19 +334,19 @@ export const CometChatGroupsMembers = (props: CometChatGroupsMembersInterface) =
|
|
|
333
334
|
|
|
334
335
|
function getStatusIndicatorColor(
|
|
335
336
|
groupMember: CometChat.GroupMember
|
|
336
|
-
|
|
337
|
+
): string | null {
|
|
337
338
|
if (
|
|
338
|
-
|
|
339
|
-
|
|
339
|
+
props.disableUsersPresence ||
|
|
340
|
+
(groupMember?.getStatus && groupMember.getStatus()) === CometChatUiKitConstants.UserStatusConstants.offline
|
|
340
341
|
) {
|
|
341
|
-
|
|
342
|
+
return null;
|
|
342
343
|
}
|
|
343
344
|
return (
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
345
|
+
groupMemberStyle?.onlineStatusColor ||
|
|
346
|
+
theme.palette.getSuccess() ||
|
|
347
|
+
null
|
|
347
348
|
);
|
|
348
|
-
|
|
349
|
+
}
|
|
349
350
|
|
|
350
351
|
const ItemView = ({ item: member, ...props }) => {
|
|
351
352
|
if (ListItemView)
|
|
@@ -373,6 +374,8 @@ export const CometChatGroupsMembers = (props: CometChatGroupsMembersInterface) =
|
|
|
373
374
|
avatarURL={member.avatar}
|
|
374
375
|
listItemStyle={_listItemStyle}
|
|
375
376
|
avatarStyle={_avatarStyle}
|
|
377
|
+
hideSeparator={hideSeparator}
|
|
378
|
+
separatorColor={_groupMemberStyle?.separatorColor}
|
|
376
379
|
statusIndicatorStyle={_statusIndicatorStyle}
|
|
377
380
|
TailView={TailView ? () => <TailView {...member} /> : ScopeChangeUI.bind(this, member, groupScopeStyle)} //Note: should return prop to TailView
|
|
378
381
|
options={() => (options && options(member)) || swipeOptions(member, (id) => kickUser(id, member), () => banUser(member))} //Note: should have options
|
|
@@ -395,7 +398,7 @@ export const CometChatGroupsMembers = (props: CometChatGroupsMembersInterface) =
|
|
|
395
398
|
const {
|
|
396
399
|
height = "100%",
|
|
397
400
|
width = "100%",
|
|
398
|
-
backgroundColor =
|
|
401
|
+
backgroundColor = _groupScopeStyle.backgroundColor,
|
|
399
402
|
border = new BorderStyle({}),
|
|
400
403
|
borderRadius = 4,
|
|
401
404
|
titleTextFont = new FontStyle({ fontSize: 14 }),
|
|
@@ -572,12 +575,24 @@ export const CometChatGroupsMembers = (props: CometChatGroupsMembersInterface) =
|
|
|
572
575
|
groupMemberListenerId,
|
|
573
576
|
new CometChat.UserListener({
|
|
574
577
|
onUserOnline: (onlineUser: any) => {
|
|
578
|
+
|
|
579
|
+
let item = groupRef.current.getListItem(onlineUser.uid);
|
|
580
|
+
if (item) {
|
|
581
|
+
let updatedConversation = CommonUtils.clone(item);
|
|
582
|
+
updatedConversation.setStatus(onlineUser.status);
|
|
583
|
+
groupRef.current.updateList(updatedConversation);
|
|
584
|
+
}
|
|
585
|
+
|
|
575
586
|
/* when someuser/friend comes online, user will be received here */
|
|
576
|
-
groupRef.current.updateUser(onlineUser);
|
|
577
587
|
},
|
|
578
588
|
onUserOffline: (offlineUser: any) => {
|
|
589
|
+
let item = groupRef.current.getListItem(offlineUser.uid);
|
|
590
|
+
if (item) {
|
|
591
|
+
let updatedConversation = CommonUtils.clone(item);
|
|
592
|
+
updatedConversation.setStatus(offlineUser.status);
|
|
593
|
+
groupRef.current.updateList(updatedConversation);
|
|
594
|
+
}
|
|
579
595
|
/* when someuser/friend went offline, user will be received here */
|
|
580
|
-
groupRef.current.updateUser(offlineUser);
|
|
581
596
|
},
|
|
582
597
|
})
|
|
583
598
|
);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useContext, useEffect, useLayoutEffect } from 'react';
|
|
1
|
+
import React, { useContext, useEffect, useLayoutEffect, useRef } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
4
|
Image,
|
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
import { CometChatSoundManager, ChatConfigurator } from '../shared';
|
|
43
43
|
import {
|
|
44
44
|
ConversationOptionConstants,
|
|
45
|
+
MentionsVisibility,
|
|
45
46
|
MessageTypeConstants,
|
|
46
47
|
MetadataConstants,
|
|
47
48
|
ReceiverTypeConstants,
|
|
@@ -661,7 +662,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
661
662
|
...aiOptionsStyle,
|
|
662
663
|
})
|
|
663
664
|
|
|
664
|
-
|
|
665
|
+
const isTyping = useRef<NodeJS.Timeout | null>(null);
|
|
665
666
|
|
|
666
667
|
/**
|
|
667
668
|
* Event callback
|
|
@@ -876,7 +877,6 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
876
877
|
textMessage.setReceiver(chatWith.current);
|
|
877
878
|
textMessage.setText(finalTextInput);
|
|
878
879
|
textMessage.setMuid(String(getUnixTimestampInMilliseconds()));
|
|
879
|
-
textMessage.setSentAt(getUnixTimestamp());
|
|
880
880
|
parentMessageId && textMessage.setParentMessageId(parentMessageId as number);
|
|
881
881
|
|
|
882
882
|
allFormatters.current.forEach(item => {
|
|
@@ -886,21 +886,24 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
886
886
|
setMentionsSearchData([]);
|
|
887
887
|
plainTextInput.current = ""
|
|
888
888
|
|
|
889
|
-
if (
|
|
890
|
-
onSendButtonPress(textMessage);
|
|
889
|
+
if (finalTextInput.trim().length == 0) {
|
|
891
890
|
return;
|
|
892
891
|
}
|
|
893
892
|
|
|
894
|
-
|
|
893
|
+
clearInputBox();
|
|
894
|
+
|
|
895
|
+
if (onSendButtonPress) {
|
|
896
|
+
onSendButtonPress(textMessage);
|
|
895
897
|
return;
|
|
896
898
|
}
|
|
899
|
+
|
|
897
900
|
CometChatUIEventHandler.emitMessageEvent(MessageEvents.ccMessageSent, {
|
|
898
901
|
message: textMessage,
|
|
899
902
|
status: messageStatus.inprogress,
|
|
900
903
|
});
|
|
901
904
|
|
|
902
905
|
if (!disableSoundForMessages) playAudio();
|
|
903
|
-
|
|
906
|
+
|
|
904
907
|
CometChat.sendMessage(textMessage)
|
|
905
908
|
.then((message: any) => {
|
|
906
909
|
CometChatUIEventHandler.emitMessageEvent(
|
|
@@ -944,10 +947,15 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
944
947
|
setInputMessage('');
|
|
945
948
|
messageInputRef.current.textContent = '';
|
|
946
949
|
|
|
947
|
-
if (!disableSoundForMessages) playAudio();
|
|
948
|
-
|
|
949
950
|
setMessagePreview(null);
|
|
950
951
|
|
|
952
|
+
if (onSendButtonPress) {
|
|
953
|
+
onSendButtonPress(textMessage);
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
if (!disableSoundForMessages) playAudio();
|
|
958
|
+
|
|
951
959
|
CometChat.editMessage(textMessage)
|
|
952
960
|
.then((editedMessage: any) => {
|
|
953
961
|
inputValueRef.current = '';
|
|
@@ -983,11 +991,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
983
991
|
mediaMessage.setSender(loggedInUser.current);
|
|
984
992
|
mediaMessage.setReceiver(receiverType);
|
|
985
993
|
mediaMessage.setType(messageType);
|
|
986
|
-
mediaMessage['_composedAt'] = Date.now();
|
|
987
|
-
mediaMessage['_id'] = '_' + Math.random().toString(36).substr(2, 9);
|
|
988
|
-
mediaMessage.setId(mediaMessage['_id']);
|
|
989
994
|
mediaMessage.setMuid(String(getUnixTimestampInMilliseconds()));
|
|
990
|
-
mediaMessage.setSentAt(getUnixTimestamp());
|
|
991
995
|
mediaMessage.setData({
|
|
992
996
|
type: messageType,
|
|
993
997
|
category: CometChat.CATEGORY_MESSAGE,
|
|
@@ -1008,11 +1012,7 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1008
1012
|
localMessage.setSender(loggedInUser.current);
|
|
1009
1013
|
localMessage.setReceiver(receiverType);
|
|
1010
1014
|
localMessage.setType(messageType);
|
|
1011
|
-
localMessage['_composedAt'] = Date.now();
|
|
1012
|
-
localMessage['_id'] = '_' + Math.random().toString(36).substr(2, 9);
|
|
1013
|
-
localMessage.setId(localMessage['_id']);
|
|
1014
1015
|
localMessage.setMuid(String(getUnixTimestampInMilliseconds()));
|
|
1015
|
-
localMessage.setSentAt(getUnixTimestamp());
|
|
1016
1016
|
localMessage.setData({
|
|
1017
1017
|
type: messageType,
|
|
1018
1018
|
category: CometChat.CATEGORY_MESSAGE,
|
|
@@ -1040,7 +1040,6 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1040
1040
|
if (!disableSoundForMessages) playAudio();
|
|
1041
1041
|
CometChat.sendMediaMessage(mediaMessage)
|
|
1042
1042
|
.then((message: any) => {
|
|
1043
|
-
setTimeout(() => {
|
|
1044
1043
|
CometChatUIEventHandler.emitMessageEvent(
|
|
1045
1044
|
MessageEvents.ccMessageSent,
|
|
1046
1045
|
{
|
|
@@ -1049,7 +1048,6 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1049
1048
|
}
|
|
1050
1049
|
);
|
|
1051
1050
|
setShowRecordAudio(false);
|
|
1052
|
-
}, 1000);
|
|
1053
1051
|
})
|
|
1054
1052
|
.catch((error: any) => {
|
|
1055
1053
|
setShowRecordAudio(false);
|
|
@@ -1072,22 +1070,25 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1072
1070
|
return false;
|
|
1073
1071
|
}
|
|
1074
1072
|
|
|
1075
|
-
//if typing is in progress
|
|
1076
|
-
if (isTyping) {
|
|
1077
|
-
return false;
|
|
1078
|
-
}
|
|
1079
1073
|
|
|
1080
|
-
|
|
1081
|
-
|
|
1074
|
+
//if typing is in progress, clear the previous timeout and set new timeout
|
|
1075
|
+
if (isTyping.current) {
|
|
1076
|
+
clearTimeout(isTyping.current);
|
|
1077
|
+
isTyping.current = null;
|
|
1078
|
+
} else {
|
|
1079
|
+
let metadata = typingMetadata || undefined;
|
|
1080
|
+
|
|
1081
|
+
let typingNotification = new CometChat.TypingIndicator(
|
|
1082
|
+
chatWithId.current,
|
|
1083
|
+
chatWith.current,
|
|
1084
|
+
metadata
|
|
1085
|
+
);
|
|
1086
|
+
CometChat.startTyping(typingNotification);
|
|
1087
|
+
}
|
|
1082
1088
|
|
|
1083
|
-
let typingNotification = new CometChat.TypingIndicator(
|
|
1084
|
-
chatWithId.current,
|
|
1085
|
-
chatWith.current,
|
|
1086
|
-
metadata
|
|
1087
|
-
);
|
|
1088
|
-
CometChat.startTyping(typingNotification);
|
|
1089
1089
|
|
|
1090
|
-
|
|
1090
|
+
let typingInterval = endTypingTimeout || 500;
|
|
1091
|
+
isTyping.current = setTimeout(() => {
|
|
1091
1092
|
endTyping(null, typingMetadata);
|
|
1092
1093
|
}, typingInterval);
|
|
1093
1094
|
return false;
|
|
@@ -1111,24 +1112,11 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1111
1112
|
);
|
|
1112
1113
|
CometChat.endTyping(typingNotification);
|
|
1113
1114
|
|
|
1114
|
-
clearTimeout(isTyping);
|
|
1115
|
-
isTyping = null;
|
|
1115
|
+
clearTimeout(isTyping.current!);
|
|
1116
|
+
isTyping.current = null;
|
|
1116
1117
|
return false;
|
|
1117
1118
|
};
|
|
1118
1119
|
|
|
1119
|
-
// const getActionSheetStyle = () => {
|
|
1120
|
-
// return new ActionSheetStyles({
|
|
1121
|
-
// layoutModeIconTint:
|
|
1122
|
-
// messageComposerStyle.actionSheetLayoutModeIconTint ??
|
|
1123
|
-
// theme.palette.getPrimary(),
|
|
1124
|
-
// titleFont:
|
|
1125
|
-
// messageComposerStyle.actionSheetTitleFont ?? theme.typography.text1,
|
|
1126
|
-
// titleColor:
|
|
1127
|
-
// messageComposerStyle.actionSheetTitleColor ??
|
|
1128
|
-
// theme.palette.getAccent800(),
|
|
1129
|
-
// });
|
|
1130
|
-
// };
|
|
1131
|
-
|
|
1132
1120
|
const GetEmojiIconView = () => {
|
|
1133
1121
|
return (
|
|
1134
1122
|
<ImageButton
|
|
@@ -1496,7 +1484,14 @@ export const CometChatMessageComposer = React.forwardRef(
|
|
|
1496
1484
|
setShowMentionList(true);
|
|
1497
1485
|
|
|
1498
1486
|
let formatter = allFormatters.current.get(tracker);
|
|
1499
|
-
formatter
|
|
1487
|
+
if (formatter instanceof CometChatMentionsFormatter) {
|
|
1488
|
+
let shouldShowMentionList = (formatter.getVisibleIn() === MentionsVisibility.both) || (formatter.getVisibleIn() === MentionsVisibility.usersConversationOnly && user) || (formatter.getVisibleIn() === MentionsVisibility.groupsConversationOnly && group);
|
|
1489
|
+
if (shouldShowMentionList) {
|
|
1490
|
+
formatter.search(searchString);
|
|
1491
|
+
}
|
|
1492
|
+
} else {
|
|
1493
|
+
formatter.search(searchString);
|
|
1494
|
+
}
|
|
1500
1495
|
|
|
1501
1496
|
} else {
|
|
1502
1497
|
activeCharacter.current = "";
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -437,7 +437,7 @@ export const CometChatMessageHeader = (
|
|
|
437
437
|
statusIndicatorColor={
|
|
438
438
|
disableUsersPresence
|
|
439
439
|
? 'transparent'
|
|
440
|
-
: user &&
|
|
440
|
+
: user && userStatus === UserStatusConstants.online
|
|
441
441
|
? style.onlineStatusColor || theme.palette.getSuccess()
|
|
442
442
|
: 'transparent'
|
|
443
443
|
}
|
|
@@ -246,7 +246,7 @@ export const CometChatMessageInformation = (props: CometChatMessageInformationIn
|
|
|
246
246
|
});
|
|
247
247
|
setTemplateLoading(false)
|
|
248
248
|
}
|
|
249
|
-
|
|
249
|
+
|
|
250
250
|
return (
|
|
251
251
|
<View style={[
|
|
252
252
|
{
|
|
@@ -306,11 +306,14 @@ export const CometChatMessageInformation = (props: CometChatMessageInformationIn
|
|
|
306
306
|
<ErrorView /> :
|
|
307
307
|
recipients.length == 0 ?
|
|
308
308
|
<EmptyView /> :
|
|
309
|
-
<
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
309
|
+
<View style={{ minHeight: 0, maxHeight: "60%" }}>
|
|
310
|
+
<FlatList
|
|
311
|
+
style={{ backgroundColor: 'transparent' }}
|
|
312
|
+
contentContainerStyle={{ paddingBottom: "20%" }}
|
|
313
|
+
data={recipients}
|
|
314
|
+
renderItem={renderReceipients}
|
|
315
|
+
/>
|
|
316
|
+
</View>
|
|
314
317
|
}
|
|
315
318
|
</View>
|
|
316
319
|
)
|