1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 09:38:57 +01:00

Fix upgrades

This commit is contained in:
Daniil Gentili 2023-05-29 14:46:42 +02:00
parent 69fb21478a
commit 2a7e4f7833
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
7 changed files with 13 additions and 4 deletions

2
docs

@ -1 +1 @@
Subproject commit 34769aac6fa12a654ba8a1b88deaf08652c17928
Subproject commit 3a06041168b8d69b31e5de5c555d3c89a9042f6b

View File

@ -186,7 +186,7 @@ final class InternalState
}
}
});
if (count($promises) % 50 === 0) {
if (\count($promises) % 50 === 0) {
await($promises);
$promises = [];
}

View File

@ -90,16 +90,21 @@ abstract class DriverArray implements DbArray, IteratorAggregate
));
}
private bool $old = true;
public function __wakeup(): void
{
Magic::start(light: true);
$this->setSettings($this->dbSettings);
if ($this->old) {
$this->setSerializer(SerializerType::SERIALIZE);
}
}
public static function getInstance(string $table, DbType|array|null $previous, DatabaseAbstract $settings): static
{
/** @var MysqlArray|PostgresArray|RedisArray */
$instance = new static();
$instance->old = false;
$instance->setTable($table);
$instance->setSettings($settings);

View File

@ -1539,6 +1539,8 @@ abstract class InternalDoc
/**
* Subscribe to event handler updates for a channel/supergroup we're not a member of.
*
* @param mixed $channel Channel/supergroup to subscribe to
*
* @return bool False if we were already subscribed
*/
public function subscribeToUpdates(mixed $channel): bool

View File

@ -314,7 +314,7 @@ final class Logger
if (!self::$printed) {
self::$printed = true;
$this->colors[self::NOTICE] = \implode(';', [self::FOREGROUND['light_gray'], self::SET['bold'], self::BACKGROUND['blue']]);
$this->logger('MadelineProto');
$this->logger('MadelineProto '.MTProto::RELEASE);
$this->logger('Copyright (C) 2016-'.\date('Y').' Daniil Gentili');
$this->logger('Licensed under AGPLv3');
$this->logger('https://github.com/danog/MadelineProto');

View File

@ -139,7 +139,7 @@ final class MTProto implements TLCallback, LoggerGetter
*
* @var string
*/
const RELEASE = '8.0';
const RELEASE = '8.0.0-beta84';
/**
* We're not logged in.
*

View File

@ -457,6 +457,8 @@ trait UpdateHandler
/**
* Subscribe to event handler updates for a channel/supergroup we're not a member of.
*
* @param mixed $channel Channel/supergroup to subscribe to
*
* @return bool False if we were already subscribed
*/
public function subscribeToUpdates(mixed $channel): bool