1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 03:14:39 +01:00

Properly update database on updateUserName

This commit is contained in:
Daniil Gentili 2022-05-11 14:22:49 +02:00
parent a6a64d608a
commit c0e742f147
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 4 additions and 1 deletions

View File

@ -640,7 +640,7 @@ trait PeerHandler
$this->logger->logger($e); $this->logger->logger($e);
} }
if (isset($dbres['ok']) && $dbres['ok']) { 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); return yield from $this->getInfo($id, $type, false);
} }
} }

View File

@ -291,6 +291,9 @@ trait UpdateHandler
yield from $this->getConfig(); yield from $this->getConfig();
} }
if (\in_array($update['_'], ['updateUserName', 'updateUserPhone', 'updateUserBlocked', 'updateUserPhoto', 'updateContactRegistered', 'updateContactLink']) && $this->getSettings()->getDb()->getEnableFullPeerDb()) { 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); $id = $this->getId($update);
$chat = yield $this->full_chats[$id]; $chat = yield $this->full_chats[$id];
$chat['last_update'] = 0; $chat['last_update'] = 0;