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

Fix issue in DialogTopicEdited

This commit is contained in:
Daniil Gentili 2023-09-16 19:34:11 +02:00
parent 9c6adbd24a
commit 2514334e6b
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
3 changed files with 25 additions and 10 deletions

View File

@ -29,14 +29,30 @@ final class DialogTopicEdited extends ServiceMessage
array $rawMessage, array $rawMessage,
array $info, array $info,
/** Topic name. */ /**
* If not null, indicates that the topic name has changed, contains the new topic name.
*
* Ignore this field if null.
*/
public readonly ?string $title, public readonly ?string $title,
/** ID of the [custom emoji](https://core.telegram.org/api/custom-emoji) used as topic icon. */ /**
* If not null, indicates that the topic icon has changed, and contains the ID of the new [custom emoji](https://core.telegram.org/api/custom-emoji) used as topic icon (0 if it was removed).
*
* Ignore this field if null.
*/
public readonly ?int $iconEmojiId, public readonly ?int $iconEmojiId,
/** Whether the topic was closed. */ /**
public readonly bool $closed, * If not null, indicates whether the topic was opened or closed.
/** Whether the topic was hidden (only valid for the “General” topic, id=1). */ *
public readonly bool $hidden * Ignore this field if null.
*/
public readonly ?bool $closed,
/**
* If not null, indicates whether the topic was hidden or unhidden (only valid for the “General” topic, id=1).
*
* Ignore this field if null.
*/
public readonly ?bool $hidden
) { ) {
parent::__construct($API, $rawMessage, $info); parent::__construct($API, $rawMessage, $info);
} }

View File

@ -601,8 +601,8 @@ trait UpdateHandler
$info, $info,
$message['action']['title'] ?? null, $message['action']['title'] ?? null,
$message['action']['icon_emoji_id'] ?? null, $message['action']['icon_emoji_id'] ?? null,
$message['action']['closed'], $message['action']['closed'] ?? null,
$message['action']['hidden'], $message['action']['hidden'] ?? null,
), ),
'messageActionSuggestProfilePhoto' => new DialogSuggestProfilePhoto( 'messageActionSuggestProfilePhoto' => new DialogSuggestProfilePhoto(
$this, $this,

View File

@ -8,8 +8,7 @@ require 'vendor/autoload.php';
$settings = new AppInfo; $settings = new AppInfo;
// Published test API ID from https://github.com/DrKLO/Telegram/blob/master/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java#L29 // Published test API ID from https://github.com/DrKLO/Telegram/blob/master/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java#L29
// Can only be used for a handshake, login won't work, get your own @ my.telegram.org. // Can only be used for a handshake, login won't work, get your own API ID/hash @ my.telegram.org to fix.
$settings->setApiId(4)->setApiHash('014b35b6184100b085b0d0572f9b5103'); $settings->setApiId(4)->setApiHash('014b35b6184100b085b0d0572f9b5103');
$test = new API('/tmp/handshake_'.random_int(0, PHP_INT_MAX).'.madeline', $settings); $test = new API('/tmp/handshake_'.random_int(0, PHP_INT_MAX).'.madeline', $settings);