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

Fixes to logger updateSettings, getReply and FilterReplyToSelf.

This commit is contained in:
Daniil Gentili 2023-07-22 13:57:53 +02:00
parent 82eeeae7bf
commit 937f67102a
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
3 changed files with 4 additions and 4 deletions

View File

@ -119,7 +119,7 @@ abstract class AbstractMessage extends Update implements SimpleFilters
*/
public function getReply(string $class = AbstractMessage::class): ?self
{
if (!\is_subclass_of($class, AbstractMessage::class)) {
if ($class !== AbstractMessage::class && !\is_subclass_of($class, AbstractMessage::class)) {
throw new AssertionError("A class that extends AbstractMessage was expected.");
}
if ($this->replyToMsgId === null) {

View File

@ -14,6 +14,6 @@ final class FilterReplyToSelf extends Filter
{
public function apply(Update $update): bool
{
return $update instanceof Message && $update->getReply()->out;
return $update instanceof Message && $update->getReply()?->out;
}
}

View File

@ -98,8 +98,8 @@ final class Logger extends SettingsAbstract
public function __sleep()
{
return $this->extra instanceof Closure
? ['type', 'extra', 'level', 'maxSize']
: ['type', 'level', 'maxSize'];
? ['type', 'level', 'maxSize']
: ['type', 'extra', 'level', 'maxSize'];
}
/**
* Wakeup function.