From 82593147212e48cac6fe82336f42c964dca8c6a2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 16 Aug 2015 17:42:41 +0300 Subject: [PATCH] fixed crash in notifyShowNext(), not always enum pinned icons --- Telegram/SourceFiles/pspecific_wnd.cpp | 4 +++- Telegram/SourceFiles/settingswidget.cpp | 11 ++++++++++- Telegram/SourceFiles/window.cpp | 6 +++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 3a5fe7594..2ea13bc9a 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -2219,7 +2219,9 @@ void RegisterCustomScheme() { void psNewVersion() { RegisterCustomScheme(); - CheckPinnedAppUserModelId(); + if (Local::oldSettingsVersion() < 8050) { + CheckPinnedAppUserModelId(); + } } void psExecUpdater() { diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index 19907ed15..84b53cf38 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -1165,7 +1165,16 @@ void SettingsInner::onAskQuestionSure() { } void SettingsInner::onTelegramFAQ() { - QDesktopServices::openUrl(qsl("https://telegram.org/faq#general")); + QString url = qsl("https://telegram.org/faq"); + if (cLang() > languageDefault && cLang() < languageCount) { + const char *code = LanguageCodes[cLang()]; + if (qstr("de") == code || qstr("es") == code || qstr("it") == code || qstr("ko") == code) { + url += qsl("/") + code; + } else if (qstr("pt_BR") == code) { + url += qsl("/br"); + } + } + QDesktopServices::openUrl(url); } void SettingsInner::chooseCustomLang() { diff --git a/Telegram/SourceFiles/window.cpp b/Telegram/SourceFiles/window.cpp index 8d438d159..8f18cfda6 100644 --- a/Telegram/SourceFiles/window.cpp +++ b/Telegram/SourceFiles/window.cpp @@ -1467,8 +1467,8 @@ void Window::notifyShowNext(NotifyWindow *remove) { uint64 ms = getms(true); History *history = notifyItem->history(); NotifyWhenMaps::iterator j = notifyWhenMaps.find(history); - - if (j == notifyWhenMaps.end()) { + bool notifyWhenFound = (j != notifyWhenMaps.cend()); + if (!notifyWhenFound) { history->clearNotifications(); } else { HistoryItem *nextNotify = 0; @@ -1516,7 +1516,7 @@ void Window::notifyShowNext(NotifyWindow *remove) { if (!history->hasNotification()) { if (notifyWaiter != notifyWaiters.cend()) notifyWaiters.erase(notifyWaiter); - if (j != notifyWhenMaps.cend()) notifyWhenMaps.erase(j); + if (notifyWhenFound) notifyWhenMaps.erase(j); continue; } }