Files
timebank-cc-public/app/Console/Commands/WireChatDeleteExpiredMessages.php
Ronald Huynen 2547717edb Initial commit
2026-03-23 21:37:59 +01:00

46 lines
1.1 KiB
PHP

<?php
namespace App\Console\Commands;
use App\Jobs\DeleteExpiredWireChatMessagesJob;
use Illuminate\Console\Command;
class WireChatDeleteExpiredMessages extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'wirechat:delete-expired';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Delete expired disappearing messages from WireChat conversations';
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
if (!timebank_config('wirechat.disappearing_messages.enabled', true)) {
$this->info('Disappearing messages feature is disabled');
return Command::SUCCESS;
}
$this->info('Dispatching job to delete expired disappearing messages...');
// Dispatch to 'low' queue
DeleteExpiredWireChatMessagesJob::dispatch();
$this->info('Job dispatched to low queue!');
return Command::SUCCESS;
}
}