@poolse/react-native 2.26.0 → 2.27.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/index.cjs CHANGED
@@ -4265,6 +4265,8 @@ function ConversationView({
4265
4265
  const theme = usePoolseTheme();
4266
4266
  const { me } = react$1.useMe();
4267
4267
  const meId = me?.id ?? null;
4268
+ const receiptsVisible = react$1.receiptsOf(me).visible;
4269
+ const showReadState = readReceipts && receiptsVisible;
4268
4270
  const {
4269
4271
  messages,
4270
4272
  loading,
@@ -4343,9 +4345,15 @@ function ConversationView({
4343
4345
  const custom = renderMessage(msg, meId);
4344
4346
  if (custom !== null && custom !== void 0) return custom;
4345
4347
  }
4346
- const readState = readReceipts && meId !== null && msg.sender_id === meId ? readStateForMessage(msg, members, meId, sequenceByMessageId) : void 0;
4348
+ const readState = showReadState && meId !== null && msg.sender_id === meId ? readStateForMessage(msg, members, meId, sequenceByMessageId) : void 0;
4347
4349
  const isSelf = meId !== null && msg.sender_id === meId;
4348
- const canEdit = isSelf && !msg.deleted_at && (readState ?? "sent") === "sent";
4350
+ const canEdit = react$1.canEditOwnMessage({
4351
+ isSelf,
4352
+ deleted: !!msg.deleted_at,
4353
+ receiptsVisible,
4354
+ readState,
4355
+ insertedAt: msg.inserted_at
4356
+ });
4349
4357
  const groupPosition = groupPositionById.get(msg.id) ?? "standalone";
4350
4358
  return /* @__PURE__ */ jsxRuntime.jsx(
4351
4359
  MessageRow,
@@ -4379,6 +4387,8 @@ function ConversationView({
4379
4387
  renderMessage,
4380
4388
  meId,
4381
4389
  readReceipts,
4390
+ showReadState,
4391
+ receiptsVisible,
4382
4392
  members,
4383
4393
  reactions,
4384
4394
  attachments,