1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-26 23:34:44 +01:00

Fixe peer database

This commit is contained in:
Daniil Gentili 2024-04-11 20:19:19 +02:00
parent 0c25881c27
commit 2d03f871ee

View File

@ -57,17 +57,17 @@ final class PeerDatabase implements TLCallback
* *
* @var DbArray<int, array> * @var DbArray<int, array>
*/ */
#[OrmMappedArray(KeyType::INT, ValueType::SCALAR, tablePostfix: 'MTProto_chats')] #[OrmMappedArray(KeyType::INT, ValueType::SCALAR, tablePostfix: '_MTProto_chats')]
private $db; private $db;
/** /**
* @var DbArray<int, array> * @var DbArray<int, array>
*/ */
#[OrmMappedArray(KeyType::INT, ValueType::SCALAR, tablePostfix: 'MTProto_full_chats')] #[OrmMappedArray(KeyType::INT, ValueType::SCALAR, tablePostfix: '_MTProto_full_chats')]
private $fullDb; private $fullDb;
/** /**
* @var DbArray<string, int> * @var DbArray<string, int>
*/ */
#[OrmMappedArray(KeyType::STRING, ValueType::INT)] #[OrmMappedArray(KeyType::STRING, ValueType::INT, tablePostfix: '_PeerDatabase_usernames')]
private $usernames; private $usernames;
private bool $hasInfo = true; private bool $hasInfo = true;
private bool $hasUsernames = true; private bool $hasUsernames = true;
@ -95,7 +95,7 @@ final class PeerDatabase implements TLCallback
} }
public function init(): void public function init(): void
{ {
$this->initDbProperties($this->API->getDbSettings(), $this->API->getDbPrefix().'_PeerDatabase_'); $this->initDbProperties($this->API->getDbSettings(), $this->API->getDbPrefix());
if (!$this->API->settings->getDb()->getEnableFullPeerDb()) { if (!$this->API->settings->getDb()->getEnableFullPeerDb()) {
$this->fullDb->clear(); $this->fullDb->clear();
} }