Developer docs

23. Notification settings

On this page

Telegram’s model: account-wide defaults per peer type, overrides per chat and per forum topic, an exceptions list, reaction notifications, a badge rule and sounds. All of it is stored on the server and applied by the server when it decides what to push (an iOS alert can’t be filtered by the client), and it syncs to every device through the user log. Service: NotificationsService (notify.proto).

23.1 Model

LevelWhereFieldsInherit
Account, per typeNotifySettings.private_chats / groups / channels (PeerTypeNotifySettings)mute_until (0 on, -1 off, or a time), show_previews, soundbuilt-in defaults: on, previews on, the app’s default tone
ChatDialog.notify (PeerNotifySettings)optional mute_until (unix ms; 0 = explicitly unmuted, -1 = forever), optional show_previews, soundunset = the type default
Forum topicForumTopic.notifysameunset = the chat
ReactionsNotifySettings.reactionsmessages_from OFF / CONTACTS (default) / EVERYONE, show_previews (who and what), sound
OtherNotifySettingscontact_joined (default on), hide_previews (lock-screen privacy: never names or text), badge (include_muted, include_channels, count_chats)
Device onlythe appin-app sounds, in-app vibrate, in-app preview bannersnot synced (Telegram keeps them per device)

Resolution is topic, then chat, then type default, then built-in. GetNotifyExceptions lists chats and topics with any override (the “Exceptions” list per type). UpdatePeerNotifySettings replaces the whole override (empty = back to default); ResetNotifySettings clears every override and the account settings. The old UpdateDialog.muted_until still works: a mute is an override; 0 is an explicit unmute when the type default is muted and “inherit” otherwise. Dialog.muted_until / ForumTopic.muted_until mirror the override’s mute_until (0 when unset). A timed mute expires on its own: clients and server compare it with the clock; nothing is sent when it ends.

Sync: UserEvent.notify_settings (account), UserEvent.dialog_settings (a chat’s override, in Dialog.notify), UserEvent.topic_notify (a topic’s), UserEvent.notify_sounds (refetch GetSounds).

23.2 Push decision (normative)

Per recipient (server/internal/notify.ShouldNotify, pure; settings are loaded in bulk per page of recipients, no per-recipient round trip):

EventRule
Message / postNothing if muted. Groups: a mention of me (MENTION_NAME) or a reply to my message notifies even when the group is muted, unless I muted the sender’s private chat (Telegram: “notified … even if they muted the group chat, unless they’ve muted you personally”). Channels: mute always wins.
Silent message / post (silent)A notification without sound (Telegram’s silent broadcast), not none.
Pin with “notify all members” (PinMessage without silent)A non-silent message_pinned service message is posted (groups, channels, private chats) and pushed: groups: to every member, also those who muted the group (“all members will get a notification — even if they muted ordinary messages”); channels and private chats: unless muted. A silent pin posts no service message and pushes nothing.
Other service messagesNo push.
Reaction to my messageOnly the author of the message, per reactions.messages_from (contacts = the reactor is in my contacts), never in a muted chat, never for channel posts. Body “Ann reacted 👍 to «…»”.
Contact joinedPer contact_joined. Telvoro has no phone-book import yet, so the server has no trigger for it today; the setting is stored and honoured once one exists.
Secret chatsUnchanged: a content-free secret wake-up push (§7); settings don’t add content.
Self-destructing mediaThe preview is the media label only ("🔥 Photo"), no caption or thumbnail.

Outcome: none; silent = shown without sound (silent message, or sound “none”); alert = shown with the resolved sound. Preview off (chat/topic/type, or hide_previews) removes the encrypted preview (no e, title/body empty) and sets np=1 / PushPayload.hidden_preview; clients show “New message”.

23.3 Badge

badge in message pushes = unread messages (or, with count_chats, chats with unread messages) in private chats and groups, plus channels with include_channels, plus muted chats with include_muted; “muted” is the effective state (override, else type default). Channel posts carry badge = -1 (unchanged) unless the recipient counts channels.

23.4 Sounds

NotificationSound: KIND_INHERIT, KIND_DEFAULT, KIND_NONE, KIND_BUILTIN (builtin: note chime pop ping bell glass pulse chord, bundled in the apps, generated by app/tool/gen_tones.py, CC0) or KIND_CUSTOM (sound_id). Uploaded sounds (Telegram saved ringtones): upload the file with FilesService, then SaveSound{file_id, title, duration_ms}; audio/mpeg, ogg, wav, caf, mp4/m4a or aac, ≤ 300 KB, ≤ 5 s, ≤ 100 per account (SOUND_FILE_INVALID, SOUND_TOO_LARGE, SOUND_TOO_LONG, SOUNDS_TOO_MUCH). Deleted sounds fall back to the default tone.

Wire name in pushes (data snd, PushPayload.sound): "" default, none, b:<tone>, c:<sound_id><.ext> (e.g. c:12.mp3). File names: tv_<tone>.wav, tvu_<id><.ext> (push.SoundFile). Per platform:

  • APNs: aps.sound = that file name (default for the default tone); silent pushes have no sound and interruption-level: passive. The app keeps the files in Library/Sounds (bundled tones copied at start, uploaded ones downloaded when the list changes), where iOS looks them up even when the app isn’t running. iOS plays only wav/caf/aiff: other uploaded formats fall back to the default tone on iOS.
  • FCM / UnifiedPush / Web Push (data messages, the app builds the notification): silent=1, snd, np=1, badge. Android channels are immutable, so the app creates one channel per tone (“tv_msg_<tone>”, high importance) plus the shared silent channel, and deletes channels no setting uses any more. Bundled tones are raw resources; uploaded ones are played from the app’s files (device-dependent: some launchers ignore file URIs, then the default tone plays).
  • Web: the browser’s sound; silent pushes are shown with silent: true.

Data keys added to the flat push map (§11.1): silent, snd, np, badge. The encrypted preview format is unchanged.

Generated from docs/PROTOCOL.md in the Telvoro repository. Wire names such as televo.v1 are unchanged.