I am loading the chat with a history of the individuals dialog when the person logs into the system using the renderMessage method (see code below).
This works fine but it displays all the messages on the left side of the grid as though they have been received. Instead I would like to show the messages as sent messages and received messages as they originally were. Is there a way to accomplish this?
function LoadChat(chat) {
$.ajax({
url: "/.../Chat/LoadChatBox?studyID=" + @Model.Recipient.StudyID,
success: function (data) {
var chatHistory = JSON.parse(data);
if (chatHistory) {
$.each(chatHistory.messages, function (n, elem) {
chat.renderMessage(elem.message, elem.sender);
});
}
}
});
}
This works fine but it displays all the messages on the left side of the grid as though they have been received. Instead I would like to show the messages as sent messages and received messages as they originally were. Is there a way to accomplish this?