add a message entity and use it in the client

unit may be null at this point, according to the constructor, no ?