From 664d6b632f8221c8154a912323a9669a40f4d5af Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 14 Oct 2026 23:39:33 -0700 Subject: Group chats: White Noise's own :marmot: and :wn: draw as pictures. White Noise sends its two built-in emoji as bare shortcodes — no NIP-30 tag, no picture — so a :marmot: reaction in the community showed as text (Adam; the phone's group log: kind 7, content ":marmot:", an e tag and nothing else). Their artwork is published in the app's repository (builtin_emoji_marmot.png, builtin_emoji_wn.png); emojiUrl now resolves those two codes to it through our picture proxy (serverPic, a 72px tile cached on vmedia for a week, as any picture in a post), not bundled: the app is AGPL and this one MIT. Learned packs and tags still come first. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01J1Kon8bxJoHRpJdSzshCkp --- src/features/messages.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/features') diff --git a/src/features/messages.js b/src/features/messages.js index 59dc966..7fcce9e 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -169,6 +169,12 @@ export function messagesFeature(ctx) { if (now) write(); else emojiSaveTimer = setTimeout(write, 500); }; // code → image url: held packs first (in order), then what's been seen + // White Noise's own two emoji, which it sends as bare :codes: (no NIP-30 + // tag, no picture): drawn from its published artwork, through our picture + // proxy — a copy served and cached here, as any picture in a post is, not + // bundled (the app is AGPL, this one MIT). + const WN_RAW = 'https://raw.githubusercontent.com/marmot-protocol/whitenoise-android/master/app/src/main/res/drawable-nodpi/'; + const BUILTIN_EMOJI = { marmot: WN_RAW + 'builtin_emoji_marmot.png', wn: WN_RAW + 'builtin_emoji_wn.png' }; const emojiUrl = (code) => { const s = emojiSt(); for (const addr of s.order) { @@ -176,7 +182,7 @@ export function messagesFeature(ctx) { if (!p) continue; for (const [c, u] of p.emojis) if (c === code) return u; } - return s.learned[code] || null; + return s.learned[code] || (BUILTIN_EMOJI[code] ? serverPic(BUILTIN_EMOJI[code], 'tile') : null); }; // everything typeable: [{ code, url, pack }], packs first, newest-seen next function customEmojis() { -- cgit v1.2.3