Fig. D09 · Docs › Inbox › How a message reaches the unified inbox five stages, real time
  1. Account its own MTProto connection, through its own proxy; private chats, groups and supergroups always; broadcast channels only if tracked (opt-in)
  2. Ingest deduped per account, chat id and message id; edits overwrite the text, no history; deletions are not mirrored rentals: peer 777000 is stored, hidden at query time
  3. Store text 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
  4. Stream Socket.IO 4 at /ws on the site host; auth: session JWT, access_token cookie or API key (read + inbox); live push via Redis, no replay offline = missed; catch up via webhooks or after_msg_id
  5. Inbox one 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 to Webhooks: 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.