1
0
Fork 0

Merge pull request #12621 from MrPetovan/bug/12620-api-push-boolean

Cast alert types to boolean in Api\Mastodon\Subscription
This commit is contained in:
Philipp 2023-01-05 18:28:39 +01:00 committed by GitHub
commit 7fcb6c86f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,11 +50,11 @@ class Subscription extends BaseDataTransferObject
$this->id = (string)$subscription['id'];
$this->endpoint = $subscription['endpoint'];
$this->alerts = [
Notification::TYPE_FOLLOW => $subscription[Notification::TYPE_FOLLOW],
Notification::TYPE_LIKE => $subscription[Notification::TYPE_LIKE],
Notification::TYPE_RESHARE => $subscription[Notification::TYPE_RESHARE],
Notification::TYPE_MENTION => $subscription[Notification::TYPE_MENTION],
Notification::TYPE_POLL => $subscription[Notification::TYPE_POLL],
Notification::TYPE_FOLLOW => (bool)$subscription[Notification::TYPE_FOLLOW],
Notification::TYPE_LIKE => (bool)$subscription[Notification::TYPE_LIKE],
Notification::TYPE_RESHARE => (bool)$subscription[Notification::TYPE_RESHARE],
Notification::TYPE_MENTION => (bool)$subscription[Notification::TYPE_MENTION],
Notification::TYPE_POLL => (bool)$subscription[Notification::TYPE_POLL],
];
$this->server_key = $vapid;