Snapshot of main at 9f39a6e1e (2026-11-02)

This commit is contained in:
Ronald Huynen committed 2026-11-02 10:41:47 +01:00
commit 6ccf1792d7
2580 files changed
+1040202

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
<?php
namespace App\Observers;
use Namu\WireChat\Models\Conversation;
class ConversationObserver
{
/**
* Handle the Conversation "created" event.
*/
public function created(Conversation $conversation): void
{
// Automatically set disappearing fields (always enabled to prevent orphaned messages)
$durationInDays = timebank_config('wirechat.disappearing_messages.duration', 30);
$durationInSeconds = $durationInDays * 86400; // Convert days to seconds
$conversation->disappearing_started_at = now();
$conversation->disappearing_duration = $durationInSeconds;
$conversation->save();
}
}