@realtimexsco/live-chat 1.3.1 → 1.3.3

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/index.mjs CHANGED
@@ -555,7 +555,7 @@ var init_group_display_helpers = __esm({
555
555
  });
556
556
 
557
557
  // src/store/helpers/message.helpers.ts
558
- var getMessageSenderId, extractMessageData, mergeLastMessage, messageHasPreviewBody, getLatestMessageFromList, isOwnMessage, getMessageContent, getMessageTimestamp, statusRank, preferHigherStatus, resolveMessageStatus, mergeChatMessages;
558
+ var getMessageSenderId, extractMessageData, statusRank, preferHigherStatus, mergeLastMessage, messageHasPreviewBody, getLatestMessageFromList, isOwnMessage, getMessageContent, getMessageTimestamp, resolveMessageStatus, mergeChatMessages;
559
559
  var init_message_helpers = __esm({
560
560
  "src/store/helpers/message.helpers.ts"() {
561
561
  getMessageSenderId = (message) => String(message?.sender?._id || message?.sender?.id || message?.senderId || message?.fromUserId || message?.sender || "");
@@ -570,21 +570,32 @@ var init_message_helpers = __esm({
570
570
  const caption = payload.caption ?? payload.message?.caption ?? null;
571
571
  return { messageId, content, conversationId, status, isPinned, isStarred, attachmentId, caption };
572
572
  };
573
+ statusRank = { sent: 0, delivered: 1, read: 2 };
574
+ preferHigherStatus = (base, incoming) => {
575
+ const baseRank = statusRank[base?.status] ?? 0;
576
+ const incomingRank = statusRank[incoming?.status] ?? 0;
577
+ if (incomingRank > baseRank) {
578
+ return { ...base, status: incoming.status };
579
+ }
580
+ return base;
581
+ };
573
582
  mergeLastMessage = (existing, incoming) => {
574
583
  if (!incoming) return existing ?? null;
575
584
  if (!existing) return incoming;
576
585
  const content = incoming.content?.trim() ? incoming.content : existing.content;
577
586
  const createdAt = incoming.createdAt ?? incoming.timestamp ?? existing.createdAt ?? existing.timestamp;
578
- const existingTime = new Date(existing.createdAt || existing.timestamp || 0).getTime();
579
- const incomingTime = new Date(incoming.createdAt || incoming.timestamp || 0).getTime();
580
- const newer = incomingTime >= existingTime ? incoming : existing;
587
+ const incomingSenderId = getMessageSenderId(incoming);
588
+ const resolvedSender = incomingSenderId ? incoming.sender ?? incoming.senderId ?? incoming.fromUserId : existing.sender ?? existing.senderId ?? existing.fromUserId ?? incoming.sender;
581
589
  return {
582
590
  ...existing,
583
591
  ...incoming,
584
592
  ...content !== void 0 ? { content } : {},
585
593
  ...createdAt !== void 0 ? { createdAt } : {},
586
594
  attachments: incoming.attachments?.length ? incoming.attachments : existing.attachments,
587
- status: newer.status ?? existing.status ?? incoming.status
595
+ status: preferHigherStatus(existing, incoming).status ?? existing.status ?? incoming.status,
596
+ ...resolvedSender !== void 0 ? { sender: resolvedSender } : {},
597
+ senderId: incoming.senderId ?? existing.senderId,
598
+ fromUserId: incoming.fromUserId ?? existing.fromUserId
588
599
  };
589
600
  };
590
601
  messageHasPreviewBody = (message) => Boolean(String(message?.content || "").trim()) || Array.isArray(message?.attachments) && message.attachments.length > 0;
@@ -607,15 +618,6 @@ var init_message_helpers = __esm({
607
618
  const time = value ? new Date(value).getTime() : NaN;
608
619
  return Number.isFinite(time) ? time : 0;
609
620
  };
610
- statusRank = { sent: 0, delivered: 1, read: 2 };
611
- preferHigherStatus = (base, incoming) => {
612
- const baseRank = statusRank[base?.status] ?? 0;
613
- const incomingRank = statusRank[incoming?.status] ?? 0;
614
- if (incomingRank > baseRank) {
615
- return { ...base, status: incoming.status };
616
- }
617
- return base;
618
- };
619
621
  resolveMessageStatus = (message, conversation, loggedUserId) => {
620
622
  const existing = message?.status || "sent";
621
623
  if (!loggedUserId || !isOwnMessage(message, loggedUserId)) return existing;
@@ -790,7 +792,7 @@ var init_unread_helpers = __esm({
790
792
  });
791
793
 
792
794
  // src/store/helpers/conversation.helpers.ts
793
- var findConversationIdByMessageId, isGroupConversation, normalizeConversationRecord, resolveConversationLastMessage, syncConversationLastMessage, upsertConversationInList, findConversationById, findConversationForChannel, resolveConversationIdForChannel;
795
+ var findConversationIdByMessageId, applyMessageStatusToStore, isGroupConversation, normalizeConversationRecord, resolveConversationLastMessage, syncConversationLastMessage, upsertConversationInList, findConversationById, findConversationIdByLastMessageId, findConversationForChannel, resolveConversationIdForChannel;
794
796
  var init_conversation_helpers = __esm({
795
797
  "src/store/helpers/conversation.helpers.ts"() {
796
798
  init_group_display_helpers();
@@ -804,6 +806,40 @@ var init_conversation_helpers = __esm({
804
806
  )
805
807
  );
806
808
  };
809
+ applyMessageStatusToStore = (state, messageId, status, conversationId) => {
810
+ const normalizedMessageId = String(messageId);
811
+ const resolvedConversationId = conversationId ? String(conversationId) : findConversationIdByMessageId(state.messagesByConversation, normalizedMessageId) || findConversationIdByLastMessageId(state.conversations, normalizedMessageId) || null;
812
+ const nextConversations = state.conversations.map((conversation) => {
813
+ const lastMessageId = String(
814
+ conversation?.lastMessage?._id || conversation?.lastMessage?.id || ""
815
+ );
816
+ if (lastMessageId !== normalizedMessageId) return conversation;
817
+ return {
818
+ ...conversation,
819
+ lastMessage: mergeLastMessage(conversation.lastMessage, { status })
820
+ };
821
+ });
822
+ const nextMessagesByConversation = { ...state.messagesByConversation };
823
+ const patchMessages = (messages) => messages.map(
824
+ (message) => String(message._id || message.id) === normalizedMessageId ? preferHigherStatus(message, { status }) : message
825
+ );
826
+ if (resolvedConversationId && nextMessagesByConversation[resolvedConversationId]) {
827
+ nextMessagesByConversation[resolvedConversationId] = patchMessages(
828
+ nextMessagesByConversation[resolvedConversationId]
829
+ );
830
+ } else {
831
+ for (const cid of Object.keys(nextMessagesByConversation)) {
832
+ const patched = patchMessages(nextMessagesByConversation[cid]);
833
+ if (patched !== nextMessagesByConversation[cid]) {
834
+ nextMessagesByConversation[cid] = patched;
835
+ }
836
+ }
837
+ }
838
+ return {
839
+ conversations: nextConversations,
840
+ messagesByConversation: nextMessagesByConversation
841
+ };
842
+ };
807
843
  isGroupConversation = (conversation) => {
808
844
  if (!conversation) return false;
809
845
  return conversation.conversationType === "group" || !!conversation.isGroup;
@@ -893,6 +929,14 @@ var init_conversation_helpers = __esm({
893
929
  if (!conversationId) return void 0;
894
930
  return conversations.find((c) => String(c._id) === String(conversationId));
895
931
  };
932
+ findConversationIdByLastMessageId = (conversations, messageId) => {
933
+ if (!messageId) return null;
934
+ const normalizedMessageId = String(messageId);
935
+ const match = conversations.find(
936
+ (conversation) => String(conversation?.lastMessage?._id || conversation?.lastMessage?.id || "") === normalizedMessageId
937
+ );
938
+ return match?._id ? String(match._id) : null;
939
+ };
896
940
  findConversationForChannel = (channel, loggedUserId, conversations) => {
897
941
  if (!channel || !loggedUserId) return void 0;
898
942
  if (channel.conversationId) {
@@ -2965,28 +3009,16 @@ var init_dm_actions = __esm({
2965
3009
  },
2966
3010
  receivedStatusUpdate: (payload) => {
2967
3011
  const data = extractMessageData(payload);
2968
- let { conversationId } = data;
2969
3012
  const { messageId, status } = data;
2970
- if (!messageId) return;
3013
+ let { conversationId } = data;
3014
+ if (!messageId || !status) return;
2971
3015
  set({ lastStatusUpdate: payload });
2972
3016
  if (!conversationId) {
2973
- conversationId = findConversationIdByMessageId(get().messagesByConversation, messageId);
3017
+ conversationId = findConversationIdByMessageId(get().messagesByConversation, messageId) || findConversationIdByLastMessageId(get().conversations, messageId) || void 0;
2974
3018
  }
2975
- if (!conversationId || !status) return;
2976
- set((state) => {
2977
- const messages = state.messagesByConversation[conversationId] || [];
2978
- return {
2979
- messagesByConversation: {
2980
- ...state.messagesByConversation,
2981
- [conversationId]: messages.map(
2982
- (m) => String(m._id || m.id) === String(messageId) ? preferHigherStatus(m, { status }) : m
2983
- )
2984
- },
2985
- conversations: state.conversations.map(
2986
- (c) => String(c._id) === String(conversationId) && c.lastMessage && String(c.lastMessage._id || c.lastMessage.id) === String(messageId) ? { ...c, lastMessage: mergeLastMessage(c.lastMessage, { status }) } : c
2987
- )
2988
- };
2989
- });
3019
+ set((state) => ({
3020
+ ...applyMessageStatusToStore(state, String(messageId), status, conversationId)
3021
+ }));
2990
3022
  },
2991
3023
  receivedDMMarkRead: (payload) => {
2992
3024
  const { conversationId } = payload;
@@ -3247,25 +3279,14 @@ var init_group_actions2 = __esm({
3247
3279
  let { conversationId } = data;
3248
3280
  const { messageId, status } = data;
3249
3281
  set({ lastStatusUpdate: payload });
3282
+ if (!status) return;
3250
3283
  if (messageId) {
3251
3284
  if (!conversationId) {
3252
- conversationId = findConversationIdByMessageId(get().messagesByConversation, messageId);
3285
+ conversationId = findConversationIdByMessageId(get().messagesByConversation, messageId) || findConversationIdByLastMessageId(get().conversations, messageId) || void 0;
3253
3286
  }
3254
- if (!conversationId) return;
3255
- set((state) => {
3256
- const messages = state.messagesByConversation[conversationId] || [];
3257
- return {
3258
- messagesByConversation: {
3259
- ...state.messagesByConversation,
3260
- [conversationId]: messages.map(
3261
- (m) => String(m._id || m.id) === String(messageId) ? { ...m, status } : m
3262
- )
3263
- },
3264
- conversations: state.conversations.map(
3265
- (c) => String(c._id) === String(conversationId) && c.lastMessage && String(c.lastMessage._id || c.lastMessage.id) === String(messageId) ? { ...c, lastMessage: { ...c.lastMessage, status } } : c
3266
- )
3267
- };
3268
- });
3287
+ set((state) => ({
3288
+ ...applyMessageStatusToStore(state, String(messageId), status, conversationId)
3289
+ }));
3269
3290
  return;
3270
3291
  }
3271
3292
  if (conversationId && status === "read") {
@@ -3280,7 +3301,7 @@ var init_group_actions2 = __esm({
3280
3301
  if (String(c._id) !== String(conversationId)) return c;
3281
3302
  let nextLastMessage = c.lastMessage;
3282
3303
  if (nextLastMessage && String(nextLastMessage.sender?._id || nextLastMessage.sender) === String(myId)) {
3283
- nextLastMessage = { ...nextLastMessage, status: "read" };
3304
+ nextLastMessage = mergeLastMessage(nextLastMessage, { status: "read" });
3284
3305
  }
3285
3306
  return { ...c, lastMessage: nextLastMessage };
3286
3307
  });
@@ -6795,15 +6816,13 @@ function useChannelList({ debouncedSearch = "" }) {
6795
6816
  }
6796
6817
  }
6797
6818
  const draftPreview = getConversationDraftPreview(conversationId);
6798
- const lastMsgSenderId = String(
6799
- resolvedLastMessage?.sender?._id || resolvedLastMessage?.sender || ""
6800
- );
6801
- const isOwnLastMessage = lastMsgSenderId === String(loggedUserDetails?._id);
6802
- const lastMessageStatus = resolveMessageStatus(
6803
- resolvedLastMessage,
6804
- c,
6805
- loggedUserDetails?._id
6806
- );
6819
+ const storedLastMessage = c.lastMessage;
6820
+ const storedLastMessageId = String(storedLastMessage?._id || storedLastMessage?.id || "");
6821
+ const resolvedLastMessageId = String(resolvedLastMessage?._id || resolvedLastMessage?.id || "");
6822
+ const lastMessageStatus = storedLastMessageId && resolvedLastMessageId && storedLastMessageId === resolvedLastMessageId ? preferHigherStatus(
6823
+ { status: storedLastMessage?.status },
6824
+ { status: resolvedLastMessage?.status }
6825
+ ).status ?? storedLastMessage?.status ?? resolvedLastMessage?.status : storedLastMessage?.status;
6807
6826
  return {
6808
6827
  id: isGroup ? conversationId : otherParticipantId,
6809
6828
  conversationId,
@@ -6817,12 +6836,11 @@ function useChannelList({ debouncedSearch = "" }) {
6817
6836
  unreadCount,
6818
6837
  isTyping,
6819
6838
  draftPreview,
6820
- isOwnLastMessage,
6821
6839
  pinnedCount: c.pinnedCount,
6822
6840
  starredCount: c.starredCount,
6823
6841
  lastMessage: {
6824
6842
  content: lastMessageContent,
6825
- timestamp: resolvedLastMessage?.createdAt ? formatSidebarTime(resolvedLastMessage.createdAt) : "",
6843
+ timestamp: resolvedLastMessage?.createdAt ? formatSidebarTime(resolvedLastMessage.createdAt) : c.lastMessage?.createdAt ? formatSidebarTime(c.lastMessage.createdAt) : "",
6826
6844
  status: lastMessageStatus,
6827
6845
  sender: "User"
6828
6846
  }
@@ -6851,7 +6869,7 @@ function useChannelList({ debouncedSearch = "" }) {
6851
6869
  init_store_helpers();
6852
6870
  function ChannelListItem({ channel, activeChannel, onChannelSelect }) {
6853
6871
  const isActive = activeChannel?.conversationId ? String(activeChannel.conversationId) === String(channel.conversationId) : activeChannel?.id === channel.id;
6854
- const showReadReceipt = channel.isOwnLastMessage && !channel.unreadCount && !channel.isTyping && !channel.draftPreview;
6872
+ const showReadReceipt = !!channel.lastMessage?.status && !channel.unreadCount && !channel.isTyping && !channel.draftPreview;
6855
6873
  const lastStatus = channel.lastMessage?.status;
6856
6874
  return /* @__PURE__ */ jsxs(
6857
6875
  "div",
@@ -8520,24 +8538,11 @@ function GroupSenderName({ name, className }) {
8520
8538
  }
8521
8539
 
8522
8540
  // src/chat/lib/chat-message-bubble.ts
8523
- function getBubbleCornerClasses(isSender, isGroupedWithPrev, isGroupedWithNext) {
8524
- if (isSender) {
8525
- return cn(
8526
- "rounded-tl-[18px] rounded-bl-[18px]",
8527
- isGroupedWithPrev ? "rounded-tr-[6px]" : "rounded-tr-[18px]",
8528
- isGroupedWithNext ? "rounded-br-[6px]" : "rounded-br-[4px]"
8529
- );
8530
- }
8531
- return cn(
8532
- "rounded-tr-[18px] rounded-br-[18px]",
8533
- isGroupedWithPrev ? "rounded-tl-[6px]" : "rounded-tl-[18px]",
8534
- isGroupedWithNext ? "rounded-bl-[6px]" : "rounded-bl-[4px]"
8535
- );
8541
+ function getBubbleCornerClasses() {
8542
+ return "rounded-tl-[18px] rounded-tr-[18px] rounded-br-[18px] rounded-bl-none";
8536
8543
  }
8537
8544
  function getChatBubbleClasses({
8538
8545
  isSender = false,
8539
- isGroupedWithPrev = false,
8540
- isGroupedWithNext = false,
8541
8546
  surface,
8542
8547
  className
8543
8548
  }) {
@@ -8545,7 +8550,7 @@ function getChatBubbleClasses({
8545
8550
  const isNeutral = resolvedSurface === "neutral";
8546
8551
  return cn(
8547
8552
  "relative",
8548
- getBubbleCornerClasses(isSender, isGroupedWithPrev, isGroupedWithNext),
8553
+ getBubbleCornerClasses(),
8549
8554
  resolvedSurface === "sent" && "chat-bubble-sent bg-(--chat-theme) text-white",
8550
8555
  resolvedSurface === "received" && "chat-bubble-received border border-(--chat-border)/60 bg-(--chat-incoming-bubble) text-(--chat-incoming-text)",
8551
8556
  isNeutral && "chat-bubble-received border border-(--chat-border)/60 bg-(--chat-incoming-bubble) text-(--chat-incoming-text)",
@@ -10339,11 +10344,12 @@ function MessageAttachmentsView({
10339
10344
  const isImageOnlyBubble = isBubbleLayout && nonImages.length === 0 && images.length > 0;
10340
10345
  const showImageMetaOverlay = isImageOnlyBubble && !hasMessageCaption && !anyImageHasCaption && !attachmentSelectionMode;
10341
10346
  const showCaptionBar = showBottomBar && (!isImageOnlyBubble || hasMessageCaption);
10342
- const bubbleSurface = !isBubbleLayout ? void 0 : isImageOnlyBubble && !hasMessageCaption && !anyImageHasCaption ? "media" : isSender ? "sent" : "received";
10347
+ const canShowSenderName = !!isGroup && !isSender && !!showSenderLabel && !!senderName;
10348
+ const showForwardedInHeader = isBubbleLayout && isForwarded;
10349
+ const bubbleSurface = !isBubbleLayout ? void 0 : isImageOnlyBubble && !hasMessageCaption && !anyImageHasCaption && !isForwarded && !canShowSenderName ? "media" : isSender ? "sent" : "received";
10343
10350
  const metaTimeClass = showImageMetaOverlay ? "text-white/90" : isSender ? "text-white/70" : "text-(--chat-muted)";
10344
10351
  const metaBorderClass = isSender ? "border-white/15" : "border-(--chat-border)/40";
10345
10352
  const metaBadgeVariant = showImageMetaOverlay || isBubbleLayout && isSender ? "on-dark" : "default";
10346
- const isForwardedImageOnly = isBubbleLayout && isForwarded && isImageOnlyBubble;
10347
10353
  return /* @__PURE__ */ jsxs(
10348
10354
  "div",
10349
10355
  {
@@ -10360,33 +10366,38 @@ function MessageAttachmentsView({
10360
10366
  "relative w-full",
10361
10367
  isBubbleLayout && getChatBubbleClasses({
10362
10368
  isSender,
10363
- isGroupedWithPrev,
10364
- isGroupedWithNext,
10365
10369
  surface: bubbleSurface,
10366
10370
  className: cn(
10367
- isImageOnlyBubble ? "p-0" : isForwarded ? "px-2 py-0.5" : "px-2.5 py-1"
10371
+ isImageOnlyBubble ? "overflow-hidden p-0" : isForwarded || canShowSenderName ? "px-2 py-0.5" : "px-2.5 py-1"
10368
10372
  )
10369
10373
  })
10370
10374
  ),
10371
10375
  children: [
10372
- !isSender && showSenderLabel && senderName && /* @__PURE__ */ jsx("div", { className: "px-0.5 pb-1", children: /* @__PURE__ */ jsx(GroupSenderName, { name: senderName }) }),
10373
- isBubbleLayout && isForwarded && !isForwardedImageOnly && /* @__PURE__ */ jsx(MessageForwardedLabel, { isSender, className: "px-0 pt-0 pb-0" }),
10376
+ (canShowSenderName || showForwardedInHeader) && /* @__PURE__ */ jsxs(
10377
+ "div",
10378
+ {
10379
+ className: cn(
10380
+ "relative z-10 flex min-w-0 flex-col gap-0.5",
10381
+ isImageOnlyBubble ? "px-2.5 pt-1.5 pb-1" : "px-0.5 pb-0.5"
10382
+ ),
10383
+ children: [
10384
+ canShowSenderName ? /* @__PURE__ */ jsx(GroupSenderName, { name: senderName }) : null,
10385
+ showForwardedInHeader ? /* @__PURE__ */ jsx(
10386
+ MessageForwardedLabel,
10387
+ {
10388
+ isSender,
10389
+ className: "px-0 pt-0 pb-0"
10390
+ }
10391
+ ) : null
10392
+ ]
10393
+ }
10394
+ ),
10374
10395
  isBubbleLayout && replySnippet ? /* @__PURE__ */ jsx("div", { className: "px-2 pb-1", children: replySnippet }) : null,
10375
10396
  /* @__PURE__ */ jsxs("div", { className: cn(
10376
10397
  "flex w-full flex-col",
10377
10398
  !isImageOnlyBubble && "gap-0",
10378
- isImageOnlyBubble && "relative overflow-hidden rounded-[inherit]"
10399
+ isImageOnlyBubble && "relative overflow-hidden"
10379
10400
  ), children: [
10380
- isForwardedImageOnly && /* @__PURE__ */ jsx(
10381
- "div",
10382
- {
10383
- className: cn(
10384
- "pointer-events-none absolute inset-x-0 top-0 z-20 px-2 py-0.5",
10385
- isSender ? "bg-linear-to-b from-(--chat-theme)/95 via-(--chat-theme)/55 to-transparent" : "bg-linear-to-b from-(--chat-incoming-bubble)/95 via-(--chat-incoming-bubble)/55 to-transparent"
10386
- ),
10387
- children: /* @__PURE__ */ jsx(MessageForwardedLabel, { isSender, overlay: true, className: "px-0 pt-0 pb-0" })
10388
- }
10389
- ),
10390
10401
  /* @__PURE__ */ jsx(
10391
10402
  MessageAttachmentsImageSection,
10392
10403
  {
@@ -13822,10 +13833,9 @@ function MessageItemTextBubble({
13822
13833
  }) {
13823
13834
  const bubbleClasses = (extra) => getChatBubbleClasses({
13824
13835
  isSender,
13825
- isGroupedWithPrev,
13826
- isGroupedWithNext,
13827
13836
  className: extra
13828
13837
  });
13838
+ const canShowSenderName = !!isGroup && !isSender && !!showSenderLabel && !!senderName;
13829
13839
  return /* @__PURE__ */ jsxs(
13830
13840
  "div",
13831
13841
  {
@@ -13833,15 +13843,17 @@ function MessageItemTextBubble({
13833
13843
  bubbleClasses(
13834
13844
  cn(
13835
13845
  "flex min-w-[72px] flex-col transition-all duration-200",
13836
- isForwarded ? "gap-0.5 px-2.5 py-1.5 text-[13px]" : "gap-1 px-3.5 py-2.5 text-[14px]"
13846
+ canShowSenderName ? "gap-0.5 px-2.5 py-1.5 text-[14px]" : isForwarded ? "gap-0.5 px-2.5 py-1.5 text-[13px]" : "gap-1 px-3.5 py-2.5 text-[14px]"
13837
13847
  )
13838
13848
  ),
13839
13849
  isPending && "opacity-70",
13840
13850
  isHighlighted && (isSender ? "ring-2 ring-amber-300/60" : "ring-2 ring-amber-200/60")
13841
13851
  ),
13842
13852
  children: [
13843
- isForwarded && /* @__PURE__ */ jsx(MessageForwardedLabel, { isSender, className: "px-0 pt-0 pb-0" }),
13844
- !isSender && showSenderLabel && senderName && /* @__PURE__ */ jsx(GroupSenderName, { name: senderName, className: "mb-0.5" }),
13853
+ (canShowSenderName || isForwarded) && /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
13854
+ canShowSenderName ? /* @__PURE__ */ jsx(GroupSenderName, { name: senderName }) : null,
13855
+ isForwarded ? /* @__PURE__ */ jsx(MessageForwardedLabel, { isSender, className: "px-0 pt-0 pb-0" }) : null
13856
+ ] }),
13845
13857
  /* @__PURE__ */ jsx(
13846
13858
  MessageReplySnippet_default,
13847
13859
  {
@@ -14116,8 +14128,6 @@ function MessageItemView(props) {
14116
14128
  const showMessageSelectionRadio = selectionMode && !isDeletedForEveryone && !!mid && !hasMultiAttachments;
14117
14129
  const bubbleClasses = (extra) => getChatBubbleClasses({
14118
14130
  isSender,
14119
- isGroupedWithPrev,
14120
- isGroupedWithNext,
14121
14131
  className: extra
14122
14132
  });
14123
14133
  return /* @__PURE__ */ jsxs(
@@ -16871,7 +16881,7 @@ var DefaultChannelListItem = ({
16871
16881
  onSelect
16872
16882
  }) => {
16873
16883
  const { slotClassName } = useChatCustomizationOptional();
16874
- const showReadReceipt = channel.isOwnLastMessage && !channel.unreadCount && !channel.isTyping && !channel.draftPreview;
16884
+ const showReadReceipt = !!channel.lastMessage?.status && !channel.unreadCount && !channel.isTyping && !channel.draftPreview;
16875
16885
  const lastStatus = channel.lastMessage?.status;
16876
16886
  return /* @__PURE__ */ jsxs(
16877
16887
  "div",