hasRoomUpdate property

bool hasRoomUpdate

Returns true if this sync updat has a room update That means there is account data, if there is a room in one of the join, leave or invite blocks of the sync or if there is a to_device event.

Implementation

bool get hasRoomUpdate {
  // if we have an account data change we need to re-render, as `m.direct` might have changed
  if (accountData?.isNotEmpty ?? false) {
    return true;
  }
  // check for a to_device event
  if (toDevice?.isNotEmpty ?? false) {
    return true;
  }
  // return if there are rooms to update
  return (rooms?.join?.isNotEmpty ?? false) ||
      (rooms?.invite?.isNotEmpty ?? false) ||
      (rooms?.leave?.isNotEmpty ?? false);
}