diff --git a/src/d2m/actions/register-pk-user.js b/src/d2m/actions/register-pk-user.js index e68d2cc..4946d4f 100644 --- a/src/d2m/actions/register-pk-user.js +++ b/src/d2m/actions/register-pk-user.js @@ -103,7 +103,6 @@ async function memberToStateContent(pkMessage, author) { // We prefer to use the member's avatar URL data since the image upload can be cached across channels, // unlike the userAvatar URL which is unique per channel, due to the webhook ID being in the URL. const avatar = pkMessage.member.avatar_url || pkMessage.member.webhook_avatar_url || pkMessage.system.avatar_url || file.userAvatar(author) - const color = pkMessage.member.color ?? pkMessage.system.color const content = { displayname: author.username, @@ -111,12 +110,6 @@ async function memberToStateContent(pkMessage, author) { "moe.cadence.ooye.pk_member": pkMessage.member } if (avatar) content.avatar_url = await file.uploadDiscordFileToMxc(avatar) - if (color) { - content["eu.she-a.color"] = { - on_dark: `#${color}`, - on_light: `#${color}` - } - } return content } diff --git a/src/d2m/actions/register-user.js b/src/d2m/actions/register-user.js index bd10d5e..d475e54 100644 --- a/src/d2m/actions/register-user.js +++ b/src/d2m/actions/register-user.js @@ -194,9 +194,7 @@ function memberToPowerLevel(user, member, guild, channel) { * @param {number} powerLevel */ function _hashProfileContent(content, powerLevel) { - let toHash = `${content.displayname}\u0000${content.avatar_url}\u0000${powerLevel}` - if (content["eu.she-a.color"]?.on_dark) toHash += `\u0000${content["eu.she-a.color"].on_dark}` - const unsignedHash = hasher.h64(toHash) + const unsignedHash = hasher.h64(`${content.displayname}\u0000${content.avatar_url}\u0000${powerLevel}`) const signedHash = unsignedHash - 0x8000000000000000n // shifting down to signed 64-bit range return signedHash } @@ -245,7 +243,6 @@ async function syncUser(user, member, channel, guild, roomID, interactionMetadat async function _sendSyncUser(roomID, mxid, content, powerLevel, options) { const currentHash = _hashProfileContent(content, powerLevel ?? 0) const existingHash = select("sim_member", "hashed_profile_content", {room_id: roomID, mxid}).safeIntegers().pluck().get() - console.log(roomID, mxid, existingHash, currentHash) // only do the actual sync if the hash has changed since we last looked const hashHasChanged = existingHash !== currentHash // always okay to add new data. for overwriting, restrict based on options.allowOverwrite, if present diff --git a/src/d2m/converters/message-to-event.js b/src/d2m/converters/message-to-event.js index 79c0298..c0b9622 100644 --- a/src/d2m/converters/message-to-event.js +++ b/src/d2m/converters/message-to-event.js @@ -641,7 +641,8 @@ async function messageToEvent(message, guild, options = {}, di) { html = "* " + html } - if (((message.flags || 0) & DiscordTypes.MessageFlags.IsCrosspost) && message.author?.username) { + const flags = message.flags || 0 + if (flags & DiscordTypes.MessageFlags.IsCrosspost) { body = `[↷ ${message.author.username}]\n` + body html = `↷ ${message.author.username}
` + html } diff --git a/src/web/pug/opt-out.pug b/src/web/pug/opt-out.pug index 3cb2114..f7233f4 100644 --- a/src/web/pug/opt-out.pug +++ b/src/web/pug/opt-out.pug @@ -16,9 +16,6 @@ block body - let value = !select("opt_out", "user_id", {user_id: session.data.userID}).pluck().get() - noscript - .s-notice.s-notice__danger.mb16 You must enable JavaScript to use this form. Please do that now! - #opt-in-msg(hx-swap-oob="true") if msg .s-notice.s-notice__info.mb16= msg