canSendNotification method
The power level requirements for specific notification types.
Implementation
bool canSendNotification(String userid, {String notificationType = 'room'}) {
final userLevel = getPowerLevelByUserId(userid);
final notificationLevel = getState(EventTypes.RoomPowerLevels)
?.content
.tryGetMap<String, Object?>('notifications')
?.tryGet<int>(notificationType) ??
50;
return userLevel >= notificationLevel;
}