diff --git a/td/telegram/NotificationSettings.cpp b/td/telegram/NotificationSettings.cpp index f077a3bb..f3fb7d49 100644 --- a/td/telegram/NotificationSettings.cpp +++ b/td/telegram/NotificationSettings.cpp @@ -121,12 +121,16 @@ DialogNotificationSettings get_dialog_notification_settings(tl_object_ptrflags_ & telegram_api::peerNotifySettings::SOUND_MASK) == 0; bool use_default_show_preview = (settings->flags_ & telegram_api::peerNotifySettings::SHOW_PREVIEWS_MASK) == 0; auto mute_until = use_default_mute_until || settings->mute_until_ <= G()->unix_time() ? 0 : settings->mute_until_; + auto sound = std::move(settings->sound_); + if (sound.empty()) { + sound = "default"; + } bool silent_send_message = (settings->flags_ & telegram_api::peerNotifySettings::SILENT_MASK) == 0 ? false : settings->silent_; return {use_default_mute_until, mute_until, use_default_sound, - std::move(settings->sound_), + std::move(sound), use_default_show_preview, settings->show_previews_, silent_send_message, @@ -143,8 +147,10 @@ ScopeNotificationSettings get_scope_notification_settings(tl_object_ptrmute_until_ <= G()->unix_time() ? 0 : settings->mute_until_; - auto sound = - (settings->flags_ & telegram_api::peerNotifySettings::SOUND_MASK) == 0 ? "default" : std::move(settings->sound_); + auto sound = std::move(settings->sound_); + if (sound.empty()) { + sound = "default"; + } auto show_preview = (settings->flags_ & telegram_api::peerNotifySettings::SHOW_PREVIEWS_MASK) == 0 ? false : settings->show_previews_; return {mute_until, std::move(sound), show_preview, old_disable_pinned_message_notifications,