@cometchat/chat-uikit-angular 4.3.25 → 4.3.26
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/CometChatConversations/cometchat-conversations/cometchat-conversations.component.d.ts +2 -1
- package/CometChatMessageComposer/cometchat-message-composer/cometchat-message-composer.component.d.ts +0 -1
- package/esm2020/CometChatConversations/cometchat-conversations/cometchat-conversations.component.mjs +32 -19
- package/esm2020/CometChatMessageComposer/cometchat-message-composer/cometchat-message-composer.component.mjs +19 -10
- package/esm2020/CometChatMessageList/cometchat-message-list/cometchat-message-list.component.mjs +5 -5
- package/esm2020/Shared/CometChatUIkit/CometChatUIKit.mjs +2 -2
- package/fesm2015/cometchat-chat-uikit-angular.mjs +55 -36
- package/fesm2015/cometchat-chat-uikit-angular.mjs.map +1 -1
- package/fesm2020/cometchat-chat-uikit-angular.mjs +55 -33
- package/fesm2020/cometchat-chat-uikit-angular.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1912,7 +1912,7 @@ class CometChatUIKit {
|
|
|
1912
1912
|
if (window) {
|
|
1913
1913
|
window.CometChatUiKit = {
|
|
1914
1914
|
name: "@cometchat/chat-uikit-angular",
|
|
1915
|
-
version: "4.3.
|
|
1915
|
+
version: "4.3.26",
|
|
1916
1916
|
};
|
|
1917
1917
|
}
|
|
1918
1918
|
if (CometChatUIKitSharedSettings) {
|
|
@@ -6641,6 +6641,12 @@ class CometChatConversationsComponent {
|
|
|
6641
6641
|
this.ref.detectChanges();
|
|
6642
6642
|
});
|
|
6643
6643
|
this.ccMessageRead = CometChatMessageEvents.ccMessageRead.subscribe((messageObject) => {
|
|
6644
|
+
let conversation = this.getConversationFromId(messageObject.getConversationId());
|
|
6645
|
+
if (conversation) {
|
|
6646
|
+
this.updateEditedMessage(conversation.getLastMessage());
|
|
6647
|
+
this.resetUnreadCount(conversation.getConversationId());
|
|
6648
|
+
return;
|
|
6649
|
+
}
|
|
6644
6650
|
if (!this.conversationType || this.conversationType == messageObject.getReceiverType()) {
|
|
6645
6651
|
CometChat.CometChatHelper.getConversationFromMessage(messageObject).then((conversation) => {
|
|
6646
6652
|
if (conversation &&
|
|
@@ -6692,6 +6698,13 @@ class CometChatConversationsComponent {
|
|
|
6692
6698
|
}
|
|
6693
6699
|
return null;
|
|
6694
6700
|
}
|
|
6701
|
+
getConversationFromId(id) {
|
|
6702
|
+
let index = this.conversationList.findIndex((element) => element.getConversationId() == id);
|
|
6703
|
+
if (index >= 0) {
|
|
6704
|
+
return this.conversationList[index];
|
|
6705
|
+
}
|
|
6706
|
+
return null;
|
|
6707
|
+
}
|
|
6695
6708
|
getConversationFromGroup(group) {
|
|
6696
6709
|
let index = this.conversationList.findIndex((element) => element.getConversationType() ==
|
|
6697
6710
|
CometChatUIKitConstants.MessageReceiverType.group &&
|
|
@@ -6754,25 +6767,25 @@ class CometChatConversationsComponent {
|
|
|
6754
6767
|
}
|
|
6755
6768
|
}
|
|
6756
6769
|
// set unread count
|
|
6757
|
-
resetUnreadCount() {
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6770
|
+
resetUnreadCount(conversationId) {
|
|
6771
|
+
const targetConversationId = conversationId || this.activeConversation?.getConversationId();
|
|
6772
|
+
if (!targetConversationId)
|
|
6773
|
+
return;
|
|
6774
|
+
const conversationIndex = this.conversationList.findIndex((conv) => conv.getConversationId() === targetConversationId);
|
|
6775
|
+
if (conversationIndex < 0)
|
|
6776
|
+
return;
|
|
6777
|
+
const updatedConversation = this.conversationList[conversationIndex];
|
|
6778
|
+
updatedConversation.setUnreadMessageCount(0);
|
|
6779
|
+
const lastMessage = updatedConversation.getLastMessage();
|
|
6780
|
+
if (lastMessage instanceof CometChat.TextMessage) {
|
|
6781
|
+
lastMessage.setMuid(this.getUinx());
|
|
6782
|
+
}
|
|
6783
|
+
this.conversationList = [
|
|
6784
|
+
...this.conversationList.slice(0, conversationIndex),
|
|
6785
|
+
updatedConversation,
|
|
6786
|
+
...this.conversationList.slice(conversationIndex + 1),
|
|
6787
|
+
];
|
|
6788
|
+
this.ref.detectChanges();
|
|
6776
6789
|
}
|
|
6777
6790
|
// sets property from theme to style object
|
|
6778
6791
|
setThemeStyle() {
|
|
@@ -9187,8 +9200,8 @@ class CometChatMessageListComponent {
|
|
|
9187
9200
|
!lastMessage.getDeliveredAt()) {
|
|
9188
9201
|
//mark the message as delivered
|
|
9189
9202
|
if (!this.disableReceipt) {
|
|
9190
|
-
CometChat.markAsDelivered(lastMessage).then((
|
|
9191
|
-
let messageKey = this.messagesList.findIndex((m) => m.getId() ===
|
|
9203
|
+
CometChat.markAsDelivered(lastMessage).then(() => {
|
|
9204
|
+
let messageKey = this.messagesList.findIndex((m) => m.getId() === lastMessage?.getId());
|
|
9192
9205
|
if (messageKey > -1) {
|
|
9193
9206
|
this.markAllMessagAsDelivered(messageKey);
|
|
9194
9207
|
}
|
|
@@ -9198,8 +9211,8 @@ class CometChatMessageListComponent {
|
|
|
9198
9211
|
if (!lastMessage?.getReadAt() && !isSentByMe) {
|
|
9199
9212
|
if (!this.disableReceipt) {
|
|
9200
9213
|
CometChat.markAsRead(lastMessage)
|
|
9201
|
-
.then((
|
|
9202
|
-
let messageKey = this.messagesList.findIndex((m) => m.getId() ===
|
|
9214
|
+
.then(() => {
|
|
9215
|
+
let messageKey = this.messagesList.findIndex((m) => m.getId() === lastMessage?.getId());
|
|
9203
9216
|
if (messageKey > -1) {
|
|
9204
9217
|
this.markAllMessagAsRead(messageKey);
|
|
9205
9218
|
}
|
|
@@ -13728,12 +13741,6 @@ class CometChatMessageComposerComponent {
|
|
|
13728
13741
|
? [...this.textFormatters]
|
|
13729
13742
|
: [];
|
|
13730
13743
|
this.mentionedUsers = [];
|
|
13731
|
-
this.acceptHandlers = {
|
|
13732
|
-
"image/*": this.onImageChange.bind(this),
|
|
13733
|
-
"video/*": this.onVideoChange.bind(this),
|
|
13734
|
-
"audio/*": this.onAudioChange.bind(this),
|
|
13735
|
-
"file/*": this.onFileChange.bind(this),
|
|
13736
|
-
};
|
|
13737
13744
|
this.enableStickerKeyboard = false;
|
|
13738
13745
|
this.toggleMediaRecorded = false;
|
|
13739
13746
|
this.showAiBotList = false;
|
|
@@ -13993,9 +14000,24 @@ class CometChatMessageComposerComponent {
|
|
|
13993
14000
|
}
|
|
13994
14001
|
};
|
|
13995
14002
|
this.inputChangeHandler = (event) => {
|
|
13996
|
-
const
|
|
13997
|
-
|
|
13998
|
-
|
|
14003
|
+
const files = event.target.files;
|
|
14004
|
+
if (!files || files.length === 0)
|
|
14005
|
+
return;
|
|
14006
|
+
Array.from(files).forEach((file) => {
|
|
14007
|
+
const fileType = file.type;
|
|
14008
|
+
if (fileType.startsWith("image/")) {
|
|
14009
|
+
this.onImageChange(event);
|
|
14010
|
+
}
|
|
14011
|
+
else if (fileType.startsWith("video/")) {
|
|
14012
|
+
this.onVideoChange(event);
|
|
14013
|
+
}
|
|
14014
|
+
else if (fileType.startsWith("audio/")) {
|
|
14015
|
+
this.onAudioChange(event);
|
|
14016
|
+
}
|
|
14017
|
+
else {
|
|
14018
|
+
this.onFileChange(event);
|
|
14019
|
+
}
|
|
14020
|
+
});
|
|
13999
14021
|
if (this.inputElementRef?.nativeElement && this.inputElementRef.nativeElement?.value) {
|
|
14000
14022
|
this.inputElementRef.nativeElement.value = "";
|
|
14001
14023
|
}
|