Fig. D09 · Docs › Inbox › How a message reaches the unified inboxfive stages, real time
Accountits own MTProto connection, through its own proxy; private chats, groups and supergroups always; broadcast channels only if tracked (opt-in)
Ingestdeduped per account, chat id and message id; edits overwrite the text, no history; deletions are not mirroredrentals: peer 777000 is stored, hidden at query time
Storetext in a plain column, not encrypted at rest; files in MinIO, 20 MB per upload, streamed via the API (no presigned links); inbound media fetched on demand
StreamSocket.IO 4 at /ws on the site host; auth: session JWT, access_token cookie or API key (read + inbox); live push via Redis, no replayoffline = missed; catch up via webhooks or after_msg_id
Inboxone feed for DM, group, channel and bot chats; filter per account or chat; unread counters; full-text search; reply, assign, tag, resolve in place
Also fans out toWebhooks: inbox.new_message, inbox.message_failed, inbox.read to your server, signed and retried (see Fig. D16). Analytics, only if your privacy toggle is on.