diff --git a/docs b/docs index 91575fa..508fde0 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 91575fa90c8e10426f3252af75a0bf65cf12f5d1 +Subproject commit 508fde056d999a67d9596c9af78152e3d5f3d0c6 diff --git a/src/Models/Conversation.php b/src/Models/Conversation.php index 02fa7a5..402f2fd 100644 --- a/src/Models/Conversation.php +++ b/src/Models/Conversation.php @@ -186,18 +186,18 @@ public function messages(){ public function unread(int|ChatEventMaker $user = null){ $user_id = $user->id ?? $user ?? auth()->user()?->id; - return $this->notMsgEvents($user_id, 'read')->latest() + return $this->doesntHaveChatEvents($user_id, 'read')->latest() ->when($user_id, fn ($q) => $q->whereNotSender($user_id)); } function undelivered(int|ChatEventMaker $user = null){ $user_id = $user->id ?? $user ?? auth()->user()?->id; - return $this->notMsgEvents($user_id, 'deliver') + return $this->doesntHaveChatEvents($user_id, 'deliver') ->where('user_id', '!=', $user_id); } - function notMsgEvents(int|ChatEventMaker $user, $type = null) { + function doesntHaveChatEvents(int|ChatEventMaker $user, $type = null) { $user_id = $user->id ?? $user; return $this->messages()