Repository navigation
Packet mumcord image
Part of the Plugin data protocol. Flows: Flow-Full-Image, Flow-Direct-Connection.
Purpose. A chat message can only carry an image that fits the server's message limit, so Mumcord sends a thumbnail in the chat message and keeps the original locally. Other Mumcord users fetch the full image from the original sender. A direct connection is tried first; this packet is the fallback.
dataID |
mumcord.image |
| Encoding | binary, big-endian integers |
| Version | none; versioned by message kinds 1 to 5 |
| Sent to | one person: requester to the original sender, and the sender's answers back to the requester |
| Feature gate |
full-image (see Packet-mumcord-hello) |
| Defined in | crates/engine/src/full_image/wire.rs |
The thumbnail <img> carries data-mumcord-full="<sha256 as 64 lowercase hex digits>:<size in bytes>". Official clients ignore the attribute and show the thumbnail.
<img src="data:image/jpeg;base64,..." data-mumcord-full="9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08:204800">Every message starts with a one-byte kind and a 4-byte transfer id that the requester picks.
| Kind | Message | Rest of the message |
|---|---|---|
| 1 | Get |
SHA-256 of the wanted image (32 bytes) |
| 2 | Queued |
- (the request waits behind other transfers) |
| 3 | Start |
image size in bytes (u32) |
| 4 | Chunk |
chunk index (u32), then 1 to 960 image bytes (CHUNK_LEN) |
| 5 | Unavailable |
- (the image is not, or no longer, available, or the sender is busy) |
Hex, transfer id 0x0000002a:
Get: 01 0000002a 9f86d081...b0f00a08 (1 + 4 + 32 bytes)
Start: 03 0000002a 00032000 (size 204800)
Chunk: 04 0000002a 00000000 <960 bytes> (first chunk: 1 + 4 + 4 + 960 = 969 bytes)
| Limit | Value |
|---|---|
| Image bytes per chunk | 960 |
| Image size | 512 KiB, at most 3840 pixels per side |
| Requests waiting at the sender | 4 (more get Unavailable) |
| Requests per person per minute | 6 (more are ignored) |
| Downloads at once (receiver) | 3 |
| Chunk pace | one every 350 ms (about 2.9 per second) |
Chunks must arrive in order. The receiver accepts the bytes only if size and SHA-256 match the reference, the content is a real PNG, JPEG, GIF or WebP (by its bytes, not a claimed type) and it decodes completely. Unknown kinds are dropped.
Carries an image the user already posted in a channel or private chat. The request reveals that someone opened it.
Flow-Full-Image; the same image over a direct connection (stream kind 1) is in Flow-Direct-Connection.
Mumcord is licensed under the AGPL-3.0 (versions up to 0.1.1: MIT) · Source code · Website · Website source