1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-12-03 21:37:49 +01:00
This commit is contained in:
Daniil Gentili 2023-09-07 21:41:17 +02:00
parent b3f1624c6a
commit b079223deb
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -24,6 +24,7 @@ use danog\MadelineProto\Logger;
use danog\MadelineProto\Loop\Update\SecretFeedLoop; use danog\MadelineProto\Loop\Update\SecretFeedLoop;
use danog\MadelineProto\Loop\Update\UpdateLoop; use danog\MadelineProto\Loop\Update\UpdateLoop;
use danog\MadelineProto\MTProtoTools\Crypt; use danog\MadelineProto\MTProtoTools\Crypt;
use danog\MadelineProto\MTProtoTools\DialogId;
use danog\MadelineProto\PeerNotInDbException; use danog\MadelineProto\PeerNotInDbException;
use danog\MadelineProto\RPCErrorException; use danog\MadelineProto\RPCErrorException;
use danog\MadelineProto\SecurityException; use danog\MadelineProto\SecurityException;
@ -316,6 +317,9 @@ trait AuthKeyHandler
*/ */
public function getSecretChat(array|int $chat): array public function getSecretChat(array|int $chat): array
{ {
if (is_int($chat) && DialogId::isSecretChat($chat)) {
$chat = DialogId::toSecretChatId($chat);
}
return $this->secret_chats[\is_array($chat) ? $chat['chat_id'] : $chat]; return $this->secret_chats[\is_array($chat) ? $chat['chat_id'] : $chat];
} }
/** /**