Skip to content

feat: add support for MCOimg - #491

Draft
Avi0n wants to merge 16 commits into
devfrom
feature/mcoimg
Draft

Avi0n wants to merge 16 commits into
devfrom
feature/mcoimg

Conversation

@Avi0n

@Avi0n Avi0n commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

This PR adds support for sending and decoding MCOimg v3 and v4. Sending MCOimg in channels is always done with v4 which uses GROUP_DATA. Direct messages use v3 which is plain text since DMs don't support GROUP_DATA.

Includes a basic pixel painter to draw images.

Closes #379

- A channel send uses GROUP_DATA. `im3:` text is rewritten to `im4:` before the row is saved.
- Direct messages send v3 text.
- The input bar can attach a drawing. The bubble draws a decoded image, and a bad payload shows the error text.
- Cover Send admits the drawing immediately, so the staged preview is gone
- Failures keep the pixels and use a title for connection, encode, or size
- The cover shows progress while sending, and Clear and the canvas stay idle
- The Pixel Paint strings are translated in the other locales
@Avi0n Avi0n changed the title feat: send MCOimg drawings in chat feat: add support for MCOimg Nov 14, 2026
Avi0n added 14 commits November 16, 2026 16:51
- A channel MCOimg with no packet sender time matches a reaction by a hash of the datagram bytes, with no five-minute window. The row keeps the sender name from send time.
- An incoming channel MCOimg joins the same receive path as channel text. It carries the decoded name and no wire time.
- A channel send is classified once. The pool, the radio command, and the queue share that result instead of reading the text again.
- A send that is not admitted leaves the draft or the pixels in place. A user resend changes the nonce before the queue stores the text.
A channel MCOimg has no sender timestamp, so extra paths join on the datagram data field.

- Decrypt a group datagram as a data type and blob, and leave the sender timestamp empty.
- Use the earliest matching RX row for the hop list, route, and region. Later rows add paths. Group text at wire time 0 stays a separate row.
- On import, merge the same incoming picture for one radio and one channel.
- Attach an RX row that was saved before the outgoing message.
- Show "Pixel drawing" instead of im4 text in notifications, the chat
  list, and VoiceOver
- Hide the sent-time rows in Message Info for a channel image with no
  wire time
- Send channel drawings as im3 group text on radios below firmware
  v11, which can't send group data
- Match duplicate channel images only within five minutes, so a later
  identical drawing is no longer merged into an old row
- Stamp send time on channel data so echoes of a delayed send still
  match
- Bound channel and RX-log lookups by that window instead of scanning
  the whole channel
- Treat text like "im2: on my way" as plain text unless the rest is
  Base91
- Draw raster images as one bitmap instead of one fill per pixel
- Name palette colors and pixel colors for VoiceOver, and say that the
  channel size limit counts the node name
- Restore the ChannelMessageEnvelope comment and fix the copy-matching
  rule in Reactions.md
- One ChannelReactionTarget on MessageDTO drives reaction indexing, lookup,
  sending, and admission for group text, outgoing rows, and datagram pictures
- findChannelMessageForReaction falls back to the newest datagram copy in the
  channel, so the separate datagram query is gone
- A datagram arrives as a .datagram kind framed as the group text it stands
  for, so sender Text Rules now match it like an im3 group-text picture
- One datagram predicate replaces two; an im3 group-text picture sent at wire
  time 0 now takes the timed hash its sender uses
- HeardRepeatsService shares one datagram observation step and takes the RX
  row in place of four context parameters
- Incoming channel text with no sender no longer offers reactions it cannot send
- A picture's body is Base91 text, so a message rule could match random
  characters and block an unrelated picture
- Sender rules still match a picture's sender in channels, DMs, and room posts
- Add a test that covers both cases
- An incoming datagram MCOimg stores the receipt time and sets timestampCorrected, because the packet has no sender clock
- The footer used that flag and showed the time as adjusted
- Show the correction only when the message has a wire send time
Drawings could be lost to a stray tap, and a drawing that was too
large was only reported after Send.

- Show the encoded size against the limit under the canvas and
  disable Send when the drawing is too large
- Add undo and redo, and make Clear undoable
- Ask before Cancel discards a drawing that is not blank
- Add eraser and fill tools, a grid toggle, and a preview
- Replace the scroll view with a layout that fits the screen
- Stop a stroke that leaves the canvas from joining the re-entry point
- Make the canvas one VoiceOver element with a movable cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant