diff --git a/src/d2m/converters/message-to-event.js b/src/d2m/converters/message-to-event.js index 3c953c4..8a8e50f 100644 --- a/src/d2m/converters/message-to-event.js +++ b/src/d2m/converters/message-to-event.js @@ -474,12 +474,6 @@ async function messageToEvent(message, guild, options = {}, di) { content = transformAttachmentLinks(content) content = await transformContentMessageLinks(content) - // Remove smalltext from non-bots (I don't like it). Webhooks included due to PluralKit. - const isHumanOrDataMissing = !message.author?.bot - if (isHumanOrDataMissing || dUtils.isWebhookMessage(message)) { - content = content.replaceAll(/^-# +([^\n].*?)/gm, "...$1") - } - // Handling emojis that we don't know about. The emoji has to be present in the DB for it to be picked up in the emoji markdown converter. // So we scan the message ahead of time for all its emojis and ensure they are in the DB. const emojiMatches = [...content.matchAll(/<(a?):([^:>]{1,64}):([0-9]+)>/g)] @@ -856,9 +850,7 @@ async function messageToEvent(message, guild, options = {}, di) { } const {body, formatted_body} = stack[0].get() - if (body.trim().length) { - await addTextEvent(body, formatted_body, "m.text") - } + await addTextEvent(body, formatted_body, "m.text") } // Then polls diff --git a/src/d2m/converters/message-to-event.test.js b/src/d2m/converters/message-to-event.test.js index ee64c2d..c30cd1f 100644 --- a/src/d2m/converters/message-to-event.test.js +++ b/src/d2m/converters/message-to-event.test.js @@ -1605,18 +1605,3 @@ test("message2event: multiple-choice poll", async t => { "org.matrix.msc1767.text": "more than one answer allowed\n1. [😭] no\n2. oh no\n3. oh noooooo" }]) }) - -test("message2event: smalltext from regular user", async t => { - const events = await messageToEvent({ - content: "-# hmm", - author: { - bot: false - } - }) - t.deepEqual(events, [{ - $type: "m.room.message", - msgtype: "m.text", - "m.mentions": {}, - body: "...hmm" - }]) -}) diff --git a/test/data.js b/test/data.js index 2205676..09749e6 100644 --- a/test/data.js +++ b/test/data.js @@ -4987,20 +4987,31 @@ module.exports = { edited_timestamp: null, flags: 32768, author: { - id: '466378653216014359', - username: 'PluralKit', + id: '772659086046658620', + username: 'cadence.worm', avatar: '466df0c98b1af1e1388f595b4c1ad1b9', discriminator: '0', public_flags: 0, flags: 0, - bot: true, banner: null, accent_color: null, - global_name: 'PluralKit', + global_name: 'cadence', avatar_decoration_data: null, collectibles: null, display_name_styles: null, - banner_color: null + banner_color: null, + clan: { + identity_guild_id: '532245108070809601', + identity_enabled: true, + tag: 'doll', + badge: 'dba08126b4e810a0e096cc7cd5bc37f0' + }, + primary_guild: { + identity_guild_id: '532245108070809601', + identity_enabled: true, + tag: 'doll', + badge: 'dba08126b4e810a0e096cc7cd5bc37f0' + } }, components: [ {