MadelineProto
MadelineProto copied to clipboard
Cancel getUpdates
Can you add function for cancelling getUpdates? e.g:
--- src/MTProtoTools/UpdateHandler.php
+++ src/MTProtoTools/UpdateHandler.php
@@ -384,6 +384,17 @@ trait UpdateHandler
}
}
}
+ public function cancelGetUpdates(): bool
+ {
+ if (!$this->usingGetUpdates || !$this->update_deferred) {
+ return false;
+ }
+
+ $deferred = $this->update_deferred;
+ $this->update_deferred = null;
+ $deferred->error(new \Exception("cancel"));
+ return true;
+ }
/**
* Check message ID.
*
This is caused by a server-side issue, the layer was rollbacked to 207 in MadelineProto 8.5.3 to avoid it until it is fixed by the devs.
I didn't mean to report any bug or issue, it's feature request to get ability to cancel $MP->getUpdates() function without having to wait timeout
Aha,