Skip to content

Commit cff0db1

Browse files
committed
Bump to layer 222
1 parent 8b76bb7 commit cff0db1

97 files changed

Lines changed: 282 additions & 201 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,16 +1264,21 @@ Some of MadelineProto's core components are also available as separate, standalo
12641264
* <a href="https://docs.madelineproto.xyz/API_docs/methods/auth.finishPasskeyLogin.html" name="auth.finishPasskeyLogin">auth.finishPasskeyLogin</a>
12651265
* <a href="https://docs.madelineproto.xyz/API_docs/methods/auth.initPasskeyLogin.html" name="auth.initPasskeyLogin">auth.initPasskeyLogin</a>
12661266
* <a href="https://docs.madelineproto.xyz/PHP/danog/MadelineProto/API.html#base64urlDecode" name="base64urlDecode">base64URL decode: base64urlDecode</a>
1267+
* <a href="https://docs.madelineproto.xyz/API_docs/methods/channels.getFutureCreatorAfterLeave.html" name="channels.getFutureCreatorAfterLeave">channels.getFutureCreatorAfterLeave</a>
12671268
* <a href="https://docs.madelineproto.xyz/API_docs/methods/contacts.updateContactNote.html" name="contacts.updateContactNote">contacts.updateContactNote</a>
12681269
* <a href="https://docs.madelineproto.xyz/API_docs/methods/messages.createForumTopic.html" name="messages.createForumTopic">messages.createForumTopic</a>
12691270
* <a href="https://docs.madelineproto.xyz/API_docs/methods/messages.deleteTopicHistory.html" name="messages.deleteTopicHistory">messages.deleteTopicHistory</a>
12701271
* <a href="https://docs.madelineproto.xyz/API_docs/methods/messages.editForumTopic.html" name="messages.editForumTopic">messages.editForumTopic</a>
1272+
* <a href="https://docs.madelineproto.xyz/API_docs/methods/messages.getEmojiGameInfo.html" name="messages.getEmojiGameInfo">messages.getEmojiGameInfo</a>
12711273
* <a href="https://docs.madelineproto.xyz/API_docs/methods/messages.getForumTopics.html" name="messages.getForumTopics">messages.getForumTopics</a>
12721274
* <a href="https://docs.madelineproto.xyz/API_docs/methods/messages.getForumTopicsByID.html" name="messages.getForumTopicsByID">messages.getForumTopicsByID</a>
12731275
* <a href="https://docs.madelineproto.xyz/API_docs/methods/messages.reorderPinnedForumTopics.html" name="messages.reorderPinnedForumTopics">messages.reorderPinnedForumTopics</a>
1276+
* <a href="https://docs.madelineproto.xyz/API_docs/methods/messages.summarizeText.html" name="messages.summarizeText">messages.summarizeText</a>
12741277
* <a href="https://docs.madelineproto.xyz/API_docs/methods/messages.updatePinnedForumTopic.html" name="messages.updatePinnedForumTopic">messages.updatePinnedForumTopic</a>
12751278
* <a href="https://docs.madelineproto.xyz/PHP/danog/MadelineProto/API.html#rleDecode" name="rleDecode">null-byte RLE decode: rleDecode</a>
12761279
* <a href="https://docs.madelineproto.xyz/PHP/danog/MadelineProto/API.html#rleEncode" name="rleEncode">null-byte RLE encode: rleEncode</a>
1280+
* <a href="https://docs.madelineproto.xyz/API_docs/methods/payments.craftStarGift.html" name="payments.craftStarGift">payments.craftStarGift</a>
1281+
* <a href="https://docs.madelineproto.xyz/API_docs/methods/payments.getCraftStarGifts.html" name="payments.getCraftStarGifts">payments.getCraftStarGifts</a>
12771282
* <a href="https://docs.madelineproto.xyz/API_docs/methods/payments.getStarGiftActiveAuctions.html" name="payments.getStarGiftActiveAuctions">payments.getStarGiftActiveAuctions</a>
12781283
* <a href="https://docs.madelineproto.xyz/API_docs/methods/payments.getStarGiftAuctionAcquiredGifts.html" name="payments.getStarGiftAuctionAcquiredGifts">payments.getStarGiftAuctionAcquiredGifts</a>
12791284
* <a href="https://docs.madelineproto.xyz/API_docs/methods/payments.getStarGiftAuctionState.html" name="payments.getStarGiftAuctionState">payments.getStarGiftAuctionState</a>

docs

Submodule docs updated 221 files

examples/secret_bot.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
use danog\MadelineProto\Logger;
2626
use danog\MadelineProto\Settings;
2727
use danog\MadelineProto\SimpleEventHandler;
28-
use danog\MadelineProto\VoIP;
2928

3029
/*
3130
* Various ways to load MadelineProto

langs/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,6 @@
157157
"plugin_path_does_not_exist": "Plugin path %s does not exist!",
158158
"windows_warning": "For Windows users: please switch to Linux if this fails. You can also try modifying the firewall settings to allow all PHP processes to create sockets (it's 100% easier to just switch to Linux, on Linux MadelineProto just works out of the box, no changes needed)",
159159
"could_not_connect_to_MadelineProto": "Could not connect to MadelineProto, please enable proc_open and remove open_basedir restrictions or disable webserver path rewrites to fix! If you already did that, make sure the CLI version of PHP is exactly the same as the web version (same version, extensions, et cetera) and check out the MadelineProto.log file for more info about the error that prevented the IPC server from starting.",
160-
"translate_madelineproto_web": "MadelineProto can be translated in your language (current translation progress: %d%%), click <a href=\"https://weblate.madelineproto.xyz/projects/madelineproto/\" target=\"_blank\">here to contribute with the translation!</a>",
161-
"translate_madelineproto_cli": "MadelineProto can be translated in your language (current translation progress: %d%%), go to https://weblate.madelineproto.xyz/projects/madelineproto/ to contribute with the translation!"
160+
"translate_madelineproto_web": "MadelineProto can be translated in your language (current translation progress: %d%%), click <a href=\"https://weblate.madelineproto.xyz\" target=\"_blank\">here to contribute with the translation!</a>",
161+
"translate_madelineproto_cli": "MadelineProto can be translated in your language (current translation progress: %d%%), go to https://weblate.madelineproto.xyz to contribute with the translation!"
162162
}

src/API.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ protected function connectToMadelineProto(SettingsAbstract $settings, bool $forc
310310
$this->session,
311311
$settings,
312312
$forceFull
313-
)->await(Tools::getTimeoutCancellation(30.0));
313+
)->await(Tools::getTimeoutCancellation(30.0, "Timeout during session unserialization!"));
314314
} catch (CancelledException $e) {
315315
if (!$e->getPrevious() instanceof TimeoutException) {
316316
throw $e;

src/APIWrapper.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
namespace danog\MadelineProto;
2222

23-
use Amp\Cancellation;
24-
use Amp\TimeoutCancellation;
2523
use danog\MadelineProto\Ipc\Client;
2624

2725
final class APIWrapper
@@ -76,15 +74,6 @@ public function getAPI(): Client|MTProto|null
7674
return $this->API;
7775
}
7876

79-
private ?float $drop = null;
80-
/**
81-
* @internal
82-
*/
83-
public function getRpcDropCancellation(): Cancellation
84-
{
85-
return new TimeoutCancellation($this->drop ??= (float) $this->getAPI()->getSettings()->getRpc()->getRpcDropTimeout());
86-
}
87-
8877
/**
8978
* Get IPC path.
9079
*

src/DoHConnector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function connect(
120120
$watcher = EventLoop::onWritable($socket, $deferred->complete(...));
121121
$id = $token->subscribe($deferred->error(...));
122122
try {
123-
$deferred->getFuture()->await(Tools::getTimeoutCancellation($timeout));
123+
$deferred->getFuture()->await(Tools::getTimeoutCancellation($timeout, "Timeout while connecting to $uri"));
124124
} catch (CancelledException $e) {
125125
if (!$e->getPrevious() instanceof DnsTimeoutException) {
126126
throw $e;

0 commit comments

Comments
 (0)