1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-23 10:11:13 +01:00

Reinit auth as needed

This commit is contained in:
Daniil Gentili 2023-09-30 21:04:40 +02:00
parent 54c935a3ca
commit 552656da12
2 changed files with 4 additions and 6 deletions

View File

@ -76,13 +76,10 @@ class SecretHandler extends SimpleEventHandler
#[Handler] #[Handler]
public function handle(Incoming&SecretMessage $message): void public function handle(Incoming&SecretMessage $message): void
{ {
if(isset($message->media)) if ($message->media)
{ {
$path = $message->media->downloadToDir('/tmp'); $path = $message->media->downloadToDir('/tmp');
$this->sendPhoto( $message->reply($path);
peer: $message->senderId,
file: $message->media
);
} }
/*if (isset($this->sent[$update->chatId])) { /*if (isset($this->sent[$update->chatId])) {
return; return;

View File

@ -1206,6 +1206,7 @@ final class MTProto implements TLCallback, LoggerGetter
} }
if ($auth_key) { if ($auth_key) {
$socket->setTempAuthKey(null); $socket->setTempAuthKey(null);
EventLoop::queue($socket->initAuthorization(...));
} }
} }
} }