Skip to content

Commit

Permalink
Merge pull request #1226 from TiiFuchs/drop_pending_updates
Browse files Browse the repository at this point in the history
Fixed non-working drop_pending_updates in setWebhook and deleteWebhook
  • Loading branch information
noplanman authored Jun 20, 2021
2 parents ed2df60 + 385e7f3 commit 998de91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ public static function send(string $action, array $data = []): ServerResponse
*/
protected static function addDummyParamIfNecessary(string $action, array &$data): void
{
if (in_array($action, self::$actions_need_dummy_param, true)) {
if (empty($data) && in_array($action, self::$actions_need_dummy_param, true)) {
// Can be anything, using a single letter to minimise request size.
$data = ['d'];
}
Expand Down
2 changes: 2 additions & 0 deletions src/Telegram.php
Original file line number Diff line number Diff line change
Expand Up @@ -1027,8 +1027,10 @@ public function setWebhook(string $url, array $data = []): ServerResponse

$data = array_intersect_key($data, array_flip([
'certificate',
'ip_address',
'max_connections',
'allowed_updates',
'drop_pending_updates'
]));
$data['url'] = $url;

Expand Down

0 comments on commit 998de91

Please sign in to comment.