add timestamps to chat messages

This commit is contained in:
HF 2022-02-09 17:46:14 +01:00
parent 2192c05e6f
commit 25169dcf62
2 changed files with 6 additions and 2 deletions

View File

@ -73,6 +73,7 @@ function init() {
isRead = isRead || state.windows.modal.open
&& state.windows.args[0].chatChannel === channelId;
// TODO ping doesn't work since update
const isPing = (nameRegExp && text.match(nameRegExp));
store.dispatch(receiveChatMessage(
name,

View File

@ -90,6 +90,7 @@ class ChatMessageBuffer {
'uid',
'name',
'flag',
'createdAt',
],
where: { cid },
limit,
@ -101,16 +102,18 @@ class ChatMessageBuffer {
while (i > 0) {
i -= 1;
const {
name,
message,
flag,
uid,
name,
flag,
createdAt,
} = messagesModel[i];
messages.push([
name,
message,
flag,
uid,
createdAt,
]);
}
return messages;