Custom Channel Message

// Detailed description of issue.

I would like to develop the flow below, is there a method or methodology I can use for this?

  1. there is a setting in the Services app called “Only allow to receive messages from friends”.
  2. an existing chat room history exists between user A (Allow all) and user B (Allow all)
  3. User B has applied the ‘Only allow messages from friends’ option.
  4. in the existing chat room between A and B, when A tries to send a chat to B, B is unable to forward the message because A has applied the ‘Only allow messages to friends’ setting.