public ChatMessage createFinalMessage ( MessageSentResponse response ) { return ChatMessage . builder ( ) . setMessageId ( response . getId ( ) ) . setSentEventId ( response . getEventId ( ) ) . setConversationId ( conversationId ) . setSentBy ( sender ) . setFromWhom ( new Sender ( sender , sender ) ) . setSentOn ( System . currentTimeMillis ( ) ) . setParts ( getAllParts ( ) ) . setMetadata ( originalMessage . getMetadata ( ) ) . build ( ) ; }
Create a final message for a conversation . At this point we know message id and sent event id .