diff --git a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php index 16b67aeac..656aa27f3 100644 --- a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php @@ -640,7 +640,7 @@ trait PeerHandler $this->logger->logger($e); } if (isset($dbres['ok']) && $dbres['ok']) { - yield from $this->resolveUsername('@'.$dbres['result']); + yield from $this->resolveUsername($dbres['result']); return yield from $this->getInfo($id, $type, false); } } diff --git a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php index 00bfb7b02..b2efced98 100644 --- a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php @@ -291,6 +291,9 @@ trait UpdateHandler yield from $this->getConfig(); } if (\in_array($update['_'], ['updateUserName', 'updateUserPhone', 'updateUserBlocked', 'updateUserPhoto', 'updateContactRegistered', 'updateContactLink']) && $this->getSettings()->getDb()->getEnableFullPeerDb()) { + if ($update['_'] === 'updateUserName') { + $update = yield from $this->resolveUsername($update['username'])['peer']; + } $id = $this->getId($update); $chat = yield $this->full_chats[$id]; $chat['last_update'] = 0;