diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 815d5dbee..267d71f15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -174,7 +174,7 @@ jobs: build_linux: name: Linux runs-on: ubuntu-16.04 - + steps: - name: Install packages run: | diff --git a/Telegram/SourceFiles/_other/updater_osx.m b/Telegram/SourceFiles/_other/updater_osx.m index bf8e70e6b..3e63a69b5 100644 --- a/Telegram/SourceFiles/_other/updater_osx.m +++ b/Telegram/SourceFiles/_other/updater_osx.m @@ -53,10 +53,10 @@ void RemoveQuarantineAttribute(NSString *path) { } void RemoveQuarantineFromBundle(NSString *path) { - RemoveQuarantineAttribute(path); - RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/MacOS/Kotatogram"]); - RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/Helpers/crashpad_handler"]); - RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/Frameworks/Updater"]); + RemoveQuarantineAttribute(path); + RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/MacOS/Kotatogram"]); + RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/Helpers/crashpad_handler"]); + RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/Frameworks/Updater"]); } void delFolder() { diff --git a/Telegram/SourceFiles/boxes/boxes.style b/Telegram/SourceFiles/boxes/boxes.style index e2d9ae485..27ddf7f3b 100644 --- a/Telegram/SourceFiles/boxes/boxes.style +++ b/Telegram/SourceFiles/boxes/boxes.style @@ -927,4 +927,3 @@ fontsBoxTextStyle: TextStyle(defaultTextStyle) { linkFont: font(13px); linkFontOver: font(13px underline); } - diff --git a/Telegram/SourceFiles/boxes/fonts_box.cpp b/Telegram/SourceFiles/boxes/fonts_box.cpp index 314de645d..36b0e2069 100644 --- a/Telegram/SourceFiles/boxes/fonts_box.cpp +++ b/Telegram/SourceFiles/boxes/fonts_box.cpp @@ -48,7 +48,7 @@ void FontsBox::prepare() { _about.setText(st::fontsBoxTextStyle, tr::ktg_fonts_about(tr::now)); _aboutHeight = _about.countHeight(st::boxWidth - st::boxPadding.left() * 1.5); - + setDimensions(st::boxWidth, _mainFontName->height() + _semiboldFontName->height() + _semiboldIsBold->height() + _monospacedFontName->height() + _aboutHeight + st::boxLittleSkip * 2); } diff --git a/Telegram/SourceFiles/boxes/net_boost_box.h b/Telegram/SourceFiles/boxes/net_boost_box.h index e587a57bd..d6a16fbd5 100644 --- a/Telegram/SourceFiles/boxes/net_boost_box.h +++ b/Telegram/SourceFiles/boxes/net_boost_box.h @@ -29,5 +29,5 @@ private: object_ptr _description = { nullptr }; std::shared_ptr _boostGroup; - + }; \ No newline at end of file diff --git a/Telegram/SourceFiles/core/kotato_settings.cpp b/Telegram/SourceFiles/core/kotato_settings.cpp index d5da1f418..74d0b348c 100644 --- a/Telegram/SourceFiles/core/kotato_settings.cpp +++ b/Telegram/SourceFiles/core/kotato_settings.cpp @@ -178,9 +178,9 @@ bool Manager::readCustomFile() { } const auto settingsNetSpeedIt = settings.constFind(qsl("net_speed_boost")); - if (settingsNetSpeedIt != settings.constEnd()) { + if (settingsNetSpeedIt != settings.constEnd()) { if ((*settingsNetSpeedIt).isString()) { - + const auto option = (*settingsNetSpeedIt).toString(); if (option == "high") { SetNetworkBoost(3); @@ -294,7 +294,7 @@ void Manager::writeCurrentSettings() { auto settings = QJsonObject(); auto settingsFonts = QJsonObject(); - + if (!cMainFont().isEmpty()) { settingsFonts.insert(qsl("main"), cMainFont()); } diff --git a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp index 0f851172c..ab8076b47 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp @@ -87,8 +87,8 @@ void PaintNarrowCounter( const auto allowDigits = displayMentionBadge ? 1 : 3; auto unreadRight = st::dialogsPadding.x() + (DialogListLines() == 1 ? st::dialogsUnreadHeight : st::dialogsPhotoSize); auto unreadTop = (lines == 1 - ? st::dialogsPadding.y() - : st::dialogsPadding.y() + st::dialogsPhotoSize - st::dialogsUnreadHeight); + ? st::dialogsPadding.y() + : st::dialogsPadding.y() + st::dialogsPhotoSize - st::dialogsUnreadHeight); auto unreadWidth = 0; UnreadBadgeStyle st; @@ -101,8 +101,8 @@ void PaintNarrowCounter( auto counter = qsl("@"); auto unreadRight = st::dialogsPadding.x() + (DialogListLines() == 1 ? st::dialogsUnreadHeight : st::dialogsPhotoSize) - skipBeforeMention; auto unreadTop = (lines == 1 - ? st::dialogsPadding.y() - : st::dialogsPadding.y() + st::dialogsPhotoSize - st::dialogsUnreadHeight); + ? st::dialogsPadding.y() + : st::dialogsPadding.y() + st::dialogsPhotoSize - st::dialogsUnreadHeight); auto unreadWidth = 0; UnreadBadgeStyle st; @@ -866,11 +866,11 @@ void RowPainter::paint( | (peer && peer->isSelf() ? Flag::SavedMessages : Flag(0)); const auto paintItemCallback = [&](int nameleft, int namewidth) { const auto texttop = (DialogListLines() == 1 - ? st::dialogsPadding.y() - : st::dialogsPadding.y() - + st::msgNameFont->height - + st::dialogsSkip); - + ? st::dialogsPadding.y() + : st::dialogsPadding.y() + + st::msgNameFont->height + + st::dialogsSkip); + const auto availableWidth = PaintWideCounter( p, texttop, @@ -1030,10 +1030,10 @@ void RowPainter::paint( | (row->searchInChat().feed() ? Flag::FeedSearchResult : Flag(0))*/; const auto paintItemCallback = [&](int nameleft, int namewidth) { const auto texttop = (DialogListLines() == 1 - ? st::dialogsPadding.y() - : st::dialogsPadding.y() - + st::msgNameFont->height - + st::dialogsSkip); + ? st::dialogsPadding.y() + : st::dialogsPadding.y() + + st::msgNameFont->height + + st::dialogsSkip); const auto availableWidth = PaintWideCounter( p, texttop, @@ -1151,7 +1151,7 @@ void PaintCollapsedRow( : st::dialogsPadding.x(); p.drawText(left, textBaseline, text); } else if (!narrow) { - + const auto textBaseline = unreadTop + (st::dialogsUnreadHeight - st::dialogsUnreadFont->height) / 2 + st::dialogsUnreadFont->ascent; diff --git a/Telegram/SourceFiles/history/history_item_components.cpp b/Telegram/SourceFiles/history/history_item_components.cpp index 430b48afc..b66133cc2 100644 --- a/Telegram/SourceFiles/history/history_item_components.cpp +++ b/Telegram/SourceFiles/history/history_item_components.cpp @@ -139,7 +139,7 @@ void HistoryMessageForwarded::create() const { lt_user, textcmdLink(1, phrase)); } - + TextParseOptions opts = { TextParseRichText, 0, diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index efb06c261..8f6009e81 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -1038,7 +1038,7 @@ void HistoryWidget::start() { void HistoryWidget::onMentionInsert(UserData *user, FieldAutocomplete::ChooseMethod method) { QString replacement, entityTag; if (user->username.isEmpty() - || method == FieldAutocomplete::ChooseMethod::ByRightClick + || method == FieldAutocomplete::ChooseMethod::ByRightClick || method == FieldAutocomplete::ChooseMethod::ByCtrlEnter || method == FieldAutocomplete::ChooseMethod::ByCtrlClick) { replacement = user->firstName; @@ -3173,7 +3173,6 @@ MsgId HistoryWidget::highlightOrigId() const { return _highlightedOriginalMessageId; } - void HistoryWidget::showAnimated( Window::SlideDirection direction, const Window::SectionSlideParams ¶ms) { diff --git a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp index a26fe9011..14ce5e1a0 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp @@ -113,8 +113,8 @@ QSize Gif::countOptimalSize() { } const auto captionWithPaddings = _caption.maxWidth() - + st::msgPadding.left() - + st::msgPadding.right(); + + st::msgPadding.left() + + st::msgPadding.right(); const auto maxSize = _data->isVideoFile() ? st::maxMediaSize : _data->isVideoMessage() @@ -173,8 +173,8 @@ QSize Gif::countCurrentSize(int newWidth) { auto availableWidth = newWidth; const auto captionWithPaddings = _caption.maxWidth() - + st::msgPadding.left() - + st::msgPadding.right(); + + st::msgPadding.left() + + st::msgPadding.right(); const auto maxSize = _data->isVideoFile() ? st::maxMediaSize : _data->isVideoMessage() @@ -925,7 +925,7 @@ void Gif::drawGrouped( const auto mainWidget = App::main(); const auto highlightedRealId = mainWidget->highlightedOriginalId(); if (realId != highlightedRealId - && animms + && animms && animms < st::activeFadeInDuration + st::activeFadeOutDuration) { const auto dt = (animms <= st::activeFadeInDuration) ? ((animms / float64(st::activeFadeInDuration))) @@ -975,7 +975,7 @@ void Gif::drawGrouped( drawHighlighted([&]() { p.drawImage(geometry, streamed->frame(request)); }); - + if (!paused) { streamed->markFrameShown(); } diff --git a/Telegram/SourceFiles/history/view/media/history_view_media_grouped.cpp b/Telegram/SourceFiles/history/view/media/history_view_media_grouped.cpp index 413275fa4..85f10330a 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_media_grouped.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_media_grouped.cpp @@ -77,8 +77,8 @@ QSize GroupedMedia::countOptimalSize() { } const auto captionWithPaddings = _caption.maxWidth() - + st::msgPadding.left() - + st::msgPadding.right(); + + st::msgPadding.left() + + st::msgPadding.right(); auto groupMaxWidth = st::historyGroupWidthMax; if (cAdaptiveBubbles()) { accumulate_max(groupMaxWidth, captionWithPaddings); diff --git a/Telegram/SourceFiles/history/view/media/history_view_photo.cpp b/Telegram/SourceFiles/history/view/media/history_view_photo.cpp index f9321e20e..91228609a 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_photo.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_photo.cpp @@ -72,8 +72,8 @@ QSize Photo::countOptimalSize() { auto minHeight = 0; const auto captionWithPaddings = _caption.maxWidth() - + st::msgPadding.left() - + st::msgPadding.right(); + + st::msgPadding.left() + + st::msgPadding.right(); auto inWebPage = (_parent->media() != this); auto tw = style::ConvertScale(_data->width()); auto th = style::ConvertScale(_data->height()); @@ -117,8 +117,8 @@ QSize Photo::countCurrentSize(int newWidth) { auto availableWidth = newWidth; const auto captionWithPaddings = _caption.maxWidth() - + st::msgPadding.left() - + st::msgPadding.right(); + + st::msgPadding.left() + + st::msgPadding.right(); auto inWebPage = (_parent->media() != this); auto tw = style::ConvertScale(_data->width()); auto th = style::ConvertScale(_data->height()); @@ -399,7 +399,7 @@ void Photo::drawGrouped( const auto mainWidget = App::main(); const auto highlightedRealId = mainWidget->highlightedOriginalId(); if (realId != highlightedRealId - && animms + && animms && animms < st::activeFadeInDuration + st::activeFadeOutDuration) { const auto dt = (animms <= st::activeFadeInDuration) ? ((animms / float64(st::activeFadeInDuration))) diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index 096162029..6df0a67f6 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -269,7 +269,7 @@ object_ptr DetailsFiller::setupInfo() { tr::ktg_profile_copy_id(tr::now)); } } - + if (user->session().supportMode()) { addInfoLineGeneric( user->session().supportHelper().infoLabelValue(user), diff --git a/Telegram/SourceFiles/info/profile/info_profile_members_controllers.cpp b/Telegram/SourceFiles/info/profile/info_profile_members_controllers.cpp index 686765b9f..ef3c38654 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_members_controllers.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_members_controllers.cpp @@ -79,8 +79,8 @@ void MemberListRow::paintAdminRank( bool selected) { p.setPen(_type.rights == Rights::Creator ? st::defaultPeerListItem.statusFgActive - : selected - ? st::defaultPeerListItem.statusFgOver + : selected + ? st::defaultPeerListItem.statusFgOver : st::defaultPeerListItem.statusFg); p.drawTextLeft(x, y, outerWidth, _type.adminRank, adminRankWidth()); } diff --git a/Telegram/SourceFiles/info/profile/info_profile_values.cpp b/Telegram/SourceFiles/info/profile/info_profile_values.cpp index 4c9989176..f535323a6 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_values.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_values.cpp @@ -101,11 +101,13 @@ rpl::producer UsernameValue(not_null user) { } rpl::producer PlainAboutValue(not_null peer) { - /*if (const auto user = peer->asUser()) { + /* + if (const auto user = peer->asUser()) { if (!user->isBot()) { return rpl::single(QString()); } - }*/ + } + */ return Notify::PeerUpdateValue( peer, Notify::PeerUpdate::Flag::AboutChanged diff --git a/Telegram/SourceFiles/lang/lang_instance.cpp b/Telegram/SourceFiles/lang/lang_instance.cpp index 836f2cdd9..c77532d16 100644 --- a/Telegram/SourceFiles/lang/lang_instance.cpp +++ b/Telegram/SourceFiles/lang/lang_instance.cpp @@ -576,7 +576,7 @@ void Instance::fillDefaultJson() { output.write(inputData); output.close(); } - + if (outputRaw.open(QIODevice::WriteOnly)) { outputRaw.write(inputData); outputRaw.close(); @@ -592,7 +592,7 @@ void Instance::fillFromJson() { const auto langBaseDir = jsonLangDir() + (qsl("%1.json").arg(baseId())); loadFromJson(langBaseDir); } - + const auto langDefCustomDir = jsonLangDir() + (qsl("%1.default.json").arg(id())); loadFromJson(langDefCustomDir); const auto langCustomDir = jsonLangDir() + (qsl("%1.json").arg(id())); @@ -635,14 +635,14 @@ void Instance::loadFromJson(const QString &filename) { const auto value = langKeys.constFind(key); if ((*value).isString()) { - + const auto name = QByteArray().append(key); const auto translation = QByteArray().append((*value).toString()); applyValue(name, translation); } else if ((*value).isObject()) { - + const auto keyPlurals = (*value).toObject(); const auto pluralList = keyPlurals.keys(); @@ -651,8 +651,8 @@ void Instance::loadFromJson(const QString &filename) { const auto pluralValue = keyPlurals.constFind(plural); if (!(*pluralValue).isString()) { - LOG(("Lang Info: wrong value for key %1 in %2 in file %3, string expected" - ).arg(plural).arg(key).arg(filename)); + LOG(("Lang Info: wrong value for key %1 in %2 in file %3, string expected") + .arg(plural).arg(key).arg(filename)); continue; } @@ -665,8 +665,8 @@ void Instance::loadFromJson(const QString &filename) { } } } else { - LOG(("Lang Info: wrong value for key %1 in file %2, string or object expected" - ).arg(key).arg(filename)); + LOG(("Lang Info: wrong value for key %1 in file %2, string or object expected") + .arg(key).arg(filename)); } if (--limit <= 0) { break; diff --git a/Telegram/SourceFiles/mtproto/connection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 9e069a499..a5ce5f4ab 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -188,7 +188,7 @@ QString getHomeDir() { QString psAppDataPath() { // We should not use ~/.TelegramDesktop, since it's a fork. - + // auto home = getHomeDir(); // if (!home.isEmpty()) { // auto oldPath = home + qsl(".TelegramDesktop/"); diff --git a/Telegram/SourceFiles/profile/profile_block_peer_list.cpp b/Telegram/SourceFiles/profile/profile_block_peer_list.cpp index 606c76413..f2d79cc5f 100644 --- a/Telegram/SourceFiles/profile/profile_block_peer_list.cpp +++ b/Telegram/SourceFiles/profile/profile_block_peer_list.cpp @@ -104,8 +104,8 @@ void PeerListWidget::paintItem(Painter &p, int x, int y, Item *item, bool select p.setFont(st::normalFont); p.setPen(item->adminState == Item::AdminState::Creator ? _st.statusFgActive - : selected - ? _st.statusFgOver + : selected + ? _st.statusFgOver : _st.statusFg); p.drawTextLeft(nameLeft + nameWidth - item->adminRankWidth, nameTop, width(), item->adminRank, item->adminRankWidth); nameWidth -= item->adminRankWidth + skip; diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index f841a59f3..9a59a4ce0 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -272,4 +272,4 @@ rpl::producer DialogListLinesChanges() { return gDialogListLines.changes(); } -bool gDisableUpEdit = false; \ No newline at end of file +bool gDisableUpEdit = false; diff --git a/Telegram/SourceFiles/settings/settings_kotato.cpp b/Telegram/SourceFiles/settings/settings_kotato.cpp index d3773f41d..e92d1dc51 100644 --- a/Telegram/SourceFiles/settings/settings_kotato.cpp +++ b/Telegram/SourceFiles/settings/settings_kotato.cpp @@ -163,7 +163,7 @@ void SetupKotatoNetwork(not_null container) { st::settingsButton )->addClickHandler([=] { Ui::show(Box()); - }); + }); AddSkip(container); } diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp index 8915df45c..219e44f53 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp @@ -896,9 +896,11 @@ rpl::producer ProfilePhotoPrivacyController::title() { return tr::lng_edit_privacy_profile_photo_title(); } -/*bool ProfilePhotoPrivacyController::hasOption(Option option) { +/* +bool ProfilePhotoPrivacyController::hasOption(Option option) { return (option != Option::Nobody); -}*/ +} +*/ rpl::producer ProfilePhotoPrivacyController::optionsTitleKey() { return tr::lng_edit_privacy_profile_photo_header(); diff --git a/Telegram/SourceFiles/window/window_main_menu.cpp b/Telegram/SourceFiles/window/window_main_menu.cpp index d2c12e737..f28648e3c 100644 --- a/Telegram/SourceFiles/window/window_main_menu.cpp +++ b/Telegram/SourceFiles/window/window_main_menu.cpp @@ -209,7 +209,7 @@ MainMenu::MainMenu( _telegram->setLinksTrusted(); _version->setRichText(textcmdLink(1, currentVersionText())); _version->setLink(1, std::make_shared(qsl("https://github.com/kotatogram/kotatogram-desktop"))); - + subscribe(_controller->session().downloaderTaskFinished(), [=] { update(); }); subscribe(Notify::PeerUpdated(), Notify::PeerUpdatedHandler(Notify::PeerUpdate::Flag::UserPhoneChanged, [this](const Notify::PeerUpdate &update) { if (update.peer->isSelf()) { @@ -444,7 +444,7 @@ void MainMenu::paintEvent(QPaintEvent *e) { st::mainMenuCoverNameOnlyTop, widthText, width()); - + } if (_cloudButton) { Ui::EmptyUserpic::PaintSavedMessages( diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index 93accb46a..11b18df5a 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -678,7 +678,6 @@ void FolderFiller::addTogglesForArchive() { } // namespace - void PeerMenuHidePinnedMessage(not_null peer) { auto hidden = HistoryWidget::switchPinnedHidden(peer, true); if (hidden) { diff --git a/docs/building-cmake-ktg.md b/docs/building-cmake-ktg.md index a999885d1..6dd001d0b 100644 --- a/docs/building-cmake-ktg.md +++ b/docs/building-cmake-ktg.md @@ -262,7 +262,7 @@ Go to ***BuildPath*** and run ### Building the project Before refreshing, you can set build defines (skip this step if you don't need to disable anything): - + export TDESKTOP_BUILD_DEFINES=TDESKTOP_DISABLE_CRASH_REPORTS,TDESKTOP_DISABLE_AUTOUPDATE Go to ***BuildPath*/tdesktop/Telegram** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials))