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
| Level | Where | Fields | Inherit |
|---|---|---|---|
| Account, per type | NotifySettings.private_chats / groups / channels (PeerTypeNotifySettings) | mute_until (0 on, -1 off, or a time), show_previews, sound | built-in defaults: on, previews on, the app’s default tone |
| Chat | Dialog.notify (PeerNotifySettings) | optional mute_until (unix ms; 0 = explicitly unmuted, -1 = forever), optional show_previews, sound | unset = the type default |
| Forum topic | ForumTopic.notify | same | unset = the chat |
| Reactions | NotifySettings.reactions | messages_from OFF / CONTACTS (default) / EVERYONE, show_previews (who and what), sound | |
| Other | NotifySettings | contact_joined (default on), hide_previews (lock-screen privacy: never names or text), badge (include_muted, include_channels, count_chats) | |
| Device only | the app | in-app sounds, in-app vibrate, in-app preview banners | not 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):
| Event | Rule |
|---|---|
| Message / post | Nothing 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 messages | No push. |
| Reaction to my message | Only 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 joined | Per 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 chats | Unchanged: a content-free secret wake-up push (§7); settings don’t add content. |
| Self-destructing media | The 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 (defaultfor the default tone); silent pushes have nosoundandinterruption-level: passive. The app keeps the files inLibrary/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.