nahid / talk

Talk is a real-time users messaging and chatting system for Laravel.
MIT License
1.61k stars 327 forks source link

get only messages which are not softdeleted #37

Closed haheute closed 1 year ago

haheute commented 7 years ago

Hello. How can I get only the messages which are not deleted_from_sender ? I show a conversation to a specific user and when I softdelete a message, it is still shown after it has been marked as deleted_from_sender.

It is good that a user can softdelete his/her copy of a message. But then I still see it.

    $messages = null;
    $conversations = Talk::getConversationsByUserId($user->id, 0, 20);
    if($conversations){
        $messages = $conversations->messages->reverse();
    }

The ->messages does not seem to check if the messages are softdeleted:

select * from `messages` where `messages`.`conversation_id` = '2' and `messages`.`conversation_id` is not null

Maybe I just don't see right the method/function.. Thanks for help.

nahid commented 7 years ago

please share your messages table and delation code.

haheute commented 1 year ago

This issue is very old. I totally forgot it. Sorry. Closing because I'm not longer using Laravel and Talk.