<?php
namespace EasyChat\Library\Queue\Jobs;

use EasyChat\Library\AndroidPushNotifier;
use EasyChat\Library\Queue\JobInterface;

 
class SmsInboundFilterRefreshJob implements JobInterface {
    private $registry;

    public function __construct($registry) {
        $this->registry = $registry;
    }

    public function handle(array $payload): void {
        $result = (new AndroidPushNotifier($this->registry))
            ->notifySmsInboundFilterChangedForReadyDevices();
        if (empty($result['success'])) {
            throw new \RuntimeException('sms_inbound_filter_refresh_push_failed');
        }
    }
}
