Skip to content
Snippets Groups Projects
Commit 8eaa48fe authored by Tainan Felipe's avatar Tainan Felipe
Browse files

re-added message when user leaves a meeting

parent 545d9e15
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ export default injectIntl(createContainer(({ params, intl }) => {
const chatID = params.chatID || PUBLIC_CHAT_KEY;
let messages = [];
const isChatLocked = ChatService.isChatLocked(chatID);
let isChatLocked = ChatService.isChatLocked(chatID);
let title = intl.formatMessage(intlMessages.titlePublic);
let chatName = title;
......@@ -73,9 +73,28 @@ export default injectIntl(createContainer(({ params, intl }) => {
title = intl.formatMessage(intlMessages.titlePrivate, { 0: chatUser.name });
chatName = chatUser.name;
if (!chatUser.isOnline) {
const time = Date.now();
const id = `partner-disconnected-${time}`;
const messagePartnerLoggedOut = {
id,
content: [{
id,
text: intl.formatMessage(intlMessages.partnerDisconnected, { 0: chatUser.name }),
time,
}],
time,
sender: null,
};
messages.push(messagePartnerLoggedOut);
isChatLocked = true;
}
}
}
const scrollPosition = ChatService.getScrollPosition(chatID);
const hasUnreadMessages = ChatService.hasUnreadMessages(chatID);
const lastReadMessageTime = ChatService.lastReadMessageTime(chatID);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment