From 27e4c750b95d318933a57cdd38f0538babc29271 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 15 Apr 2024 22:03:06 +0200 Subject: [PATCH] Psalm fixes --- .woodpecker/.cs.yml | 14 +- psalm-baseline.xml | 7246 ++++++++++++++++++++++++++---- psalm.xml | 2 +- src/Ipc/ExitFailure.php | 2 +- src/Lang.php | 1 + src/Loop/Connection/ReadLoop.php | 4 +- src/Ogg.php | 1 + tools/translator.php | 1 + 8 files changed, 6390 insertions(+), 881 deletions(-) diff --git a/.woodpecker/.cs.yml b/.woodpecker/.cs.yml index 903273472..12b89937d 100644 --- a/.woodpecker/.cs.yml +++ b/.woodpecker/.cs.yml @@ -27,4 +27,16 @@ steps: - push commands: - apk add bash - - tests/test.sh cs \ No newline at end of file + - tests/test.sh cs + + psalm: + group: test + image: danog/madelineproto:next + when: + event: + - pull_request + - tag + - push + commands: + - apk add bash + - tests/test.sh psalm \ No newline at end of file diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 0ea66f49b..4253a9cdc 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,40 +1,57 @@ - + - $settings + __construct($this->session->getSessionDirectoryPath())]]> + + + + + + getFuture()]]> + + + + + + + + + - Logger::$default + - getMessage - wakeup + + - API - API - API - API - API - API - API - API - API - API - API - API - API - API - API - API - API - API - API - API + + + + + + + + + + + + + + + + + + + + + + 10]]> @@ -42,22 +59,25 @@ + + serializeSession($this)]]> + - logger + - $eventHandler + - getMessage - isInited - setEventHandler + + + - !$started - !$started + + 10]]> @@ -66,20 +86,72 @@ - APIStart + + + + + + + + + + + + + + + + + + + + + + + - \is_callable($callable) + + + + + + + + + + + + + + + + API->methodCallAsyncRead( + isset($message['media']) && ( + \is_string($message['media']) + || ( + isset($message['media']['_']) && + $message['media']['_'] !== 'messageMediaWebPage' + ) + ) + ? 'messages.sendMedia' + : 'messages.sendMessage', + array_merge($message, ['peer' => $peer, 'floodWaitLimit' => 2*86400, 'cancellation' => $cancellation]), + )]]> + + + + - $id + @@ -93,6 +165,9 @@ + + + filter->whitelist) && !\in_array($peer, $this->filter->whitelist, true)]]> @@ -105,15 +180,64 @@ getStream()]]> - $API - $datacenter - $shared + + + + + + + + + + + + + + + + getFile()]]> + getFile()]]> + + + + + + + API->getTL()->getConstructors()->findByPredicate($arguments['file']['_'])['type']]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + - getInputClientProxy - isHttp - refreshNextDisable - refreshNextEnable + + + + @@ -121,7 +245,7 @@ - $uri + @@ -129,59 +253,240 @@ + + $key]]]> + - $auth_key - $data - $data - $fileName - $fileName - $fp - $options - $options - $settings + + + + + + + + + - $tdesktop_base_path - $tdesktop_key - $tdesktop_user_base_path + + + - tdesktop - tdesktop_decrypt - tdesktop_fopen - tdesktop_fopen_encrypted - tdesktop_md5 - tdesktop_read_bytearray + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $session['auth_key']]]]> + + + + + + + + + + + + + + + + + + + + + $key]]]> + $session['auth_key']]]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - methodCallAsyncRead + - $part_one_md5 - $part_one_md5 + + - $dc - $main_dc_id + + - \is_string($dc) + + + + + + + API->dcList[$test][$ipv6]]]> + API->dcList[$test][$ipv6]]]> + API->dcList[$test][$ipv6][$dc_number]]]> + API->dcList[$test][$ipv6][$dc_number]]]> + API->dcList[$test][$ipv6][$dc_number]]]> + API->dcList[$test][$ipv6][$dc_number]['ip_address']]]> + API->dcList[$test][$ipv6][$dc_number]['port']]]> + API->dcList[$test][$ipv6][$dc_number]['secret']]]> + API->dcList[$test][$ipv6][$dc_number]['tcpo_only']]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - $default[2] - $default[2] + + - $API - $connectionsPromise - $datacenter + + + + + + + + + + + + + + - bind + hasTempAuthKey() @@ -193,214 +498,121 @@ permAuthKey =& $connection->permAuthKey]]> - - - ttl[$index])]]> - - - $cacheTtl - - - - Traversable - Traversable - - - - - $index - $index - $index - $index - - - - - $index - - - - - query("SHOW VARIABLES LIKE 'max_connections'")->fetchRow()['Value']]]> - - - - - $settings - $settings - $settings - - - DriverArray - - - $v - $value - $value - - - $v]]> - json_decode($value, true, 256, JSON_THROW_ON_ERROR)]]> - - $dbSettings - $dbSettings - $dbSettings - $dbSettings - $deserializer - $deserializer - $deserializer - $deserializer - $serializer - $serializer - $serializer - $serializer - $table - $table - $table - $table + - - $old - - - setSettings - - - new static() - + + + - - MemoryArray - MemoryArray - - - $array - $flags - - - $settings - - - - - dbSettings]]> - - - $stmt - - - $pdo - - - - - $v - $v - $v - $v - $v - $v - $v - $value - - - igbinary_unserialize(hex2bin($v))]]> - unserialize(hex2bin($v))]]> - json_decode(hex2bin($value), true, 256, JSON_THROW_ON_ERROR)]]> - - - - - dbSettings]]> - - - $v - $v - $v - $v - $v - $value - - - $v]]> - json_decode($value, true, 256, JSON_THROW_ON_ERROR)]]> - - - - - dbSettings]]> - - - $db - - - db->get($key)]]> - $value - - - - - $stmt - - - $db - $db - $db - - - fetchRow()['count']]]> - + + + + + + + + + + + + + + + + - $builtUri - $uri + + - - $webSocketConnector - + + + - $orig[1][0] === BufferedRawStream::class + - - Rfc6455Connector - - $class + + - - wrapper->getAPI()]]> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + periodicLoops]]> + ]]> + getParameters()[0]->getType()]]> - getDbPrefix - rethrowInner - rethrowInner + + + - self::$pluginCache + - array_values + startedInternal]]> startedInternal]]> - require $file + - new $class + @@ -419,34 +631,236 @@ $result )]]> + + + + + + + + + + methodCallAsyncRead( + 'stories.getPeerStories', + [ + 'peer' => $this->senderId, + ] + )['stories']]]> + methodCallAsyncRead( + 'stories.getStoriesByID', + [ + 'peer' => $this->senderId, + 'id' => array_column($result, 'id'), + ] + )['stories']]]> + + + + + + + + + + + + + + + + + + + + + + + getClient()->methodCallAsyncRead( + DialogId::isSupergroupOrChannel($this->chatId) ? 'channels.getMessages' : 'messages.getMessages', + [ + 'channel' => $this->chatId, + 'id' => [['_' => 'inputMessageReplyTo', 'id' => $this->id]], + ] + )['messages']]]> + + + + + + + + + + chatId]]> + date]]> + id]]> + mentioned]]> + out]]> + replyToMsgId]]> + replyToMsgId]]> + replyToMsgId]]> + replyToMsgId]]> + replyToScheduled]]> + senderId]]> + silent]]> + threadId]]> + threadId]]> + topicId]]> + topicId]]> + ttlPeriod]]> + + + getClient()->methodCallAsyncRead( + 'channels.readHistory', + [ + 'peer' => $this->chatId, + 'channel' => $this->chatId, + 'max_id' => $readAll ? 0 : $this->id, + ] + )]]> + getClient()->methodCallAsyncRead( + 'contacts.block', + [ + 'id' => $this->senderId, + ] + )]]> + getClient()->methodCallAsyncRead( + 'contacts.unblock', + [ + 'id' => $this->senderId, + ] + )]]> + getClient()->methodCallAsyncRead( + 'messages.setTyping', + [ + 'peer' => $this->senderId, + 'top_msg_id' => $this->topicId, + 'action' => $action, + ] + )]]> + getClient()->methodCallAsyncRead( + 'messages.togglePeerTranslations', + [ + 'peer' => $this->chatId, + 'disabled' => false, + ] + )]]> + getClient()->methodCallAsyncRead( + 'messages.togglePeerTranslations', + [ + 'peer' => $this->chatId, + 'disabled' => true, + ] + )]]> + - DialogSetTTL - DialogSetTTL + + ]]> wrapMessage($client->extractMessage($result))]]> wrapMessage($client->extractMessage($result))]]> + + + + + + + + + + + + + + + + + + + + + + + + + + getName()]]]> + closeDate]]> + closePeriod]]> + closed]]> + id]]> + question]]> + recentVoters]]> + totalVoters]]> + + - AbstractPrivateMessage - AbstractPrivateMessage + + + + + + + id]]> + getIdInternal($rawStory['peer'])]]> + + + + + + + + + + + + + + + + + + getName()]]]> + + + + + + + + getName()]]]> + accessHash]]> + description]]> + hash]]> + id]]> + name]]> + title]]> + wrapMedia($rawBotApp['document']) : null]]> wrapMedia($rawBotApp['photo']) : null]]> + + + + + botId]]> + getIdInternal($rawBotCommands['peer'])]]> @@ -457,7 +871,51 @@ )]]> + + + chatInstance]]> + queryId]]> + userId]]> + + + getClient()->methodCallAsyncRead( + 'messages.setBotCallbackAnswer', + [ + 'query_id' => $this->queryId, + 'message' => $message, + 'alert' => $alert, + 'url' => $url, + 'cache_time' => $cacheTime, + ], + )]]> + + + + + + + + + + actorId]]> + chatId]]> + date]]> + userId]]> + viaChatlist]]> + + + + + chatId]]> + forwards]]> + id]]> + + + + id]]> + views]]> + getIdInternal($rawMessageViews)]]> @@ -467,11 +925,63 @@ getIdInternal($rawUpdateChannel)]]> + + + getName()]]]> + + + + + + + + adminId]]> + created]]> + date]]> + expire]]> + limit]]> + link]]> + permanent]]> + requestNeeded]]> + requested]]> + revoked]]> + title]]> + used]]> + + getIdInternal($rawChatInviteRequester['peer'])]]> + + + + + + about]]> + date]]> + userId]]> + + + + + pending]]> + recent]]> + + + + + getName()]]]> + command]]> + description]]> + + + + + ids]]> + + getIdInternal($rawDelete)]]> @@ -484,22 +994,22 @@ - $peerResolved + - $peersResolved + - $peerResolved + - $adminIds + @@ -507,28 +1017,76 @@ API]]> - $API + - $peerResolved + - $matches - $matches - $matches - $matches + + + + + + + + + + + + + + offset]]> + query]]> + queryId]]> + userId]]> + + + + + + + + + + + + - $result + + + + + + + + + + creationDate]]> + keyFingerprint]]> + spoiler]]> + thumb]]> + thumbHeight]]> + thumbWidth]]> + ttl]]> + + + + getClient()->downloadToDir($this, $dir, $cb, $cancellation)]]> + getClient()->downloadToDir($this, $dir, $cb, $cancellation)]]> + getClient()->downloadToFile($this, $file, $cb, $cancellation)]]> + getClient()->downloadToFile($this, $file, $cb, $cancellation)]]> + - array{ + + * }]]> botApiFileId]]> botApiFileUniqueId]]> - $thumbs - $videoThumbs + + + + duration]]> + - AbstractAudio - AbstractAudio + + + + emoji]]> + stickerset]]> + - AbstractSticker - AbstractSticker + + + + duration]]> + height]]> + supportsStreaming]]> + width]]> + - AbstractVideo - AbstractVideo + + + + + + - AnimatedSticker - AnimatedSticker + + + + performer]]> + title]]> + - Audio - Audio + + + + + + + + free]]> + textColor]]> + - CustomEmoji - CustomEmoji + + - Document - Document + + + + + + + + height]]> + width]]> + $t]]]> + - DocumentPhoto - DocumentPhoto + + + + + accessHash]]> + accuracyRadius]]> + lat]]> + long]]> + + + + + + + + $t]]]> + + + getClient()->methodCallAsyncRead( + 'messages.saveGif', + [ + 'id' => $this->botApiFileId, + 'unsave' => false, + ] + )]]> + getClient()->methodCallAsyncRead( + 'messages.saveGif', + [ + 'id' => $this->botApiFileId, + 'unsave' => true, + ] + )]]> + - Gif - Gif + + + + + + + + + + + + + + + x]]> + y]]> + zoom]]> + - MaskSticker - MaskSticker + + + + + + + getName()]]]> + + storyId]]> + viaMention]]> + getIdInternal($rawMedia['peer'])]]> + + hasStickers]]> + - Photo - Photo + + - RoundVideo - RoundVideo + + + + + + - StaticSticker - StaticSticker + + - Sticker - Sticker + + + + + + + $t]]]> + - Video - Video + + + + + + + + duration]]> + - VideoSticker - VideoSticker + + + + waveform]]> + - Voice - Voice + + @@ -660,17 +1335,117 @@ getClient()->wrapMessage($this->getClient()->extractMessage($result))]]> getClient()->wrapMessage($this->getClient()->extractMessage($result))]]> + + + + + + + + + + + + + + + message]]> + message]]> + message]]> + message]]> + message[0] ?? '']]> + protected]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + message[0]]]> + + + + + + + + + + + editDate]]> + forwards]]> + fromScheduled]]> + groupedId]]> + imported]]> + message]]> + protected]]> + psaType]]> + signature]]> + viaBotId]]> + views]]> + + + reactions]]> + + + + $method( + message: $message, + parseMode: $parseMode, + replyMarkup: $replyMarkup, + scheduleDate: $scheduleDate, + noWebpage: $noWebpage, + )]]> + getClient()->methodCallAsyncRead( + 'messages.report', + [ + 'reason' => ['_' => $reason->value], + 'message' => $message, + 'id' => [$this->id], + 'peer' => $this->chatId, + ] + )]]> + - Message - Message + + getClient()->wrapMessage($this->getClient()->extractMessage($result))]]> getClient()->wrapMessage($this->getClient()->extractMessage($result))]]> - $html - $htmlTelegram + + + + + + + + + + + + + + + + methodCallAsyncRead( + 'channels.getParticipant', + [ + 'channel' => $this->chatId, + 'participant' => $member, + ] + )['participant']]]> + getClient()->methodCallAsyncRead( + 'messages.getDiscussionMessage', + ['peer' => $this->chatId, 'msg_id' => $this->id] + )['messages']]]> + + + + + + - ChannelMessage - ChannelMessage + + + + + documentId]]> + + + + + userId]]> + + + + + userId]]> + + + + + getName()]]]> + length]]> + offset]]> + + + + + language]]> + + + + + url]]> + + wrapMessage($client->extractMessage($result))]]> @@ -694,11 +1531,37 @@ wrapMessage($client->extractMessage($result))]]> wrapMessage($client->extractMessage($result))]]> + + + + + + + + + methodCallAsyncRead( + 'channels.getParticipant', + [ + 'channel' => $this->chatId, + 'participant' => $member, + ] + )['participant']]]> + + + + + + + + + + + - DialogTopicCreated - DialogTopicEdited - DialogTopicEdited - DialogTopicEdited + + + + wrapMessage($client->extractMessage($result))]]> @@ -707,23 +1570,29 @@ wrapMessage($client->extractMessage($result))]]> - GroupMessage - GroupMessage + + getClient()->wrapMessage($this->getClient()->extractMessage($result))]]> + + + + + + - DialogScreenshotTaken + getClient()->wrapMessage($this->getClient()->extractMessage($result))]]> - PrivateMessage - PrivateMessage + + @@ -734,42 +1603,279 @@ getClient()->wrapMessage($this->getClient()->extractMessage($result))]]> + + + + + + - DialogScreenshotTaken + getClient()->wrapMessage($this->getClient()->extractMessage($result))]]> - SecretMessage - SecretMessage + + + + + + + + + + + + + attachMenu]]> + domain]]> + + + + + + + + + + + accessHash]]> + callId]]> + + + + + getName()]]]> + + + + + + + + canEdit]]> + date]]> + inviterId]]> + promotedBy]]> + rank]]> + self]]> + userId]]> + + + + + + + + date]]> + kickedBy]]> + left]]> + peer]]> + + + + + + + + rank]]> + userId]]> + + + + + peer]]> + + + + + date]]> + userId]]> + + + + + date]]> + inviterId]]> + userId]]> + viaRequest]]> + + + + + getName()]]]> + + + + + addAdmins]]> + anonymous]]> + banUsers]]> + changeInfo]]> + deleteMessages]]> + editMessages]]> + inviteUsers]]> + manageCall]]> + manageTopics]]> + other]]> + pinMessages]]> + postMessages]]> + + + + + changeInfo]]> + embedLinks]]> + inviteUsers]]> + manageTopics]]> + pinMessages]]> + sendAudios]]> + sendDocs]]> + sendGames]]> + sendGifs]]> + sendInline]]> + sendMedia]]> + sendMessages]]> + sendPhotos]]> + sendPlain]]> + sendPolls]]> + sendRoundvideos]]> + sendStickers]]> + sendVideos]]> + untilDate]]> + viewMessages]]> + + + + ids]]> + pinned]]> + getIdInternal($rawPinned)]]> + + + + + + getName()]]]> + chosen]]> + correct]]> + text]]> + voters]]> + + + + + + + solution]]> + - $html - $htmlTelegram + + + + + + + + + + + + getName()]]]> + + + + + chats]]> + + + + + users]]> + + + + + chats]]> + + + + + users]]> + + + + + + + + getName()]]]> + + + + + + + + + + + + messageId]]> + - Message - Message + + getIdInternal($rawCallback['peer'])]]> + + + gameShortName]]> + + + + + + + + + + + + + + + + + + + + + + + + rawId]]> + + nextSent]]> @@ -779,9 +1885,125 @@ wrapUpdate($update)]]> wrapUpdate($update)]]> + + + + + + protected]]> + + + + + + methodCallAsyncRead('stories.getStoriesByID', ['peer' => $rawStory['peer'], 'id' => [$rawStory['story']['id']]])['stories']]]> + methodCallAsyncRead( + 'stories.sendReaction', + [ + 'add_to_recent' => $recent, + 'peer' => $this->senderId, + 'story_id' => $this->id, + 'reaction' => \is_int($reaction) + ? ['_' => 'reactionCustomEmoji', 'document_id' => $reaction] + : ['_' => 'reactionEmoji', 'emoticon' => $reaction], + ] + )['updates']]]> + methodCallAsyncRead( + 'stories.sendReaction', + [ + 'add_to_recent' => $recent, + 'peer' => $this->senderId, + 'story_id' => $this->id, + ] + )['updates']]]> + + + + + + + + + + + + + + + + + + + + + + + + + + getClient()->methodCallAsyncRead( + 'stories.exportStoryLink', + [ + 'peer' => $this->senderId, + 'id' => $this->id, + ] + )['link']]]> + + + + + + + + + + caption]]> + closeFriends]]> + contacts]]> + date]]> + edited]]> + expireDate]]> + pinned]]> + protected]]> + public]]> + reactionCount]]> + recentViewers]]> + selectedContacts]]> + sentReaction]]> + views]]> + + + + + + + getClient()->methodCallAsyncRead( + 'stories.exportStoryLink', + [ + 'peer' => $this->senderId, + 'id' => $this->id, + ] + )['link']]]> + getClient()->methodCallAsyncRead( + 'stories.incrementStoryViews', + [ + 'peer' => $this->senderId, + 'id' => [$this->id], + ] + )]]> + getClient()->methodCallAsyncRead( + 'stories.report', + [ + 'peer' => $this->senderId, + 'id' => [$this->id], + 'reason' => ['_' => $reason->value], + 'message' => $message, + ] + )]]> + - StoryReaction - StoryReaction + + wrapMessage($client->extractMessage($result))]]> @@ -789,11 +2011,11 @@ wrapUpdate($update)]]> - $first + - $html - $htmlTelegram + + wrapMedia($rawStory['media'], $this->protected)]]> @@ -801,21 +2023,112 @@ + + + + + id]]> + reaction]]> + getIdInternal($rawStory)]]> + + + + + + userId]]> + + + + + chatId]]> + + + + + + + + chatId]]> + + + + topicId]]> + getIdInternal($rawTyping)]]> + + + getName()]]]> + + + + blocked]]> + stories]]> + getIdInternal($rawPeerBlocked)]]> + + + date]]> + stopped]]> + userId]]> + + + + + number]]> + userId]]> + + + + + + + + userId]]> + + + + + emojiId]]> + until]]> + + + + + + + + wasOnline]]> + + + + + + + + expires]]> + + + + + + + firstName]]> + lastName]]> + userId]]> + new UsernameInfo($username), @@ -823,40 +2136,99 @@ )]]> + + + getName()]]]> + active]]> + username]]> + + + + + + + + getName()]]]> + accessHash]]> + creator]]> + dark]]> + default]]> + id]]> + pattern]]> + uniqueId]]> + wrapMedia($rawWallpaper['document'])]]> + + + getName()]]]> + backgroundColor]]> + blur]]> + fourthBackgroundColor]]> + intensity]]> + motion]]> + rotation]]> + secondBackgroundColor]]> + thirdBackgroundColor]]> + + - $code - $errfile - $errline - $errno - $errstr - $file - $line - $message + + + + + + + + + + + + + + + + + + file]]> + file]]> + + + file]]> + line]]> + + + line]]> + - __invoke + + + + + + + + - $id + - self::$map - self::$map ??= new WeakMap - self::$map ??= new WeakMap + + - $id - $id + + @@ -864,11 +2236,23 @@ wrapper->getAPI()->getEventHandler($class)]]> - T|EventHandlerProxy|__PHP_Incomplete_Class|null + - $data + + + wrapper->getAPI()->downloadToDir($messageMedia, $dir, $cb, $cancellation)]]> + wrapper->getAPI()->downloadToDir($messageMedia, $dir, $cb, $cancellation)]]> + wrapper->getAPI()->downloadToFile($messageMedia, $file, $cb, $cancellation)]]> + wrapper->getAPI()->downloadToFile($messageMedia, $file, $cb, $cancellation)]]> + wrapper->getAPI()->uploadFromCallable($callable, $size, $mime, $fileName, $cb, $seekable, $encrypted, $cancellation)]]> + wrapper->getAPI()->uploadFromCallable($callable, $size, $mime, $fileName, $cb, $seekable, $encrypted, $cancellation)]]> + wrapper->getAPI()->uploadFromTgfile($media, $cb, $encrypted, $cancellation)]]> + wrapper->getAPI()->uploadFromTgfile($media, $cb, $encrypted, $cancellation)]]> + wrapper->getAPI()->uploadFromUrl($url, $size, $fileName, $cb, $encrypted, $cancellation)]]> + wrapper->getAPI()->uploadFromUrl($url, $size, $fileName, $cb, $encrypted, $cancellation)]]> + account ??= new \danog\MadelineProto\Namespace\AbstractAPI('account')]]> auth ??= new \danog\MadelineProto\Namespace\AbstractAPI('auth')]]> @@ -877,6 +2261,7 @@ chatlists ??= new \danog\MadelineProto\Namespace\AbstractAPI('chatlists')]]> contacts ??= new \danog\MadelineProto\Namespace\AbstractAPI('contacts')]]> folders ??= new \danog\MadelineProto\Namespace\AbstractAPI('folders')]]> + fragment ??= new \danog\MadelineProto\Namespace\AbstractAPI('fragment')]]> help ??= new \danog\MadelineProto\Namespace\AbstractAPI('help')]]> langpack ??= new \danog\MadelineProto\Namespace\AbstractAPI('langpack')]]> messages ??= new \danog\MadelineProto\Namespace\AbstractAPI('messages')]]> @@ -884,6 +2269,7 @@ phone ??= new \danog\MadelineProto\Namespace\AbstractAPI('phone')]]> photos ??= new \danog\MadelineProto\Namespace\AbstractAPI('photos')]]> premium ??= new \danog\MadelineProto\Namespace\AbstractAPI('premium')]]> + smsjobs ??= new \danog\MadelineProto\Namespace\AbstractAPI('smsjobs')]]> stats ??= new \danog\MadelineProto\Namespace\AbstractAPI('stats')]]> stickers ??= new \danog\MadelineProto\Namespace\AbstractAPI('stickers')]]> stories ??= new \danog\MadelineProto\Namespace\AbstractAPI('stories')]]> @@ -892,69 +2278,144 @@ users ??= new \danog\MadelineProto\Namespace\AbstractAPI('users')]]> - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper - setWrapper + + + + + + + + + + + + + + + + + + + + + + - $class + - downloadToCallable - downloadToDir - downloadToFile - methodCallAsyncRead - uploadFromCallable - uploadFromTgfile - uploadFromUrl + + + + + + + + + + + + + + + __call(...)]]> + + + + + + + + + + + + + + + + + + + + - - getException()]]> - - - getException();]]> - + + + + + + requests[$id]]]> + + + + + + + + + - logger + - $logger - $server + + - - - exception ? $this->exception->getException() : null]]> - - - ?Throwable - + + + + + + + + + + + + getName()][$prop->getName()]]]> + + + + + + + + API]]> + + + API ??= Client::giveInstanceBySession($this->session)]]> + API ??= Client::giveInstanceBySession($this->session)]]> + + + + + + + + + + + + + + + + + + + @@ -962,80 +2423,138 @@ - $address + - (int) $port + + + + + + + + + + - $arguments - $arguments - $arguments + + + - include $autoloadPath + + + + + + + + + - $callback - $server + + - $payload === self::SHUTDOWN - $payload === self::SHUTDOWN + + - unwrap + - ServerCallback - ServerCallback + + - $args + $this->__call($id, $args)]]> - $data + - copy - unwrap + + + + callbacks[$payload[0]]]]> + + + + remoteId]]> + + + + + callbacks]]> + - $payload[0] - $payload[0] + + - $data - Wrapper - Wrapper + + + - new $class($this, $ids) + callbackIds[] = &$callback]]> callbackIds[] = &$callback]]> + + + __call('isRequested')]]> + __call('unsubscribe', [$callback])]]> + + - IteratorAggregate + + + + + + + __call('isReadable')]]> + + + + + __call('isWritable')]]> + + + + + {$propName}->getArrayCopy()]]> + + + + + + bindTo($this, $property->getDeclaringClass()->getName())($property->getName())]]> + @@ -1043,15 +2562,32 @@ + + stdoutUnbuffered->getResource()]]> + + + + stdoutUnbuffered]]> + + + + colors[$level]]]> + - $optional - $optional - $optional - $optional - $optional - $optional - $optional - $optional + + + + + + + + getResource()]]> mode === self::FILE_LOGGER ? $this->optional @@ -1059,22 +2595,28 @@ optional]]> optional]]> optional]]> - stdoutUnbuffered->getResource()]]> - $optional + + + + + - $colors - $stdout - $stdoutUnbuffered + + + + + + - $promise + colors]]> @@ -1089,21 +2631,46 @@ + + + + + + + + + + connection->new_outgoing[$message_id]]]> + connection->outgoing_messages[$message_id]]]> + connection->outgoing_messages[$message_id]]]> + + + + + + + + + getMsgId()]]> + + getSent()]]> + getSent()]]> + API->settings]]> - getRpc + - CheckLoop - CheckLoop - CheckLoop - CheckLoop - CheckLoop + + + + + API]]> @@ -1111,11 +2678,11 @@ - CleanupLoop - CleanupLoop - CleanupLoop - CleanupLoop - CleanupLoop + + + + + connection->msgIdHandler?->cleanup()]]> @@ -1126,186 +2693,423 @@ - HttpWaitLoop + - getSettings + - PingLoop - PingLoop - PingLoop - PingLoop + + + + shared]]> - - getReason(), ' ')]]> - - - throw $e; - + + + + + + + + + + + + + + + + + + + + bufferRead($payload_length)]]> bufferRead(4)]]> bufferRead(4)]]> + bufferRead(4)]]> bufferRead(8)]]> - $message_data - $message_data - $message_key + + + + + + - getReadBuffer + + - ReadLoop + - - $e - $e - $e - ClosedException - + + + + + + + + + + + + + + + + + + + getSerializedBody()]]> getSerializedBody()]]> + + getSerializedBody()]]> + connection->session_id]]> + - getWriteBuffer - getWriteBuffer + + - WriteLoop + connection->isHttp() && empty($this->connection->pendingOutgoing)]]> + connection->pendingOutgoing)]]> $callable()]]> + + $callable()]]> + + + + + + + API->logger)]]> - $msg + - $messages + - feed - feedSingle + + + + + + + + + + + + + + + + + + + + + + feedSingle($update)]]]> + API->feeders[$channelId]]]> + + + API->feeders[$channelId]]]> + + + + + + + + + + state]]> + + + + + + + + + + - checkPts - pts - resume - resume + + + + + + + + + + + + + + + + + + + + + pendingWakeups]]> + state]]> + + + + feeder->feed($updates['updates'])]]> + + - checkSeq - feed + + API->feeders[$channelId]]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + API->authorization['user']['bot']]]> + + + + + channelId]]]> + channelId]]]> + channelId]]]> + channelId]]]> + + + API->feeders[$channelId]]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pts()]]> + pts()]]> + pts() + 1]]> + feeder->feed($difference['other_updates'])]]> + feeder->feed($difference['other_updates'])]]> + feeder->feed($difference['other_updates'])]]> + + + + + - date - pts - pts - pts - pts - pts - qts - qts - qts - update - update - update - update - update - update - update + + + + + + + + + + + + + + + + API->authorization['user']]]> API->authorization['user']['bot']]]> - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference - $difference + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + API->feeders[$channelId]?->resume()]]> + + + + + + dequeue()]]> + + + + channels_state]]> + channels_state]]> + channels_state]]> + datacenter)]]> TL)]]> settings)]]> settings)]]> - new DataCenter($this) - new PeerDatabase($this) + + - $callbacks - $callbacks + + $this->getDownloadInfo(...), 'InputPeer' => $this->getInputPeer(...), - 'InputDialogPeer' => fn (mixed $id): array => ['_' => 'inputDialogPeer', 'peer' => $this->getInputPeer($id)], - 'InputCheckPasswordSRP' => fn (string $password): array => (new PasswordCalculator($this->methodCallAsyncRead('account.getPassword', [], $this->authorized_dc)))->getCheckPassword($password), + 'InputDialogPeer' => $this->getInputDialogPeer(...), + 'InputCheckPasswordSRP' => $this->getPasswordSRP(...), ], )]]> - array + - serializeSession + + + + + + + TL]]> + TL]]> + methodCallAsyncRead('account.getPassword', [], $this->authorized_dc)]]> + methodCallAsyncRead('phone.getCallConfig', [])]]> + settings]]> + settings->getSchema()]]> + settings->getSerialization()->applyChanges()->getInterval()]]> + + + + + release(...)]]> + internalInitDbProperties(...)]]> + internalSaveDbProperties(...)]]> + + + + + + + + + + + + + + authorization['user']['bot']]]> + authorization['user']['bot']]]> + authorization['user']['bot']]]> + authorization['user']['id']]]> + methodCallAsyncRead('help.getCdnConfig', [], $this->authorized_dc))['public_keys']]]> + methodCallAsyncRead('users.getUsers', ['id' => [['_' => 'inputUserSelf']]]))[0]]]> + + + + + + + + + + + + + + + + + + + + + + + + config]]> + configLoop]]> + datacenter]]> + peerDatabase]]> + phoneConfigLoop]]> + referenceDatabase]]> + reportMutex]]> + seqUpdater]]> + serializeLoop]]> + supportUser]]> + tmpDbPrefix]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + datacenter]]> + + + authorization['hint']]]> + authorization['hint']]]> + authorization['user'] ?? false]]> + authorization['user'] ?? false]]> + authorization['user']['bot']]]> + authorization['user']['bot']]]> + config]]> + config]]> + dcList[$test][$ipv6][$dc]['cdn'] ?? false]]> + dcList[$test][$ipv6][$dc]['cdn'] ?? false]]> + getSelf()['premium']]]> + + + cdn_rsa_keys]]> + ]]> + + authorization['hint']]]> authorization['user']['bot']]]> - - channels_state->get()]]> - channels_state->get()]]> - channels_state->get()]]> - channels_state->get()]]> - - $path + getSelf()['bot']]]> + getSelf()['id']]]> getSelf()['premium']]]> authorized_dc]]> + + authorization['hint']]]> authorization['hint']]]> authorization['user']]]> authorization['user']]]> @@ -1368,9 +3314,10 @@ authorization['user']['id']]]> - logger - start - start + + + + @@ -1386,41 +3333,79 @@ authorized === API::LOGGED_IN && \is_int($dc_id)]]> datacenter]]> peerDatabase]]> - \is_int($dc_id) + datacenter)]]> - memprof_dump_pprof($file) - memprof_enabled() + + - - full_chats]]> - settings->getAppInfo()->getLangCode()]]]> + + + + + + + + + + + + + + authKey]]> + id]]> + serverSalt]]> + + + + + + content['_']]]]> + + + content['_']]]> + content[self::RESPONSE_ID_MAP[$this->content['_']]]]]> + + - getBody + + + + state |= self::STATE_ACKED]]> state |= self::STATE_REPLIED]]> state |= self::STATE_SENT]]> + + sent]]> + + + + authKey]]> + + + + authKey]]> - authorized + {$key} =& $bound->{$key}]]> @@ -1430,37 +3415,258 @@ new_outgoing]]> + + getSent()]]> + getSent()]]> + getSent()]]> + + + + + + + + + + + + + + + time_delta]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + time_delta]]> + + + + + + + + + + + + + + + + + + + + fp]]> + $f->await()]]> - $abstractionQueueMutex + - methodCallAsyncRead + + + + + + + + + + + + + API->parseMode($args)['message']]]> + + + + + + + + + + + outgoing_messages[$message_id]]]> + outgoing_messages[$message_id]]]> + + + + + + + + + + + + + + + outgoing_messages[$message_id] ?? $message_id]]> + - release - resume + + - getMaxId + + + + + + + + + + + + + + incoming_messages[$content['answer_msg_id']]]]> + incoming_messages[$content['answer_msg_id']]]]> + incoming_messages[$msg_id]]]> + incoming_messages[$msg_id]]]> + outgoing_messages[$content['msg_id']]]]> + outgoing_messages[$msg_id]]]> + + + + + + + + + + + + + + + + + + getContent()['_']]]> + read()['msg_ids']]]> + read()['server_salt']]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + API->getTL()->getConstructors()->findByPredicate($message->getContent()['_'])['type']]]> + API->getTL()->getConstructors()->findByPredicate($response['_'])['type']]]> + + + incoming_messages[$msg['msg_id']]]]> + incoming_messages[$referencedMsgId]]]> + + + + + + + + + + + + + + + API->authorization['user']['phone']]]> + API->authorization['user']['phone']]]> + - $response - time() + $seconds + + - $msgId - $msgId - $msgId - $msgId + + + + getMsgId()]]> @@ -1472,21 +3678,50 @@ - $msgIdHandler - $new_incoming + + + + + + + getSent()]]> + + + + + + + + + + + + + + + + + + dh_config]]> + - methodCallAsyncRead + - - - syncLoading - - + + + + + + + + + + @@ -1496,11 +3731,14 @@ getSelf()['id']]]> - $media + extractBotAPIFile($this->MTProtoToBotAPI($media))['file_id']]]> + + + @@ -1509,37 +3747,331 @@ - - - - array + - $data - $media + + - genAllFile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + methodCallAsyncRead('upload.getCdnFileHashes', ['file_token' => $file, 'offset' => $offset, 'cancellation' => $cancellation], $this->authorized_dc)]]> + methodCallAsyncRead('upload.reuploadCdnFile', ['file_token' => $messageMedia['file_token'], 'request_token' => $res['request_token'], 'cancellation' => $cancellation], $this->authorized_dc)]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TL->getConstructors()->findByPredicate($media['_'])['type']]]> + + + + + + + + + + + + + + + + + + + + + + + cdn_hashes[$file][$hash['offset']]]]> + TL->getConstructors()->findByPredicate($media['_'])['type'] => $media]]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cdn_hashes]]> + cdn_hashes]]> + + + write[$offset]->getFuture()->await($this->cancellation)]]> + + + + read[$offset]]]> write[$offset]]]> write[$offset]]]> - $datacenter - $messageMedia + + + + + + + + - decrypt - getReference - getReference - getReference - getReference - getReference - getReference - getReference + + + + + + + + @@ -1550,32 +4082,28 @@ - $res - $res - $res - $res - $res - $res - $res - $res - $res - $res - $res - $res - $res + + + + + + + + + + + + + - - - - - $datacenter + - $cb(100, $speed, $time) + @@ -1583,63 +4111,288 @@ + + methodCallAsyncRead( + $method, + $params + )]]> + + + + + + + + + - Message + - $file - $file + + - static function (string $payload, int $offset) use ($stream, $seekable, $lock) { + + + + + + + + + + + + getFile()]]> + + + + + + + + + getFile()]]> + + + + getHeaders()]]> + + + + + + + + + + + + - $file - $file + + - $body - $size + + + + + + - seek - seek + + - $l + - populateFrom + + + + + pendingDb[$id]]]> + + + + + + cache[$key][$id]]]> + + + + + + + + pendingDb[$id]]]> + + + + + + + + + + + + + + + populateFrom(...))]]> + + + + + + - $id + - $peers - $peers - $peers - $peers + db]]> - $db + + + + + + + + + + + + + toBytes()]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + current_algo]]> + new_algo]]> + srp_id]]> + + + + + + + + + + + + + + + + - powMod + + + + pendingDb]]> + + + + + + + + + + + + + + + + + + API->authorization['user']['id']]]> + API->methodCallAsyncRead('help.getSupport', [])['user']]]> + + API->methodCallAsyncRead('contacts.resolveUsername', ['username' => $username]))['peer']]]> + + + db[$bot_api_id]]]> + db[$chat['id']]]]> + db[$chat['id']]]]> + db[$user['id']]]]> + db[$user['id']]]]> + pendingDb[$user['id']]]]> + pendingDb[$user['id']]]]> + + + + + + + + + + + + $username]]]> + + + + + + + pendingDb]]> + + + getFull($id)['last_update'] ?? 0]]> + getFull($id)['last_update'] ?? 0]]> + + + + + + + API->getIdInternal($full)]]> API->getIdInternal($full)]]> @@ -1655,31 +4408,203 @@ pendingDb]]> - $db - $fullDb - $usernames + + + - (int) $id + + + + + + getInfo($peer, \danog\MadelineProto\API::INFO_TYPE_CONSTRUCTOR)['forum']]]> + + + - fwdPeerIsset - getInputConstructor - getInputPeer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TL->getConstructors()->findByPredicate($constructor['_'])['type']]]> + authorization['user']['id']]]> + authorization['user']['id']]]> + authorization['user']['id']]]> + authorization['user']['id']]]> + + + + getIdInternal($participant['peer'])]]]> + + + + getIdInternal($participant['peer'])]]]> + TL->getConstructors()->findByPredicate($constructor['_'])['type'] => $constructor]]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + supportUser]]> + + + + + + + + + + + + + + + + + + + - \danog\MadelineProto\API::PEER_TYPE_* + - $promises + - $full + + getIdInternal($id)]]> getIdInternal($id)]]> peerDatabase->getFull($partial['bot_api_id'])]]> @@ -1701,10 +4626,140 @@ - array_values + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + API->authorization['user']['id']]]> + API->authorization['user']['id']]]> + + + + + + + cache[$key][$location]]]> + cache[$key][$location]]]> + cache[$key][$location]]]> + cache[$key][self::serializeLocation($locationType, $location)]]]> + + + cache[$key][$location]]]> + cache[$key][$location]]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1722,14 +4777,33 @@ getDb($locationString)['origins']]]> - $db + + + + + + + + + + + + + + + + + + + + - $extra_ranges - $range_orig - $seek_end + + + @@ -1741,15 +4815,304 @@ nextSent]]> - $update + - getUpdatesState - loadUpdateState + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + getUpdatesState()]]> + + + + + + + + + + + + + + + + + + + + + rethrowHandler]]> + rethrowHandler]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TL->getConstructors()->findByPredicate('message')['params']]]> + authorization['user']['id']]]> + authorization['user']['id']]]> + authorization['user']['id']]]> + authorization['user']['id']]]> + authorization['user']['id']]]> + authorization['user']['id']]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + authorization['hint']]]> + + + + + + + + + feeders[FeedLoop::GENERIC]->feedSingle($update)]]]> + calls[$update['phone_call']['id']]]]> + calls[$update['phone_call']['id']]]]> + calls[$update['phone_call']['id']]]]> + calls[$update['phone_call']['id']]]]> + calls[$update['phone_call']['id']]]]> + calls[$update['phone_call']['id']]]]> + calls[$update['phone_call']['id']]]]> + calls[$update['phone_call']['id']]]]> + calls[$update['phone_call']['id']]]]> + calls[$update['phone_call']['id']]]]> + calls[$update['phone_call_id']]]]> + calls[$update['phone_call_id']]]]> + eventHandlerMethods[$updateType]]]> + feeders[$this->feeders[FeedLoop::GENERIC]->feedSingle($update)]]]> + feeders[$this->feeders[FeedLoop::GENERIC]->feedSingle($updates['update'])]]]> + msg_ids[$peer_id]]]> + msg_ids[$peer_id]]]> + secretChats[$update['message']['chat_id']]]]> + secretChats[$update['message']['chat_id']]]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + authorization]]> + authorization]]> + authorized_dc]]> + + + + + + + + + + + + + + + + + + + + + qts()]]> + qts()]]> + qts()]]> + qts()]]> + + + + + + + + + + + + + + calls]]> + calls]]> + getIdInternal($message['action']['from_id'])]]> getIdInternal($message['action']['to_id'])]]> + webhookUrl]]> authorization['user']]]> @@ -1766,139 +5129,630 @@ authorization['user']['id']]]> - addPendingWakeups - waitForInternalStart + + - $first + + eventHandlerHandlers) !== 0 && \is_array($update)]]> - \is_array($update) + + + + + + + + + + + + pts + $update['pts_count'])]]> + + + + + + + + + + + + + + + + + - completeLogin - createApp - getApp - hasApp + + + + + + getHeaders('app')]]> + getHeaders('origin')]]> + getHeaders('origin')]]> + getHeaders('refer')]]> + getHeaders('refer')]]> + getHeaders('refer')]]> + + + + + + + hash]]> + settings]]> - $value + settings]]> + + + - methodCallAsyncRead + - $wrapper + + + + + + + comments]]> + vendorString]]> + + + new('char[1024]'))]]> + + + + + + + + > 3)]]> + + + + + + + opus_encoder_ctl($encoder, self::OPUS_SET_BANDWIDTH_REQUEST, self::OPUS_BANDWIDTH_FULLBAND)]]> + opus_encoder_ctl($encoder, self::OPUS_SET_BITRATE_REQUEST, 130*1000)]]> + opus_encoder_ctl($encoder, self::OPUS_SET_COMPLEXITY_REQUEST, 10)]]> + opus_encoder_ctl($encoder, self::OPUS_SET_INBAND_FEC_REQUEST, 1)]]> + opus_encoder_ctl($encoder, self::OPUS_SET_PACKET_LOSS_PERC_REQUEST, 1)]]> + opus_encoder_ctl($encoder, self::OPUS_SET_SIGNAL_REQUEST, self::OPUS_SIGNAL_MUSIC)]]> + opus_get_version_string()]]> + + + + + + + + + + + + + + + + + streamCount]]> + + + + + + + + + + + + + + + opus_strerror($err)]]> + + + + streamCount]]> + + + ]]> + + + + + + + + + + + + + + + + + currentDuration += $frameDuration]]> + currentDuration += $totalDuration]]> + + + + + type('char*')]]> + + + stream)($headers['number_page_segments'])]]> + stream)(23)]]> + + + + + + + + + + + + + + + + + + + + + + + stream)($headers['number_page_segments'])]]> + stream)($sizeAccumulated)]]> + stream)(23)]]> + stream)(4)]]> + + + cdata]]> + + - $file - $message + + + + + + - $level - $message + + + + + - $previous + - $caller - $code - $message + + + + + + + - $caller - $method + + + + + + + + + + + + + + + + + + + + + + e]]> + n]]> + + + + + + + serializeObject(['type' => 'bytes'], $instance->n->toBytes(), 'key')]]> + - $e - $fp - $n + + + + + + + + + + + + + + + + + + + + getSecretChatController($chatId)->getMessage($randomId)['message']]]> + temp_requested_secret_chats[$params['id']]]]> + + + + + + + + + + secretChats[$chat]]]> + secretChats[$params['id']]]]> + secretChats[$params['id']]]]> + secretChats[$params['id']]]]> + secretChats[\is_array($chat) ? $chat['chat_id'] : $chat]]]> + temp_requested_secret_chats[$params['id']]]]> + temp_requested_secret_chats[$params['id']]]]> + temp_requested_secret_chats[$params['id']]]]> + temp_requested_secret_chats[$res['id']]]]> + + + secretChats[$chat]]]> + secretChats[\is_array($chat) ? $chat['chat_id'] : $chat]]]> + + + + + + + + + + + + + + + + + + + + + + secretChats]]> + secretChats]]> + - SecretMessage + + + + - remoteLayer === 8]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + outgoing[$request['seq']]]]> + outgoing[$request['seq']]]]> + outgoing[$seq]]]> + randomIdMap[$message['message']['decrypted_message']['random_id']]]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gapEnd]]> + gapQueueSeq]]> + gapQueueSeq]]> + rekeyExchangeId]]> + remoteLayer]]> + remoteLayer]]> + ttl]]> + + + + + + + + + + + + + + + + + gapEnd]]> + - $incoming - $outgoing - $randomIdMap + + + + + + + + + - array{0: (ChannelledSocket|APIWrapper|Throwable|null|0), 1: (callable|null)} + + + + + + + getFuture()]]> + getFuture()]]> + getFuture()]]> + + + + + + + - $ipcSocket - $ipcSocket + + + + + + - $warningId + - + + lightState ??= $this->unserialize($this->lightStatePath)]]> + + unserialize($this->ipcStatePath)]]> - - - ?IpcState - + + + + + + + + + + read(null, 1)]]> read(null, 1)]]> - $php[0] - $php[1] + + - $php[0] - $php[1] + + + + - lightState ??= $this->unserialize($this->lightStatePath)]]> + @@ -1906,12 +5760,26 @@ extra]]> + + + + + + + + + + + + + + - + - $entities + length]]> @@ -1920,113 +5788,370 @@ - $stream + + + bufferRead(4)]]> + + + + + + + + + + + + + + + + + + + + + + + + bufferRead(4))[1]]]> + + + + + stream]]> + stream->getSocket()]]> + - $l + - $append - $append_after - $memory_stream - $stream + + + + + + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + + + + + + + + + append]]> + append_after]]> + + + stream]]> + stream->getSocket()]]> + stream->read($cancellation)]]> + - $append - $append_after - $decrypt - $encrypt - $extra - $read_buffer - $stream - $write_buffer + + + + + + + + + + extra['decrypt']['iv']]]> + extra['decrypt']['key']]]> + extra['encrypt']['iv']]]> + extra['encrypt']['key']]]> + + + extra['decrypt']]]> + extra['decrypt']]]> + extra['decrypt']['iv']]]> + extra['decrypt']['key']]]> + extra['encrypt']]]> + extra['encrypt']]]> + extra['encrypt']['iv']]]> + extra['encrypt']['key']]]> + + + + + + + + + + + + append]]> + append_after]]> + + + decrypt]]> + encrypt]]> + stream]]> + stream->getSocket()]]> + decrypt->encrypt($this->read_buffer->bufferRead($length, $cancellation))]]> + - $append - $append_after + + - read - write + + - $hash_name - $read_buffer - $read_check_after - $read_check_pos - $read_hash - $rev - $stream - $write_buffer - $write_check_after - $write_check_pos - $write_hash + + + + + + + + + + + + + + + hash_name]]> + hash_name]]> + read_hash]]> + read_hash]]> + read_hash]]> + write_hash]]> + write_hash]]> + write_hash]]> + + + + + + + + + + + + + + + + + + + + read_check_pos]]> + read_check_pos]]> + read_check_pos]]> + write_check_pos]]> + write_check_pos]]> + write_check_pos]]> + + + + + read_buffer->bufferRead($length, $cancellation)]]> + stream]]> + stream->getSocket()]]> + + + + + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + memory_stream]]> + + + stream]]> + - close + - $obj + - $socketContext - $uri + + - $extra + + + + + + + + + + + + + + + - StreamInterface + - $stream + + + + + + + + + + + + + + + + + + + + + + bufferRead(3)]]> + + + + + + stream]]> + stream->getSocket()]]> + - $l + - $in_seq_no - $out_seq_no - $stream + + + + + bufferRead(4)]]> + bufferRead(4)]]> + + + + + + + + + + + + + + + + + + + + + + + + + in_seq_no]]> + out_seq_no]]> + + + + + stream]]> + stream->getSocket()]]> + - $l + - $stream - $stream - $uri + + + - $code - $ctx - $header + + + + + ctx]]> + ctx]]> + + + + + header]]> + + + code]]> + + + bufferRead(1)]]> + + uri->getPort()]]> + - $code - $current_header[1] - $description + + + getStream($header)]]> @@ -2034,56 +6159,154 @@ - $stream + + + bufferRead(4)]]> + + + + + + + + + + + + + + + + + + stream]]> + stream->getSocket()]]> + - $l + - $stream + + + bufferRead(4)]]> + + + + + + + + + + + + + + + + + + stream]]> + stream->getSocket()]]> + - $l + - $extra - $stream + + + + + + + + + + extra['address']]]> + extra['port']]]> + extra['secret']]]> + extra['secret']]]> + + + extra['address']]]> + extra['port']]]> + extra['secret']]]> + extra['secret']]]> + - $stream + - $extra + - - $read - + + + + + extra['address']]]> + extra['port']]]> + + + + + + + + + + + + + + + + bufferRead(1)]]> + + extra['address']]]> + extra['password']]]> + extra['port']]]> + extra['username']]]> + + + + - $code - $current_header[1] - $description + + + - $l + getStream()]]> + + + + + + + + - $stream + - $extra + - + bufferRead(1)]]> bufferRead(1)]]> bufferRead(1)]]> @@ -2096,68 +6319,327 @@ bufferRead(16)]]> bufferRead(2)]]> bufferRead(4)]]> - $length - + extra['password']]]> + extra['username']]]> + + + extra['address']]]> + extra['password']]]> + extra['port']]]> + extra['username']]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + extra['address']]]> + extra['password']]]> + extra['port']]]> + extra['username']]]> + - $ip + getStream(\chr(5).\chr(\strlen($methods)).$methods)]]> + + + + + + + + + + + + + + + + + + stream]]> + - setupTls + + + stream]]> + - getStream + + + stream]]> + + + + + + stream]]> + - write + - write + - $connector - $stream + + + + + - $data + - stream]]> - stream]]> - stream]]> - ?WebsocketMessage - ClosedException - Rfc6455ConnectionFactory - Rfc6455Connector - WebsocketConnection - WebsocketConnector - WebsocketConnector - WebsocketHandshake + - - WsStream - - - - - WssStream - - $markup + - parseReplyMarkup + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + }>]]> @@ -2174,33 +6656,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - $arguments[$key] - $arguments[$key] - $arguments[$key] + + + - $photo - $photoSize - $thumbnail + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id]]> + - $file - $message + + + + + + - $posClose === false - $posClose === false + + + + + + + + + + + + + + + + + + + + authorization['user']['id']]]> + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2208,6 +6810,9 @@ authorization['user']]]> authorization['user']['id']]]> + + + @@ -2218,87 +6823,575 @@ - $file - $message + + + + + + + + + + + + + + + + + + + + + + + + + + + + - \is_resource($stream) - \is_resource($stream) + + - $arg + - deserialize - serializeMethod - serializeObject - serializeParams + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + toBytes()]]> + + + + + + + + + + outgoing_messages[$x['req_msg_id']]]]> + outgoing_messages[$x['req_msg_id']]->constructor]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + constructors->findByPredicate($object['_'])['type']]]> + constructors->findByPredicate($value['_'])['type']]]> + constructors->findByPredicate($value['_'])['type']]]> + constructors->findByPredicate($value['_'])['type']]]> + constructors->findByPredicate('vector')['id']]]> + constructors->findByPredicate('vector')['id']]]> + constructors->findByPredicate((bool) $object ? 'boolTrue' : 'boolFalse')['id']]]> + constructors->findByType($type)['predicate']]]> + + + outgoing_messages[$x['req_msg_id']]]]> + outgoing_messages[$x['req_msg_id']]]]> + outgoing_messages[$x['req_msg_id']]]]> + outgoing_messages[$x['req_msg_id']]]]> + outgoing_messages[$x['req_msg_id']]]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + afterConstructorDeserialization[$x['_']]]]> + afterConstructorDeserialization[$x['_']]]]> + afterMethodResponseDeserialization[$type['connection']->outgoing_messages[$x['req_msg_id']]->constructor]]]> + afterMethodResponseDeserialization[$type['connection']->outgoing_messages[$x['req_msg_id']]->constructor]]]> + beforeConstructorDeserialization[$x['_']]]]> + beforeConstructorDeserialization[$x['_']]]]> + beforeConstructorSerialization[$object['_']]]]> + beforeConstructorSerialization[$object['_']]]]> + tdDescriptions['constructors'][$name]]]> + tdDescriptions['constructors'][$name]]]> + tdDescriptions['constructors'][$name]]]> + tdDescriptions['constructors'][$name]]]> + tdDescriptions['methods'][$name]]]> + tdDescriptions['methods'][$name]]]> + typeMismatch[$type['type']]]]> + typeMismatch[$type['type']]]]> + outgoing_messages[$x['req_msg_id']]]]> + outgoing_messages[$x['req_msg_id']]]]> + outgoing_messages[$x['req_msg_id']]]]> + outgoing_messages[$x['req_msg_id']]]]> + outgoing_messages[$x['req_msg_id']]]]> + outgoing_messages[$x['req_msg_id']]]]> + outgoing_messages[$x['req_msg_id']]]]> + + + + + + + + + afterConstructorDeserialization[$x['_']]]]> + afterConstructorDeserialization[$x['_']]]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + secretLayer]]> + secretLayer]]> + + + + + + + + + + + + + + + $flag, + 'name' => $name, + 'type' => $type, + 'pow' => $pow + ]]]> + + + + + + + + + + + + + + + + + + + + + constructors->findByPredicate('vector')['id']]]> + serializeObject($current_argument, $arguments['file']['mime_type'], $name, $layer)]]> + serializeObject($current_argument, $value, $name, $layer)]]> + serializeObject(['type' => $type['subtype']], $current_object, $k, $layer)]]> + serializeObject(['type' => $type['subtype']], $current_object, $k, $layer)]]> + serializeObject(['type' => 'bytes'], Tools::random(15 + 4 * Tools::randomInt(modulus: 3)), 'random_bytes')]]> + + + + + + + + + + + + + outgoing_messages]]> + outgoing_messages]]> + outgoing_messages[$x['req_msg_id']]->constructor]]> + outgoing_messages[$x['req_msg_id']]->constructor]]> + outgoing_messages[$x['req_msg_id']]->constructor]]> + - $value + - $value - $value - $value + + + - $value + - botAPIToMTProto + - $elem[1] - $elem[1] - $elem[1] - $elem[1] + + + + - $afterConstructorDeserialization - $afterMethodResponseDeserialization - $beforeConstructorDeserialization - $beforeConstructorSerialization - $beforeMethodResponseDeserialization - $constructors - $methods - $tdDescriptions - $typeMismatch + + + + + + + + + - findByPredicate - findByType + + + + + + + + + by_id[$json_dict['id']]['layer']]]> + + + + + + + by_id[$json_dict['id']]['layer']]]> + + + by_id[$chosenid]]]> + by_id[$json_dict['id']]]]> + by_id[$json_dict['id']]]]> + by_id[$json_dict['id']]]]> + by_id[$json_dict['id']]]]> + by_id[$json_dict['id']]]]> + by_id[$this->by_predicate_and_layer[$predicate]]]]> + layers[$json_dict['layer']]]]> + + + + + + + + + + + + + + + + + + + + + + + + - deserialize - serializeMethod - serializeObject + + + - findById - findByMethod + + + + + + + + + + + + by_id[$json_dict['id']]['subtype']]]> + by_id[$json_dict['id']]['type']]]> + + + by_id[$json_dict['id']]]]> + by_id[$json_dict['id']]]]> + by_id[$json_dict['id']]]]> + by_id[$this->by_method[$method_name]]]]> + by_method[$json_dict['method']]]]> + + + + + + + + + + + + + + + + + + + + + + + by_id[$key]['params']]]> + + + + + + + + + + + + + + + + + by_id[$key]['flags']]]> + by_id[$key]['flags'][$kkey]]]> + by_id[$key]['params']]]> + by_id[$key]['params'][$kkey]]]> + + + by_id[$key]['flags'][$kkey]]]> + by_id[$key]['params'][$kkey]]]> + + + + + + + + - click + + + authorization['user']['id']]]> + + + button[$name]]]> + button[$name]]]> + button[$name]]]> + button[$name]]]> + + + id]]> + label]]> + peer]]> + peer]]> + authorization['user']]]> authorization['user']['id']]]> @@ -2306,18 +7399,58 @@ - $val + $this->{$var}]]> - getVar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + > 21]]> + + + + + + - $value - $value + + + + + $this->{$var}, @@ -2333,28 +7466,142 @@ )->__invoke()]]> - __invoke - __invoke + + - $buffer === null + {$var} =& $val]]> + + callID]]> + date]]> + otherID]]> + otherID]]> + getSelf()['id']]]> + + + + subtract(Magic::$two)]]> + + + + + methodCallAsyncRead('phone.requestCall', [ + 'user_id' => $user, + 'g_a_hash' => hash('sha256', $g_a->toBytes(), true), + 'protocol' => VoIPController::CALL_PROTOCOL, + ])['phone_call']]]> + + + + + + + calls[$res['id']]]]> + + + + + + + + + + + + calls]]> + + udp]]> - $stream + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2366,8 +7613,8 @@ - $crc - $encrypted_data + + bufferRead(4)]]> bufferRead(4)]]> bufferRead(4)]]> @@ -2376,12 +7623,17 @@ bufferRead(4)]]> bufferRead(8)]]> + + + + bufferRead(4)]]> + - getReadBuffer + - $ack_mask - $out_seq_no + + getStream()]]> @@ -2390,17 +7642,83 @@ udp]]> - true + - ClosedException - ClosedException + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - readLength(1))]]> - authKey]]> authKey]]> @@ -2409,28 +7727,154 @@ call]]> - $visualization - $visualization + + + + + + + + + + + + subtract(Magic::$two)]]> + + + + + + + + + + call['a']]]> + call['b']]]> + + readLength(2))[1]]]> + + + + + + + + + + + + + + + + API->methodCallAsyncRead('phone.confirmCall', [ + 'key_fingerprint' => substr(sha1($key, true), -8), + 'peer' => ['id' => $params['id'], 'access_hash' => $params['access_hash'], '_' => 'inputPhoneCall'], + 'g_a' => $this->call['g_a'], + 'protocol' => self::CALL_PROTOCOL, + ]))['phone_call']]]> + + + + + + + + + + + $data]]]> + + + + + + + + + + + + + pendingPing]]> - - call['g_a']]]> - - $authKey - $bestEndpoint - $messageHandler + + + API->logger)]]> + + + + + + + + + + + + + + + + methodCallAsyncRead(...)]]> + + ]]> + + + + + + + + + + + + + + + + + + authorization['user']['bot']]]> + authorization['user']['bot']]]> + authorization['user']['bot']]]> + botDialogsUpdatesState['pts']]]> + methodCallAsyncRead( + 'updates.getDifference', + $state + ['cancellation' => Tools::getTimeoutCancellation(15.0), 'floodWaitLimit' => 86400] + )['_']]]> + + + + + + + + + + + + + + botDialogsUpdatesState]]> + botDialogsUpdatesState]]> + bottomPts]]> + topPts]]> + authorization['user']]]> authorization['user']]]> @@ -2440,7 +7884,7 @@ authorization['user']['bot']]]> - $dialogs + cachedAllBotUsers]]> @@ -2452,8 +7896,11 @@ event_handler_instance === null || $this->event_handler_instance instanceof __PHP_Incomplete_Class]]> event_handler_instance instanceof __PHP_Incomplete_Class]]> + + + - PluginEventHandler|EventHandlerProxy|null + pluginInstances[$class]]]> @@ -2463,13 +7910,65 @@ pluginInstances[$class]]]> - new $class_name + - array + + + + + + + + + methodCallAsyncRead( + 'auth.importBotAuthorization', + [ + 'bot_auth_token' => $token, + 'api_id' => $this->settings->getAppInfo()->getApiId(), + 'api_hash' => $this->settings->getAppInfo()->getApiHash(), + ], + )]]> + methodCallAsyncRead('account.getPassword', [])]]> + methodCallAsyncRead('auth.signUp', ['phone_number' => $this->authorization['phone_number'], 'phone_code_hash' => $this->authorization['phone_code_hash'], 'phone_code' => $this->authorization['phone_code'], 'first_name' => $first_name, 'last_name' => $last_name])]]> + + + + + + + + + + + + + + authorization['hint']]]> + authorization['hint']]]> + authorization['phone_number']]]> + + + + + + + + + authorization]]> + authorization]]> + authorization]]> + authorization]]> + authorization]]> + authorization]]> + authorized_dc]]> + + + + authorization['phone_code']]]> authorization['phone_code_hash']]]> @@ -2478,12 +7977,12 @@ authorization['phone_number']]]> - \is_array($auth_key) + - loop + @@ -2494,7 +7993,7 @@ getAuthorization() === \danog\MadelineProto\API::LOGGED_IN]]> - array + @@ -2503,15 +8002,10 @@ - $title - - - - - $result - $result + + diff --git a/psalm.xml b/psalm.xml index 424bf1803..d8ae6a560 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,6 +1,6 @@ props = $props; } - public function getException(): object + public function getException(): \Throwable { $prev = new MadelineProtoException("Client backtrace"); diff --git a/src/Lang.php b/src/Lang.php index 088e062c1..74f49bc72 100644 --- a/src/Lang.php +++ b/src/Lang.php @@ -1550,6 +1550,7 @@ If you intentionally deleted this account, ignore this message.', ]; // THIS WILL BE OVERWRITTEN BY $lang["en"] + /** @var array */ public static array $current_lang = [ '2fa_uncalled' => 'I\'m not waiting for the password! Please call the phoneLogin and the completePhoneLogin methods first!', 'accepting_call' => 'Accepting call from %s...', diff --git a/src/Loop/Connection/ReadLoop.php b/src/Loop/Connection/ReadLoop.php index ad715d702..fc60cae62 100644 --- a/src/Loop/Connection/ReadLoop.php +++ b/src/Loop/Connection/ReadLoop.php @@ -22,7 +22,7 @@ namespace danog\MadelineProto\Loop\Connection; use Amp\ByteStream\PendingReadError; use Amp\ByteStream\StreamException; -use Amp\Websocket\ClosedException; +use Amp\Websocket\WebsocketClosedException; use danog\Loop\Loop; use danog\MadelineProto\Logger; use danog\MadelineProto\MTProto\MTProtoIncomingMessage; @@ -130,7 +130,7 @@ final class ReadLoop extends Loop } try { $buffer = $this->connection->stream->getReadBuffer($payload_length); - } catch (ClosedException $e) { + } catch (WebsocketClosedException $e) { $this->API->logger($e->getReason()); if (str_starts_with($e->getReason(), ' ')) { $payload = -((int) substr($e->getReason(), 7)); diff --git a/src/Ogg.php b/src/Ogg.php index bd5962d7b..07d931d18 100644 --- a/src/Ogg.php +++ b/src/Ogg.php @@ -543,6 +543,7 @@ final class Ogg } } } + \assert(isset($opus)); $checkErr = static function (int|CData $err) use ($opus): void { if ($err instanceof CData) { $err = $err->cdata; diff --git a/tools/translator.php b/tools/translator.php index 9e12a703e..a5f57ff3a 100644 --- a/tools/translator.php +++ b/tools/translator.php @@ -34,6 +34,7 @@ final class Lang public static array $lang = %s; // THIS WILL BE OVERWRITTEN BY $lang["en"] + /** @var array */ public static array $current_lang = %s; }';