Skip to content

Commit cb1f2f2

Browse files
committed
Fix initalization order
1 parent 4721c70 commit cb1f2f2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/MTProto.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,10 +634,10 @@ private function initialize(Settings|SettingsEmpty $settings): void
634634
{
635635
// Initialize needed stuffs
636636
Magic::start(light: false);
637-
// Actually instantiate needed classes like a boss
638-
$this->cleanupProperties();
639637
// Parse and store settings
640638
$this->updateSettingsInternal($settings, false);
639+
// Actually instantiate needed classes like a boss
640+
$this->cleanupProperties();
641641
// Load rsa keys
642642
$this->rsa_keys = [];
643643
foreach ($this->settings->getConnection()->getRSAKeys() as $key) {
@@ -1100,6 +1100,7 @@ private function upgradeMadelineProto(): void
11001100
$this->resetMTProtoSession("upgrading madelineproto", true, true);
11011101
$this->config = ['expires' => -1];
11021102
$this->dh_config = ['version' => 0];
1103+
$this->cleanupProperties();
11031104
$this->initialize($this->settings);
11041105
foreach ($this->secretChats as $chat) {
11051106
try {

0 commit comments

Comments
 (0)