isEditable method

bool isEditable(
  1. Chat chat,
  2. UserId me
)

Indicates whether this ChatItem is editable.

Implementation

bool isEditable(Chat chat, UserId me) {
  if (author.id == me) {
    if (this is ChatMessage) {
      bool isRead = chat.isRead(this, me);
      return at
              .add(ChatController.editMessageTimeout)
              .isAfter(PreciseDateTime.now()) ||
          !isRead;
    }
  }

  return false;
}