. * * @author Amir Hossein Jafari * @copyright 2016-2023 Amir Hossein Jafari * @license https://opensource.org/licenses/AGPL-3.0 AGPLv3 * @link https://docs.madelineproto.xyz MadelineProto documentation */ namespace danog\MadelineProto\EventHandler; use danog\MadelineProto\EventHandler\Privacy\AbstractRule; use danog\MadelineProto\EventHandler\Privacy\Key; use danog\MadelineProto\MTProto; /** * Indicates some privacy rules for a user or set of users. */ final class Privacy extends Update { /** New privacy rule. */ public readonly Key $key; /** Peers to which the privacy rules apply */ public readonly array $rules; /** @internal */ public function __construct(MTProto $API, array $rawPrivacy) { parent::__construct($API); $this->key = Key::fromRawKey($rawPrivacy['key']['_']); $this->rules = \array_map(AbstractRule::fromRawRule(...), $rawPrivacy['rules']); } }