extract user names frm old message when they come in

This commit is contained in:
Ginger Wong
2020-08-15 18:41:31 -07:00
parent 703aa40271
commit 979651a925
3 changed files with 17 additions and 41 deletions

View File

@@ -181,3 +181,15 @@ export function generatePlaceholderText(isEnabled, hasSentFirstChatMessage) {
}
return CHAT_PLACEHOLDER_OFFLINE;
}
export function extraUserNamesFromMessageHistory(messages) {
const list = [];
if (messages) {
messages.forEach(function(message) {
if (!list.includes(message.author)) {
list.push(message.author);
}
});
}
return list;
}