Continue to show all common addresses in Items Waiting tab, Add Address Clear Queue job to delete anything in the queue for an address

This commit is contained in:
2024-11-04 15:58:20 +11:00
parent 80fa3e840b
commit 0bd2f6e82c
6 changed files with 146 additions and 37 deletions

View File

@@ -67,26 +67,6 @@ class AddressIdle implements ShouldQueue
Log::info(sprintf('%s:- Delisting [%s], not seen for at least [%d] days',self::LOGKEY,$ao->ftn,$ao->system->last_seen?->diffInDays()));
$contact = FALSE;
// Remove echomail not collected from echomail_seenby
DB::table('echomail_seenby')
->where('address_id',$ao->id)
->whereNotNull('export_at')
->whereNull('sent_at')
->delete();
// Remove FLAG_INTRANSIT from netmail that hasnt been delivered
DB::table('netmails')
->where('tftn_id',$ao->id)
->whereRaw(sprintf('(flags & %d) > 0',Message::FLAG_INTRANSIT))
->update(['flags'=>DB::raw(sprintf('(flags & ~%d)',Message::FLAG_INTRANSIT))]);
// Remove files not collected
DB::table('file_seenby')
->where('address_id',$ao->id)
->whereNotNull('export_at')
->whereNull('sent_at')
->delete();
// Remove subscribed echoareas
$ao->echoareas()->detach();
@@ -97,6 +77,9 @@ class AddressIdle implements ShouldQueue
$ao->validated = FALSE;
$ao->save();
// Clear the queue
AddressClearQueue::dispatchSync($ao);
// Email Alert
if ($ao->system->users->count()) {
Notification::send($ao->system->users,new NodeDelistedEmail($ao->withoutRelations()));