Fixed avatar timestamping.

This commit is contained in:
flash 2024-05-09 18:30:08 +00:00
parent 5cbe5e98f2
commit 265c6e8e7f
2 changed files with 4 additions and 2 deletions

View file

@ -360,7 +360,7 @@ const MamiSockChatHandlers = function(ctx, client, setLoadingOverlay, sockChatRe
senderInfo.name ?? rawUserInfo.name,
senderInfo.colour ?? rawUserInfo.colour,
senderInfo.perms?.rank ?? rawUserInfo.perms?.rank ?? 0,
new MamiUserAvatarInfo(senderInfo.id ?? rawUserInfo.id ?? '0'),
senderInfo.avatar ?? rawUserInfo.avatar ?? new MamiUserAvatarInfo(senderInfo.id ?? rawUserInfo.id ?? '0'),
);
type = `message:${ev.detail.msg.flags.isAction ? 'action' : 'text'}`;

View file

@ -28,8 +28,10 @@ const MamiUserStatusInfo = function(isAway = false, message = '') {
};
};
const MamiUserAvatarInfo = function(userId) {
const MamiUserAvatarInfo = function(userId = null) {
userId ??= '';
if(typeof userId !== 'string')
throw 'userId must be a string or null';
const template = futami.get('avatar') ?? '';
const changeTime = Date.now();