The UX for many messaging applications is built so that if one person (User A) starts a 1:1 message with another user (User B), only User A will see the channel until they send a message, at which point, both users can see the channel.
Think of an application like Slack - if you start a new 1:1 message, you will see the message window, but the person that you are messaging will not see the channel until you actually send the message.
To achieve this sort of functionality, you can use this filter in your queryChannels call. As always, you may want to tweak this slightly to fit your needs and if you have trouble implementing this, you are always free to contact support.
const filters = { $and: [ { type: channel_type }, { members: { $in: [current_user_id] } }, { $or: [ { last_message_at: { $gte: '2020-10-10T16:01:49.27673Z' } }, { created_by_id: current_user_id }, ], }, ], };
Comments
1 comment
This was very helpful! Thanks!
Please sign in to leave a comment.