@bcc-code/vue-bcc-chat-ui 7.1.5 → 7.1.6

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.
@@ -4383,7 +4383,7 @@ function ks({ environment: e }) {
4383
4383
  u.value = !0, g.value = null;
4384
4384
  try {
4385
4385
  let t;
4386
- e.kind === "text" ? t = new U.TextMessage(n.targetId, r, Xs(n)) : (t = new U.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, Xs(n)), t.setCaption?.(r)), t.setId?.(Number(e.id));
4386
+ e.kind === "text" ? t = new U.TextMessage(n.targetId, r, Xs(n)) : (t = new U.MediaMessage(n.targetId, e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "", e.source?.getType?.() ?? e.type ?? e.kind, Xs(n)), t.setCaption(r)), t.setId(Number(e.id));
4387
4387
  let i = await U.editMessage(t);
4388
4388
  Ct(N(i, _.value?.uid)), ht(i), O.value = null;
4389
4389
  } catch (e) {
@@ -4615,21 +4615,21 @@ function ks({ environment: e }) {
4615
4615
  let n = _.value?.uid;
4616
4616
  if (!n || !e.scheduled?.muid || e.kind === "poll") return;
4617
4617
  let r = ss(t);
4618
- if (!(e.kind === "text" && !ls(r))) {
4619
- d.value = !0;
4620
- try {
4621
- let t;
4622
- if (e.kind === "text") t = new U.TextMessage(n, r, U.RECEIVER_TYPE.GROUP);
4623
- else {
4624
- let i = e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "";
4625
- t = new U.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, U.RECEIVER_TYPE.GROUP), t.setCaption?.(r);
4626
- }
4627
- t.setId?.(Number(e.id)), await U.editMessage(t), await Ye(e.scheduled.originalChatUid);
4628
- } catch (e) {
4629
- throw g.value = Q(e, "Unable to edit the scheduled message."), e;
4630
- } finally {
4631
- d.value = !1;
4618
+ if (e.kind === "text" && !ls(r)) return;
4619
+ let i = { ...e.metadata ?? {} };
4620
+ !i.scheduleDate && e.scheduled?.scheduleDate && (i.scheduleDate = e.scheduled.scheduleDate.toISOString()), !i.originalChatUid && e.scheduled?.originalChatUid && (i.originalChatUid = e.scheduled.originalChatUid), d.value = !0;
4621
+ try {
4622
+ let t;
4623
+ if (e.kind === "text") t = new U.TextMessage(n, r, U.RECEIVER_TYPE.GROUP);
4624
+ else {
4625
+ let i = e.source?.getAttachment?.()?.getFileUrl?.() ?? e.source?.getAttachment?.()?.getUrl?.() ?? e.attachments[0]?.url ?? "";
4626
+ t = new U.MediaMessage(n, i, e.source?.getType?.() ?? e.type ?? e.kind, U.RECEIVER_TYPE.GROUP), t.setCaption(r);
4632
4627
  }
4628
+ Object.keys(i).length > 0 && t.setMetadata(i), t.setId(Number(e.id)), await U.editMessage(t), await Ye(e.scheduled.originalChatUid);
4629
+ } catch (e) {
4630
+ throw g.value = Q(e, "Unable to edit the scheduled message."), e;
4631
+ } finally {
4632
+ d.value = !1;
4633
4633
  }
4634
4634
  }
4635
4635
  async function $e(e) {