Feature: Render meshcore-open rich-chat payloads (GIFs, reactions) #210

Closed
opened 2026-10-05 02:03:38 +02:00 by adam · 4 comments
Owner

The meshcore-open client sends several rich-chat features as ordinary plaintext mesh messages. Remote Terminal currently displays the raw encoded strings, e.g.:

Image

It'd be nice for remote term to recognize and render these. The relevant formats:

Prefix Meaning Format Source
g: Giphy GIF g:<gifId> → https://media.giphy.com/media/<gifId>/giphy.gif gif_helper.dart
r: Emoji reaction r:<hash>:<index> (4 hex : 2 hex) reaction_helper.dart

GIFs are trivial: regex ^g:([A-Za-z0-9_-]+)$ and embed the Giphy URL.

Reactions are harder. <index> indexes a fixed emoji list, but <hash> identifies the target message via Dart's String.hashCode & 0xFFFF over "<timestampSeconds><senderName?><first 5 chars>" — a non-standard hash that must be ported to attach a reaction to the right message. A simpler first step would be to just display reactions generically (e.g. 👍 reacted) instead of the literal r:....

(Other prefixes meshcore-open uses, for completeness: s: smaz-compressed text, m: location, V1| reserved.)

The [meshcore-open](https://github.com/zjs81/meshcore-open) client sends several rich-chat features as ordinary plaintext mesh messages. Remote Terminal currently displays the raw encoded strings, e.g.: <img width="262" height="148" alt="Image" src="https://github.com/user-attachments/assets/58993049-782f-4f10-8fb2-bdaea3e5fc26" /> It'd be nice for remote term to recognize and render these. The relevant formats: | Prefix | Meaning | Format | Source | | ------ | -------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | | `g:` | Giphy GIF | `g:<gifId>` → `https://media.giphy.com/media/<gifId>/giphy.gif` | [gif_helper.dart](https://github.com/zjs81/meshcore-open/blob/dev/lib/helpers/gif_helper.dart) | | `r:` | Emoji reaction | `r:<hash>:<index>` (4 hex : 2 hex) | [reaction_helper.dart](https://github.com/zjs81/meshcore-open/blob/dev/lib/helpers/reaction_helper.dart) | **GIFs** are trivial: regex `^g:([A-Za-z0-9_-]+)$` and embed the Giphy URL. **Reactions** are harder. `<index>` indexes a fixed emoji list, but `<hash>` identifies the target message via Dart's `String.hashCode & 0xFFFF` over `"<timestampSeconds><senderName?><first 5 chars>"` — a non-standard hash that must be ported to attach a reaction to the right message. A simpler first step would be to just display reactions generically (e.g. `👍 reacted`) instead of the literal `r:...`. (Other prefixes meshcore-open uses, for completeness: `s:` smaz-compressed text, `m:` location, `V1|` reserved.) <!-- github-sync-id:4678297285 -->
adam closed this issue 2026-10-05 02:03:38 +02:00
Author
Owner

Hmmmm interesting! this probably wouldn't be too hard to support

Hmmmm interesting! this probably wouldn't be too hard to support <!-- github-comment-id:4760442509 -->
Author
Owner

Alrighty I have added a first pass at this. Totally untested tbh; I'm running a little tight on time. Let me know how it works for you!

Alrighty I have added a first pass at this. Totally untested tbh; I'm running a little tight on time. Let me know how it works for you! <!-- github-comment-id:4760875837 -->
Author
Owner

Alrighty I have added a first pass at this. Totally untested tbh; I'm running a little tight on time. Let me know how it works for you!

Most working as expected. Thanks. But it will be nice to join reaction to the last receiver message or just mention receiver
And gifs with receiver @[name] not decoding

Image
> Alrighty I have added a first pass at this. Totally untested tbh; I'm running a little tight on time. Let me know how it works for you! Most working as expected. Thanks. But it will be nice to join reaction to the last receiver message or just mention receiver And gifs with receiver @[name] not decoding <details> <img width="861" height="1041" alt="Image" src="https://github.com/user-attachments/assets/43221fa3-8929-4c81-a278-7311495e6729" /> </details> <!-- github-comment-id:4778887894 -->
Author
Owner

Yeah to be honest linking the reactions is kind of a pain in the butt and not something I'm going to implement right now, but I'll get the tag + gif fixed.

Yeah to be honest linking the reactions is kind of a pain in the butt and not something I'm going to implement right now, but I'll get the tag + gif fixed. <!-- github-comment-id:4920024585 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Remote-Terminal-for-MeshCore#210