canSendDefaultStates property

bool get canSendDefaultStates

The default level required to send state events. Can be overridden by the events key.

Implementation

bool get canSendDefaultStates {
  final powerLevelsMap = getState(EventTypes.RoomPowerLevels)?.content;
  if (powerLevelsMap == null) return 0 <= ownPowerLevel;
  return (getState(EventTypes.RoomPowerLevels)
              ?.content
              .tryGet<int>('state_default') ??
          50) <=
      ownPowerLevel;
}