Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.setState({
msghistory: [...this.state.msghistory, textMessage]
});
this.props.handleOnRecentMessageSent(messageId);
} else if (
textMessage.receiverType === CometChat.RECEIVER_TYPE.GROUP &&
textMessage.receiverId === this.props.activeConversation.guid
) {
if(textMessage.sender.uid !== this.props.subjectUID)
{
// Handle text message
senderID = textMessage.sender.uid;
messageId = textMessage.id;
CometChat.markMessageAsRead(textMessage);
this.props.handleOnRecentMessageSent(messageId);
this.setState({
msghistory: [...this.state.msghistory, textMessage]
});
}
}
this.scrollToBottom();
},
onMediaMessageReceived: mediaMessage => {
messages => {
if (!_.isEmpty(messages)) {
const last_message = _.last(messages);
if (last_message.sender.uid !== this.props.subjectUID) {
CometChat.markMessageAsRead(last_message);
}
}
this.setState({ msghistory: messages });
this.scrollToBottom();
},
error => {
CometChat.markMessageAsRead(
mediaMessage
);
this.props.handleOnRecentMessageSent(messageId);
} else if (
mediaMessage.sender.guid !== undefined &&
mediaMessage.sender.guid === this.props.activeConversation.guid
) {
this.setState({
msghistory: [...this.state.msghistory, mediaMessage]
});
messageId = mediaMessage.id;
senderID = mediaMessage.sender.uid;
if (senderID !== this.props.subjectUID)
CometChat.markMessageAsRead(mediaMessage);
this.props.handleOnRecentMessageSent(messageId);
}
this.scrollToBottom();
},
onMessageRead: messageReceipt => {