@bcc-code/vue-bcc-chat-ui 3.17.1 → 3.19.0
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/dist/chat/login.d.ts +1 -0
- package/dist/components/BccChatMessageBubble.vue.d.ts +9 -0
- package/dist/offline/index.d.ts +2 -0
- package/dist/offline/types.d.ts +5 -0
- package/dist/vue-bcc-chat-ui.js +10737 -10675
- package/package.json +1 -1
- package/src/components/BccChatMessageBubble.vue +28 -1
- package/src/components/BccChatMessageList.vue +5 -1
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import { inject, ref } from 'vue';
|
|
|
6
6
|
import { CometChatTheme, fontHelper } from '@cometchat/uikit-resources';
|
|
7
7
|
import BccReplyPreview from "./BccReplyPreview.vue";
|
|
8
8
|
import BccImageBubble from './BccImageBubble.vue';
|
|
9
|
+
import { offlineStore } from '../offline';
|
|
9
10
|
|
|
10
11
|
const props = defineProps({
|
|
11
12
|
text: {
|
|
@@ -15,6 +16,10 @@ const props = defineProps({
|
|
|
15
16
|
metadata: {
|
|
16
17
|
type: Object
|
|
17
18
|
},
|
|
19
|
+
guid: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ""
|
|
22
|
+
},
|
|
18
23
|
mentionedUsers: {
|
|
19
24
|
type: Array<User>
|
|
20
25
|
},
|
|
@@ -79,7 +84,29 @@ function formatMentionsInText(text: string) {
|
|
|
79
84
|
|
|
80
85
|
let parentMsgRef = ref<BaseMessage>();
|
|
81
86
|
if (props.metadata?.replyToMessageId) {
|
|
82
|
-
|
|
87
|
+
let guidString = props.guid?.toString()
|
|
88
|
+
let group = offlineStore.getGroup(guidString)
|
|
89
|
+
|
|
90
|
+
//for read only replies
|
|
91
|
+
if (group != null && group?.hasJoined == undefined) {
|
|
92
|
+
let message = offlineStore.getMessage(props.metadata.replyToMessageId).data
|
|
93
|
+
|
|
94
|
+
if (message !== undefined) {
|
|
95
|
+
if (message.type == CometChat.MESSAGE_TYPE.TEXT) {
|
|
96
|
+
let text = new CometChat.TextMessage(message.receiver, message.data.text, message.receiverType)
|
|
97
|
+
text.setData(message.data)
|
|
98
|
+
parentMsgRef.value = text
|
|
99
|
+
} else {
|
|
100
|
+
let media = new CometChat.MediaMessage(message.receiver, {}, message.type, message.receiverType)
|
|
101
|
+
media.setData(message.data)
|
|
102
|
+
parentMsgRef.value = media
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
parentMsgRef.value = new CometChat.TextMessage("","Cannot load message","")
|
|
106
|
+
}
|
|
107
|
+
} else {
|
|
108
|
+
CometChat.getMessageDetails(props.metadata.replyToMessageId).then((msg: BaseMessage) => parentMsgRef.value = msg).catch(() => parentMsgRef.value = new CometChat.TextMessage("","Unknown message",""));
|
|
109
|
+
}
|
|
83
110
|
};
|
|
84
111
|
|
|
85
112
|
const { theme } = inject("theme", { theme: ref(new CometChatTheme({})) });
|
|
@@ -58,7 +58,7 @@ const onMessageSend = CometChatMessageEvents.ccMessageSent.subscribe(({ message,
|
|
|
58
58
|
chatInstance.value.replyToMessage = null;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
if (props.senderDisplayName &&
|
|
61
|
+
if (props.senderDisplayName && scope == "moderator") {
|
|
62
62
|
metadata.senderDisplayName = props.senderDisplayName
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -140,6 +140,10 @@ function isChannel(): boolean {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
function isParticipant(): boolean {
|
|
143
|
+
//if not part of the group return true anyway since getScope dosen't exist when not in the group
|
|
144
|
+
if (!chatGroup.value?.getHasJoined()) {
|
|
145
|
+
return true
|
|
146
|
+
}
|
|
143
147
|
return chatGroup.value?.getScope() == "participant";
|
|
144
148
|
}
|
|
145
149
|
|