public List < ChatMessage > adaptMessages ( List < MessageReceived > messagesReceived ) { List < ChatMessage > chatMessages = new ArrayList <> ( ) ; if ( messagesReceived != null ) { for ( MessageReceived msg : messagesReceived ) { ChatMessage adaptedMessage = ChatMessage . builder ( ) . populate ( msg ) . build ( ) ; List < ChatMessageStatus > adaptedStatuses = adaptStatuses ( msg . getConversationId ( ) , msg . getMessageId ( ) , msg . getStatusUpdate ( ) ) ; for ( ChatMessageStatus s : adaptedStatuses ) { adaptedMessage . addStatusUpdate ( s ) ; } chatMessages . add ( adaptedMessage ) ; } } return chatMessages ; }
Translates received messages through message query to chat SDK model .