canPost property

bool get canPost

Best guess at whether a send from this account will be accepted. Unknown admin state counts as allowed; WhatsApp still has the final word.

Implementation

bool get canPost {
  switch (kind) {
    case WhatsappChatKind.user:
      return true;
    case WhatsappChatKind.group:
      return !announce || isAdmin != false;
    case WhatsappChatKind.newsletter:
      return role == null || role == 'owner' || role == 'admin';
  }
}