stream-chat-js icon indicating copy to clipboard operation
stream-chat-js copied to clipboard

How can I filter the chat list excepting for items which inviting member request is rejected?

Open cleandevcode opened this issue 3 years ago • 0 comments

Hello,

My application has 2 tabs - Inbox and Message Request.

  • Filter for Inbox:
    type: `messaging`,
    members: { $in: [user?.id] },
    last_message_at: { $lt: new Date() },
    member_count: { $eq: 2 },
    joined: { $eq: true }
  • Filter for Message Request
    type: `messaging`,
    members: { $in: [user?.id] },
    last_message_at: { $lt: new Date() },
    member_count: { $eq: 2 },
    joined: { $eq: false },
    invite: { $eq: `pending` },

It works well now. But the problem happens when rejecting the pending message request. For example, If User A requests a message to User B, then this message will display in Inbox from User A, and Message Request from User B. If User B accepts User A's request, then the conversation will be started on Both Inbox. If User B rejects User A's request, then the pending item from User B's Message request will be disappeared. At the same time, the message from User A's side will be disappeared as well.

So I am gonna implement this feature by using filtering. So if inviting member is rejected, then it will be filtered in Inbox filter. How can I do it?

Regards.

cleandevcode avatar Aug 30 '22 10:08 cleandevcode