diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index bb3f3cd6d..5a7fbe18b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -101,7 +101,10 @@ jobs: if [ -n "${{ matrix.defines }}" ]; then DEFINE="-D ${{ matrix.defines }}=ON" if [ "${{ matrix.defines }}" == "DESKTOP_APP_DISABLE_DBUS_INTEGRATION" ]; then - DEFINE="$DEFINE -D DESKTOP_APP_DISABLE_GTK_INTEGRATION=ON" + DEFINE="$DEFINE -D DESKTOP_APP_DISABLE_GTK_INTEGRATION=ON -D DESKTOP_APP_DISABLE_WEBKITGTK=ON" + fi + if [ "${{ matrix.defines }}" == "DESKTOP_APP_DISABLE_GTK_INTEGRATION" ]; then + DEFINE="$DEFINE -D DESKTOP_APP_DISABLE_WEBKITGTK=ON" fi echo Define from matrix: $DEFINE echo "ARTIFACT_NAME=Kotatogram_${{ matrix.defines }}" >> $GITHUB_ENV diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index c3952ccfa..33e1ab543 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -113,25 +113,16 @@ if (LINUX) endif() if (NOT DESKTOP_APP_DISABLE_GTK_INTEGRATION) - target_link_libraries(Telegram PRIVATE rt) find_package(PkgConfig REQUIRED) - if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY) - pkg_check_modules(GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0) - target_link_libraries(Telegram PRIVATE PkgConfig::GTK3) + pkg_check_modules(GTK REQUIRED gtk+-3.0) + target_include_directories(Telegram SYSTEM PRIVATE ${GTK_INCLUDE_DIRS}) - if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION) - pkg_check_modules(X11 REQUIRED IMPORTED_TARGET x11) - target_link_libraries(Telegram PRIVATE PkgConfig::X11) - endif() - else() - pkg_check_modules(GTK REQUIRED gtk+-3.0) - target_include_directories(Telegram PRIVATE ${GTK_INCLUDE_DIRS}) - - if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION) - target_link_libraries(Telegram PRIVATE X11) - endif() + if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION) + target_link_libraries(Telegram PRIVATE X11) endif() + + target_link_libraries(Telegram PRIVATE rt) endif() endif() @@ -909,16 +900,12 @@ PRIVATE platform/linux/linux_desktop_environment.h platform/linux/linux_gdk_helper.cpp platform/linux/linux_gdk_helper.h - platform/linux/linux_gsd_media_keys.cpp - platform/linux/linux_gsd_media_keys.h platform/linux/linux_gtk_integration_dummy.cpp platform/linux/linux_gtk_integration_p.h platform/linux/linux_gtk_integration.cpp platform/linux/linux_gtk_integration.h platform/linux/linux_gtk_open_with_dialog.cpp platform/linux/linux_gtk_open_with_dialog.h - platform/linux/linux_notification_service_watcher.cpp - platform/linux/linux_notification_service_watcher.h platform/linux/linux_wayland_integration_dummy.cpp platform/linux/linux_wayland_integration.cpp platform/linux/linux_wayland_integration.h @@ -1214,12 +1201,6 @@ endif() if (DESKTOP_APP_DISABLE_DBUS_INTEGRATION) remove_target_sources(Telegram ${src_loc} - platform/linux/linux_gsd_media_keys.cpp - platform/linux/linux_gsd_media_keys.h - platform/linux/linux_mpris_support.cpp - platform/linux/linux_mpris_support.h - platform/linux/linux_notification_service_watcher.cpp - platform/linux/linux_notification_service_watcher.h platform/linux/linux_xdp_file_dialog.cpp platform/linux/linux_xdp_file_dialog.h platform/linux/linux_xdp_open_with_dialog.cpp diff --git a/Telegram/SourceFiles/boxes/language_box.cpp b/Telegram/SourceFiles/boxes/language_box.cpp index a14dbeb5f..baf3ac1a0 100644 --- a/Telegram/SourceFiles/boxes/language_box.cpp +++ b/Telegram/SourceFiles/boxes/language_box.cpp @@ -115,12 +115,12 @@ private: const Rows::Row &rowBySelection(Selection selected) const; std::unique_ptr &rippleBySelection( Selection selected); - const std::unique_ptr &rippleBySelection( + [[maybe_unused]] const std::unique_ptr &rippleBySelection( Selection selected) const; std::unique_ptr &rippleBySelection( not_null row, Selection selected); - const std::unique_ptr &rippleBySelection( + [[maybe_unused]] const std::unique_ptr &rippleBySelection( not_null row, Selection selected) const; void addRipple(Selection selected, QPoint position); diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp index d18977597..ff7a754aa 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_type_box.cpp @@ -129,9 +129,6 @@ private: const QString &text, rpl::producer about); - bool inviteLinkShown(); - QString inviteLinkText(); - not_null _peer; bool _linkOnly = false; @@ -308,15 +305,6 @@ QString Controller::getUsernameInput() { return _controls.usernameInput->getLastText().trimmed(); } -QString Controller::inviteLinkText() { - if (const auto channel = _peer->asChannel()) { - return channel->inviteLink(); - } else if (const auto chat = _peer->asChat()) { - return chat->inviteLink(); - } - return QString(); -} - object_ptr Controller::createUsernameEdit() { Expects(_wrap != nullptr); @@ -583,11 +571,6 @@ object_ptr Controller::createInviteLinkBlock() { return result; } -bool Controller::inviteLinkShown() { - return !_controls.privacy - || (_controls.privacy->value() == Privacy::NoUsername); -} - } // namespace EditPeerTypeBox::EditPeerTypeBox( diff --git a/Telegram/SourceFiles/boxes/sticker_set_box.cpp b/Telegram/SourceFiles/boxes/sticker_set_box.cpp index a42b0919c..7a93f2bdd 100644 --- a/Telegram/SourceFiles/boxes/sticker_set_box.cpp +++ b/Telegram/SourceFiles/boxes/sticker_set_box.cpp @@ -830,7 +830,6 @@ void StickerSetBox::Inner::visibleTopBottomUpdated( void StickerSetBox::Inner::setupLottie(int index) { auto &element = _elements[index]; - const auto document = element.document; element.animated = ChatHelpers::LottieAnimationFromDocument( getLottiePlayer(), diff --git a/Telegram/SourceFiles/calls/calls_panel.cpp b/Telegram/SourceFiles/calls/calls_panel.cpp index 698a894bd..71e875584 100644 --- a/Telegram/SourceFiles/calls/calls_panel.cpp +++ b/Telegram/SourceFiles/calls/calls_panel.cpp @@ -116,9 +116,7 @@ void Panel::replaceCall(not_null call) { void Panel::initWindow() { window()->setAttribute(Qt::WA_OpaquePaintEvent); window()->setAttribute(Qt::WA_NoSystemBackground); - window()->setWindowIcon( - QIcon(QPixmap::fromImage(Image::Empty()->original(), Qt::ColorOnly))); - window()->setTitle(u" "_q); + window()->setTitle(_user->name); window()->setTitleStyle(st::callTitle); window()->events( diff --git a/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp b/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp index db1e6a3bb..cefaca113 100644 --- a/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp +++ b/Telegram/SourceFiles/calls/group/calls_choose_join_as.cpp @@ -335,7 +335,6 @@ void ChooseJoinAsProcess::start( }, _request->lifetime); const auto finish = [=](JoinInfo info) { - const auto peer = _request->peer; const auto done = std::move(_request->done); const auto box = _request->box; _request = nullptr; diff --git a/Telegram/SourceFiles/calls/group/calls_group_members.cpp b/Telegram/SourceFiles/calls/group/calls_group_members.cpp index f7e9fd3fd..c82fbb403 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_members.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_members.cpp @@ -1171,21 +1171,6 @@ int Members::Controller::rowPaintStatusIcon( : state.raisedHand ? st::groupCallMemberInactiveStatus->c : iconColor; - const auto color = (state.speaking == 1. && !state.mutedByMe) - ? st::groupCallMemberActiveStatus->c - : (state.speaking == 0. - ? (state.active == 1. - ? st::groupCallMemberNotJoinedStatus->c - : (state.active == 0. - ? (state.muted == 1. - ? (state.raisedHand - ? st::groupCallMemberInactiveStatus->c - : st::groupCallMemberNotJoinedStatus->c) - : (state.muted == 0. - ? st::groupCallMemberNotJoinedStatus->c - : other)) - : other)) - : other); if (camera) { st::groupCallNarrowCameraIcon.paint(p, x, y, outerWidth, other); x += st::groupCallNarrowCameraIcon.width(); diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp index eef148ca2..33ca08c28 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp @@ -289,8 +289,6 @@ void Panel::chooseSourceStop() { void Panel::initWindow() { window()->setAttribute(Qt::WA_OpaquePaintEvent); window()->setAttribute(Qt::WA_NoSystemBackground); - window()->setWindowIcon( - QIcon(QPixmap::fromImage(Image::Empty()->original(), Qt::ColorOnly))); window()->setTitleStyle(st::groupCallTitle); subscribeToPeerChanges(); diff --git a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp index fa8c42294..35fe93f55 100644 --- a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp @@ -1033,7 +1033,6 @@ void GifsListWidget::updateSelected() { int row = -1, col = -1, sel = -1; ClickHandlerPtr lnk; ClickHandlerHost *lnkhost = nullptr; - HistoryView::CursorState cursor = HistoryView::CursorState::None; if (sy >= 0) { row = 0; for (int rows = _rows.size(); row < rows; ++row) { @@ -1062,7 +1061,6 @@ void GifsListWidget::updateSelected() { QPoint(sx, sy), HistoryView::StateRequest()); lnk = result.link; - cursor = result.cursor; lnkhost = inlineItems[col]; } else { row = col = -1; diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index fbdbd277d..6c6ec68e6 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -1884,7 +1884,6 @@ void StickersListWidget::ensureLottiePlayer(Set &set) { void StickersListWidget::setupLottie(Set &set, int section, int index) { auto &sticker = set.stickers[index]; - const auto document = sticker.document; ensureLottiePlayer(set); // Document should be loaded already for the animation to be set up. diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index 8933a9563..215d501ee 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -24,6 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "core/ui_integration.h" #include "chat_helpers/emoji_keywords.h" #include "chat_helpers/stickers_emoji_image_loader.h" +#include "base/platform/base_platform_url_scheme.h" #include "base/platform/base_platform_last_input.h" #include "base/platform/base_platform_info.h" #include "platform/platform_specific.h" @@ -222,6 +223,7 @@ void Application::run() { } if (Local::oldSettingsVersion() < AppVersion) { + RegisterUrlScheme(); psNewVersion(); } @@ -1155,6 +1157,19 @@ void Application::startShortcuts() { }, _lifetime); } +void Application::RegisterUrlScheme() { + base::Platform::RegisterUrlScheme(base::Platform::UrlSchemeDescriptor{ + .executable = cExeDir() + cExeName(), + .arguments = qsl("-workdir \"%1\"").arg(cWorkingDir()), + .protocol = qsl("tg"), + .protocolName = qsl("Telegram Link"), + .shortAppName = qsl("tdesktop"), + .longAppName = QCoreApplication::applicationName(), + .displayAppName = AppName.utf16(), + .displayAppDescription = AppName.utf16(), + }); +} + bool IsAppLaunched() { return (Application::Instance != nullptr); } diff --git a/Telegram/SourceFiles/core/application.h b/Telegram/SourceFiles/core/application.h index c74064235..939b2d0e4 100644 --- a/Telegram/SourceFiles/core/application.h +++ b/Telegram/SourceFiles/core/application.h @@ -293,6 +293,8 @@ public: void setScreenIsLocked(bool locked); bool screenIsLocked() const; + static void RegisterUrlScheme(); + protected: bool eventFilter(QObject *object, QEvent *event) override; diff --git a/Telegram/SourceFiles/core/shortcuts.cpp b/Telegram/SourceFiles/core/shortcuts.cpp index ec46ed3a4..5f8e2927c 100644 --- a/Telegram/SourceFiles/core/shortcuts.cpp +++ b/Telegram/SourceFiles/core/shortcuts.cpp @@ -598,7 +598,6 @@ bool HandleEvent(not_null event) { void ToggleMediaShortcuts(bool toggled) { Data.toggleMedia(toggled); - Platform::SetWatchingMediaKeys(toggled); } void ToggleSupportShortcuts(bool toggled) { diff --git a/Telegram/SourceFiles/core/shortcuts.h b/Telegram/SourceFiles/core/shortcuts.h index d1329e279..606763246 100644 --- a/Telegram/SourceFiles/core/shortcuts.h +++ b/Telegram/SourceFiles/core/shortcuts.h @@ -66,7 +66,7 @@ enum class Command { JumpToDate, }; -constexpr auto kShowFolder = { +[[maybe_unused]] constexpr auto kShowFolder = { Command::ShowAllChats, Command::ShowFolder1, Command::ShowFolder2, diff --git a/Telegram/SourceFiles/data/data_document_resolver.cpp b/Telegram/SourceFiles/data/data_document_resolver.cpp index 12cba6c43..bf77555c1 100644 --- a/Telegram/SourceFiles/data/data_document_resolver.cpp +++ b/Telegram/SourceFiles/data/data_document_resolver.cpp @@ -98,25 +98,27 @@ QString FileExtension(const QString &filepath) { return QString(last.base(), last - reversed.begin()); } -// bool IsValidMediaFile(const QString &filepath) { -// static const auto kExtensions = [] { -// const auto list = qsl("\ -// 16svx 2sf 3g2 3gp 8svx aac aaf aif aifc aiff amr amv ape asf ast au aup \ -// avchd avi brstm bwf cam cdda cust dat divx drc dsh dsf dts dtshd dtsma \ -// dvr-ms dwd evo f4a f4b f4p f4v fla flac flr flv gif gifv gsf gsm gym iff \ -// ifo it jam la ly m1v m2p m2ts m2v m4a m4p m4v mcf mid mk3d mka mks mkv mng \ -// mov mp1 mp2 mp3 mp4 minipsf mod mpc mpe mpeg mpg mpv mscz mt2 mus mxf mxl \ -// niff nsf nsv off ofr ofs ogg ogv opus ots pac ps psf psf2 psflib ptb qsf \ -// qt ra raw rka rm rmj rmvb roq s3m shn sib sid smi smp sol spc spx ssf svi \ -// swa swf tak ts tta txm usf vgm vob voc vox vqf wav webm wma wmv wrap wtv \ -// wv xm xml ym yuv").split(' '); -// return base::flat_set(list.begin(), list.end()); -// }(); +#if 0 +bool IsValidMediaFile(const QString &filepath) { + static const auto kExtensions = [] { + const auto list = qsl("\ +16svx 2sf 3g2 3gp 8svx aac aaf aif aifc aiff amr amv ape asf ast au aup \ +avchd avi brstm bwf cam cdda cust dat divx drc dsh dsf dts dtshd dtsma \ +dvr-ms dwd evo f4a f4b f4p f4v fla flac flr flv gif gifv gsf gsm gym iff \ +ifo it jam la ly m1v m2p m2ts m2v m4a m4p m4v mcf mid mk3d mka mks mkv mng \ +mov mp1 mp2 mp3 mp4 minipsf mod mpc mpe mpeg mpg mpv mscz mt2 mus mxf mxl \ +niff nsf nsv off ofr ofs ogg ogv opus ots pac ps psf psf2 psflib ptb qsf \ +qt ra raw rka rm rmj rmvb roq s3m shn sib sid smi smp sol spc spx ssf svi \ +swa swf tak ts tta txm usf vgm vob voc vox vqf wav webm wma wmv wrap wtv \ +wv xm xml ym yuv").split(' '); + return base::flat_set(list.begin(), list.end()); + }(); -// return ranges::binary_search( -// kExtensions, -// FileExtension(filepath).toLower()); -// } + return ranges::binary_search( + kExtensions, + FileExtension(filepath).toLower()); +} +#endif bool IsExecutableName(const QString &filepath) { static const auto kExtensions = [] { diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp index 5b18be204..4e83c74c7 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp @@ -1279,14 +1279,12 @@ bool InnerWidget::pinnedShiftAnimationCallback(crl::time now) { now += st::stickersRowDuration; } - auto wasAnimating = false; auto animating = false; auto updateMin = -1; auto updateMax = 0; for (auto i = 0, l = static_cast(_pinnedRows.size()); i != l; ++i) { auto start = _pinnedRows[i].animStartTime; if (start) { - wasAnimating = true; if (updateMin < 0) updateMin = i; updateMax = i; if (start + st::stickersRowDuration > now && now >= start) { diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_filter.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_filter.cpp index 7f1c688b9..579b888c4 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_filter.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_filter.cpp @@ -32,7 +32,6 @@ public: return _check->checked(); } rpl::producer checkedChanges() const; - rpl::producer checkedValue() const; enum class NotifyAboutChange { Notify, @@ -42,8 +41,6 @@ public: bool checked, NotifyAboutChange notify = NotifyAboutChange::Notify); - void finishAnimating(); - QMargins getMargins() const override { return _st.margin; } @@ -90,10 +87,6 @@ rpl::producer UserCheckbox::checkedChanges() const { return _checkedChanges.events(); } -rpl::producer UserCheckbox::checkedValue() const { - return _checkedChanges.events_starting_with(checked()); -} - void UserCheckbox::setChecked(bool checked, NotifyAboutChange notify) { if (_check->checked() != checked) { _check->setChecked(checked, anim::type::normal); @@ -133,10 +126,6 @@ void UserCheckbox::paintEvent(QPaintEvent *e) { p.drawTextLeft(statusLeft, statusTop, width(), _statusText); } -void UserCheckbox::finishAnimating() { - _check->finishAnimating(); -} - int UserCheckbox::resizeGetHeight(int newWidth) { return st::contactsPhotoSize; } diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp index bfdbdbb73..f4b3dc442 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp @@ -1688,7 +1688,7 @@ void InnerWidget::updateSelected() { dragState = view->textState(itemPoint, request); lnkhost = view; if (!dragState.link && itemPoint.x() >= st::historyPhotoLeft && itemPoint.x() < st::historyPhotoLeft + st::msgPhotoSize) { - if (auto message = item->toHistoryMessage()) { + if (item->toHistoryMessage()) { if (view->hasFromPhoto()) { enumerateUserpics([&](not_null view, int userpicTop) { // stop enumeration if the userpic is below our point diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 90134595f..dbba07cdb 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -2829,7 +2829,7 @@ void HistoryInner::mouseActionUpdate() { _dragStateItem = session().data().message(dragState.itemId); lnkhost = view; if (!dragState.link && m.x() >= st::historyPhotoLeft && m.x() < st::historyPhotoLeft + st::msgPhotoSize) { - if (auto msg = item->toHistoryMessage()) { + if (item->toHistoryMessage()) { if (view->hasFromPhoto()) { enumerateUserpics([&](not_null view, int userpicTop) -> bool { // stop enumeration if the userpic is below our point diff --git a/Telegram/SourceFiles/history/view/media/history_view_call.cpp b/Telegram/SourceFiles/history/view/media/history_view_call.cpp index dc4d18894..b127e05ec 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_call.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_call.cpp @@ -89,12 +89,11 @@ void Call::draw(Painter &p, const QRect &r, TextSelection selection, crl::time m accumulate_min(paintw, maxWidth()); - auto nameleft = 0, nametop = 0, nameright = 0, statustop = 0; + auto nameleft = 0, nametop = 0, statustop = 0; auto topMinus = isBubbleTop() ? 0 : st::msgFileTopMinus; nameleft = st::historyCallLeft; nametop = st::historyCallTop - topMinus; - nameright = st::msgFileLayout.padding.left(); statustop = st::historyCallStatusTop - topMinus; p.setFont(st::semiboldFont); diff --git a/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp b/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp index 0644f53e9..99f357012 100644 --- a/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_inner_widget.cpp @@ -126,9 +126,9 @@ void InnerWidget::createTypeButtons() { addMediaButton(Type::MusicFile, st::infoIconMediaAudio); addMediaButton(Type::Link, st::infoIconMediaLink); addMediaButton(Type::RoundVoiceFile, st::infoIconMediaVoice); - if (auto user = _controller->key().peer()->asUser()) { +// if (auto user = _controller->key().peer()->asUser()) { // addCommonGroupsButton(user, st::infoIconMediaGroup); - } +// } content->add(object_ptr( content, diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index 2e08f9131..7a98a0f34 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -616,7 +616,6 @@ ActionsFiller::ActionsFiller( void ActionsFiller::addInviteToGroupAction( not_null user) { - const auto controller = _controller; AddActionButton( _wrap, tr::lng_profile_invite_to_group(), diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp index 84593fa81..a8b9b2a57 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_item.cpp @@ -198,7 +198,7 @@ ClickHandlerPtr ItemBase::getResultPreviewHandler() const { _result->_content_url, false); } else if (const auto document = _result->_document - && _result->_document->createMediaView()->canBePlayed()) { + ; document->createMediaView()->canBePlayed()) { return std::make_shared(); } else if (_result->_photo) { return std::make_shared(); diff --git a/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp b/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp index cb8b225ee..2b76bd072 100644 --- a/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_results_inner.cpp @@ -677,7 +677,6 @@ void Inner::updateSelected() { int row = -1, col = -1, sel = -1; ClickHandlerPtr lnk; ClickHandlerHost *lnkhost = nullptr; - HistoryView::CursorState cursor = HistoryView::CursorState::None; if (sy >= 0) { row = 0; for (int rows = _rows.size(); row < rows; ++row) { @@ -706,7 +705,6 @@ void Inner::updateSelected() { QPoint(sx, sy), HistoryView::StateRequest()); lnk = result.link; - cursor = result.cursor; lnkhost = inlineItems[col]; } else { row = col = -1; diff --git a/Telegram/SourceFiles/media/player/media_player_widget.cpp b/Telegram/SourceFiles/media/player/media_player_widget.cpp index a0204515f..d3518fa39 100644 --- a/Telegram/SourceFiles/media/player/media_player_widget.cpp +++ b/Telegram/SourceFiles/media/player/media_player_widget.cpp @@ -478,12 +478,11 @@ void Widget::handleSongUpdate(const TrackState &state) { } void Widget::updateTimeText(const TrackState &state) { - qint64 position = 0, length = 0, display = 0; + qint64 display = 0; const auto frequency = state.frequency; const auto document = state.id.audio(); if (!IsStoppedOrStopping(state.state)) { - display = position = state.position; - length = state.length; + display = state.position; } else if (state.length) { display = state.length; } else if (const auto song = document->song()) { diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 76b79ec29..c6ce04103 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -2439,7 +2439,7 @@ void OverlayWidget::displayDocument( _docIconRect = QRect((width() - st::mediaviewFileIconSize) / 2, (height() - st::mediaviewFileIconSize) / 2, st::mediaviewFileIconSize, st::mediaviewFileIconSize); int32 colorIndex = documentColorIndex(_document, _docExt); _docIconColor = documentColor(colorIndex); - const style::icon *(thumbs[]) = { &st::mediaviewFileBlue, &st::mediaviewFileGreen, &st::mediaviewFileRed, &st::mediaviewFileYellow }; + const style::icon *thumbs[] = { &st::mediaviewFileBlue, &st::mediaviewFileGreen, &st::mediaviewFileRed, &st::mediaviewFileYellow }; _docIcon = thumbs[colorIndex]; int32 extmaxw = (st::mediaviewFileIconSize - st::mediaviewFileExtPadding * 2); @@ -3433,7 +3433,7 @@ void OverlayWidget::paintThemePreviewContent( width(), st::themePreviewMargin.top()); } - if (const auto fillTitleRect = (titleRect.y() < 0)) { + if (titleRect.y() < 0) { titleRect.moveTop(0); fillOverlay(titleRect); } @@ -3461,8 +3461,7 @@ void OverlayWidget::paintThemePreviewContent( outer.y() + outer.height() - st::themePreviewMargin.bottom(), outer.width(), st::themePreviewMargin.bottom()); - if (const auto fillButtonsRect - = (buttonsRect.y() + buttonsRect.height() > height())) { + if (buttonsRect.y() + buttonsRect.height() > height()) { buttonsRect.moveTop(height() - buttonsRect.height()); fillOverlay(buttonsRect); } diff --git a/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_binder.cpp b/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_binder.cpp index db7a06ce8..2ade496b9 100644 --- a/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_binder.cpp +++ b/Telegram/SourceFiles/mtproto/details/mtproto_dc_key_binder.cpp @@ -109,7 +109,6 @@ DcKeyBindState DcKeyBinder::handleResponse(const mtpBuffer &response) { auto from = response.begin(); const auto end = from + response.size(); auto error = MTPRpcError(); - auto result = MTPBool(); if (response[0] == mtpc_boolTrue) { return DcKeyBindState::Success; } else if (response[0] == mtpc_rpc_error && error.read(from, end)) { diff --git a/Telegram/SourceFiles/mtproto/mtproto_concurrent_sender.h b/Telegram/SourceFiles/mtproto/mtproto_concurrent_sender.h index d82f588eb..47daaf7a6 100644 --- a/Telegram/SourceFiles/mtproto/mtproto_concurrent_sender.h +++ b/Telegram/SourceFiles/mtproto/mtproto_concurrent_sender.h @@ -314,10 +314,10 @@ auto ConcurrentSender::SpecificRequestBuilder::done( Handler, mtpRequestId, Result>; - constexpr auto takesResponse = rpl::details::is_callable_plain_v< + [[maybe_unused]] constexpr auto takesResponse = rpl::details::is_callable_plain_v< Handler, Result>; - constexpr auto takesNone = rpl::details::is_callable_plain_v; + [[maybe_unused]] constexpr auto takesNone = rpl::details::is_callable_plain_v; if constexpr (takesFull) { setDoneHandler(std::forward(handler)); @@ -348,10 +348,10 @@ auto ConcurrentSender::SpecificRequestBuilder::fail( Handler, mtpRequestId, Error>; - constexpr auto takesError = rpl::details::is_callable_plain_v< + [[maybe_unused]] constexpr auto takesError = rpl::details::is_callable_plain_v< Handler, Error>; - constexpr auto takesNone = rpl::details::is_callable_plain_v; + [[maybe_unused]] constexpr auto takesNone = rpl::details::is_callable_plain_v; if constexpr (takesFull) { setFailHandler(std::forward(handler)); diff --git a/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp b/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp index 7458a7ba3..26862b6df 100644 --- a/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp +++ b/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp @@ -58,7 +58,7 @@ const BuiltInDc kBuiltInDcsIPv6Test[] = { { 3, "2001:0b28:f23d:f003:0000:0000:0000:000e", 443 } }; -const char *(kTestPublicRSAKeys[]) = { "\ +const char *kTestPublicRSAKeys[] = { "\ -----BEGIN RSA PUBLIC KEY-----\n\ MIIBCgKCAQEAyMEdY1aR+sCR3ZSJrtztKTKqigvO/vBfqACJLZtS7QMgCGXJ6XIR\n\ yy7mx66W0/sOFa7/1mAZtEoIokDP3ShoqF4fVNb6XeqgQfaUHd8wJpDWHcR2OFwv\n\ @@ -68,7 +68,7 @@ aHWfYmlEGepfaYR8Q0YqvvhYtMte3ITnuSJs171+GDqpdKcSwHnd6FudwGO4pcCO\n\ j4WcDuXc2CTHgH8gFTNhp/Y8/SpDOhvn9QIDAQAB\n\ -----END RSA PUBLIC KEY-----" }; -const char *(kPublicRSAKeys[]) = { "\ +const char *kPublicRSAKeys[] = { "\ -----BEGIN RSA PUBLIC KEY-----\n\ MIIBCgKCAQEA6LszBcC1LGzyr992NzE0ieY+BSaOW622Aa9Bd4ZHLl+TuFQ4lo4g\n\ 5nKaMBwK/BIb9xUfg0Q29/2mgIR6Zr9krM7HjuIcCzFvDtr+L0GQjae9H0pRB2OO\n\ diff --git a/Telegram/SourceFiles/platform/linux/linux_gsd_media_keys.cpp b/Telegram/SourceFiles/platform/linux/linux_gsd_media_keys.cpp deleted file mode 100644 index c5f19e03f..000000000 --- a/Telegram/SourceFiles/platform/linux/linux_gsd_media_keys.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* -This file is part of Telegram Desktop, -the official desktop application for the Telegram messaging service. - -For license and copyright information please follow this link: -https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL -*/ -#include "platform/linux/linux_gsd_media_keys.h" - -#include "core/sandbox.h" -#include "media/player/media_player_instance.h" -#include "base/platform/linux/base_linux_glibmm_helper.h" -#include "base/platform/linux/base_linux_dbus_utilities.h" - -#include -#include - -namespace Platform { -namespace internal { -namespace { - -constexpr auto kService = "org.gnome.SettingsDaemon.MediaKeys"_cs; -constexpr auto kOldService = "org.gnome.SettingsDaemon"_cs; -constexpr auto kMATEService = "org.mate.SettingsDaemon"_cs; -constexpr auto kObjectPath = "/org/gnome/SettingsDaemon/MediaKeys"_cs; -constexpr auto kMATEObjectPath = "/org/mate/SettingsDaemon/MediaKeys"_cs; -constexpr auto kInterface = kService; -constexpr auto kMATEInterface = "org.mate.SettingsDaemon.MediaKeys"_cs; - -void KeyPressed( - const Glib::RefPtr &connection, - const Glib::ustring &sender_name, - const Glib::ustring &object_path, - const Glib::ustring &interface_name, - const Glib::ustring &signal_name, - const Glib::VariantContainerBase ¶meters) { - try { - auto parametersCopy = parameters; - - const auto app = base::Platform::GlibVariantCast( - parametersCopy.get_child(0)); - - const auto key = base::Platform::GlibVariantCast( - parametersCopy.get_child(1)); - - if (app != QCoreApplication::applicationName().toStdString()) { - return; - } - - Core::Sandbox::Instance().customEnterFromEventLoop([&] { - if (key == "Play") { - Media::Player::instance()->playPause(); - } else if (key == "Stop") { - Media::Player::instance()->stop(); - } else if (key == "Next") { - Media::Player::instance()->next(); - } else if (key == "Previous") { - Media::Player::instance()->previous(); - } - }); - } catch (...) { - } -} - -} // namespace - -class GSDMediaKeys::Private { -public: - Glib::RefPtr dbusConnection; - - Glib::ustring service; - Glib::ustring objectPath; - Glib::ustring interface; - uint signalId = 0; - bool grabbed = false; -}; - -GSDMediaKeys::GSDMediaKeys() -: _private(std::make_unique()) { - try { - _private->dbusConnection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); - - if (base::Platform::DBus::NameHasOwner( - _private->dbusConnection, - std::string(kService))) { - _private->service = std::string(kService); - _private->objectPath = std::string(kObjectPath); - _private->interface = std::string(kInterface); - } else if (base::Platform::DBus::NameHasOwner( - _private->dbusConnection, - std::string(kOldService))) { - _private->service = std::string(kOldService); - _private->objectPath = std::string(kObjectPath); - _private->interface = std::string(kInterface); - } else if (base::Platform::DBus::NameHasOwner( - _private->dbusConnection, - std::string(kMATEService))) { - _private->service = std::string(kMATEService); - _private->objectPath = std::string(kMATEObjectPath); - _private->interface = std::string(kMATEInterface); - } else { - return; - } - - _private->dbusConnection->call_sync( - _private->objectPath, - _private->interface, - "GrabMediaPlayerKeys", - base::Platform::MakeGlibVariant(std::tuple{ - Glib::ustring( - QCoreApplication::applicationName() - .toStdString()), - uint(0), - }), - _private->service); - - _private->grabbed = true; - - _private->signalId = _private->dbusConnection->signal_subscribe( - sigc::ptr_fun(KeyPressed), - _private->service, - _private->interface, - "MediaPlayerKeyPressed", - _private->objectPath); - } catch (...) { - } -} - -GSDMediaKeys::~GSDMediaKeys() { - if (_private->dbusConnection) { - if (_private->signalId != 0) { - _private->dbusConnection->signal_unsubscribe(_private->signalId); - } - - if (_private->grabbed) { - try { - _private->dbusConnection->call_sync( - _private->objectPath, - _private->interface, - "ReleaseMediaPlayerKeys", - base::Platform::MakeGlibVariant(std::tuple{ - Glib::ustring( - QCoreApplication::applicationName() - .toStdString()) - }), - _private->service); - - _private->grabbed = false; - } catch (...) { - } - } - } -} - -} // namespace internal -} // namespace Platform diff --git a/Telegram/SourceFiles/platform/linux/linux_gsd_media_keys.h b/Telegram/SourceFiles/platform/linux/linux_gsd_media_keys.h deleted file mode 100644 index 10b854d6e..000000000 --- a/Telegram/SourceFiles/platform/linux/linux_gsd_media_keys.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -This file is part of Telegram Desktop, -the official desktop application for the Telegram messaging service. - -For license and copyright information please follow this link: -https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL -*/ -#pragma once - -namespace Platform { -namespace internal { - -class GSDMediaKeys { -public: - GSDMediaKeys(); - - GSDMediaKeys(const GSDMediaKeys &other) = delete; - GSDMediaKeys &operator=(const GSDMediaKeys &other) = delete; - GSDMediaKeys(GSDMediaKeys &&other) = delete; - GSDMediaKeys &operator=(GSDMediaKeys &&other) = delete; - - ~GSDMediaKeys(); - -private: - class Private; - const std::unique_ptr _private; -}; - -} // namespace internal -} // namespace Platform diff --git a/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp b/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp index 33b8a23c4..6d9bcef1c 100644 --- a/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_gtk_integration.cpp @@ -16,7 +16,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/platform/linux/base_linux_glibmm_helper.h" #include "base/platform/linux/base_linux_dbus_utilities.h" #include "base/platform/base_platform_info.h" -#include "webview/platform/linux/webview_linux_webkit2gtk.h" #include "platform/linux/linux_gtk_integration_p.h" #include "platform/linux/linux_gdk_helper.h" #include "platform/linux/linux_gtk_open_with_dialog.h" @@ -24,6 +23,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "window/window_controller.h" #include "core/application.h" +#ifndef DESKTOP_APP_DISABLE_WEBKITGTK +#include "webview/platform/linux/webview_linux_webkit2gtk.h" +#endif // !DESKTOP_APP_DISABLE_WEBKITGTK + #include #include @@ -173,6 +176,7 @@ void GtkIntegration::Private::handleMethodCall( "Access denied."); invocation->return_error(error); + return; } try { @@ -587,9 +591,11 @@ int GtkIntegration::Exec( if (const auto integration = BaseGtkIntegration::Instance()) { return integration->exec(parentDBusName); } +#ifndef DESKTOP_APP_DISABLE_WEBKITGTK } else if (type == Type::Webview) { Webview::WebKit2Gtk::SetServiceName(serviceName.toStdString()); return Webview::WebKit2Gtk::Exec(parentDBusName.toStdString()); +#endif // !DESKTOP_APP_DISABLE_WEBKITGTK } else if (type == Type::TDesktop) { ServiceName = serviceName.toStdString(); if (const auto integration = Instance()) { @@ -614,8 +620,10 @@ void GtkIntegration::Start(Type type) { if (type == Type::Base) { BaseGtkIntegration::SetServiceName(kBaseService.utf16().arg(h)); } else if (type == Type::Webview) { +#ifndef DESKTOP_APP_DISABLE_WEBKITGTK Webview::WebKit2Gtk::SetServiceName( kWebviewService.utf16().arg(h).arg("%1").toStdString()); +#endif // !DESKTOP_APP_DISABLE_WEBKITGTK return; } else { diff --git a/Telegram/SourceFiles/platform/linux/linux_notification_service_watcher.cpp b/Telegram/SourceFiles/platform/linux/linux_notification_service_watcher.cpp deleted file mode 100644 index f0dc477bd..000000000 --- a/Telegram/SourceFiles/platform/linux/linux_notification_service_watcher.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* -This file is part of Telegram Desktop, -the official desktop application for the Telegram messaging service. - -For license and copyright information please follow this link: -https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL -*/ -#include "platform/linux/linux_notification_service_watcher.h" - -#include "core/application.h" -#include "main/main_domain.h" -#include "window/notifications_manager.h" -#include "base/platform/linux/base_linux_glibmm_helper.h" -#include "base/platform/linux/base_linux_dbus_utilities.h" - -#include -#include - -namespace Platform { -namespace internal { -namespace { - -constexpr auto kService = "org.freedesktop.Notifications"_cs; - -auto Activatable() { - static const auto Result = []() -> std::optional { - try { - const auto connection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); - - return ranges::contains( - base::Platform::DBus::ListActivatableNames(connection), - Glib::ustring(std::string(kService))); - } catch (...) { - } - - return std::nullopt; - }(); - - return Result; -} - -} // namespace - -class NotificationServiceWatcher::Private { -public: - Glib::RefPtr dbusConnection; - uint signalId = 0; -}; - -NotificationServiceWatcher::NotificationServiceWatcher() -: _private(std::make_unique()) { - try { - _private->dbusConnection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); - - _private->signalId = base::Platform::DBus::RegisterServiceWatcher( - _private->dbusConnection, - std::string(kService), - []( - const Glib::ustring &service, - const Glib::ustring &oldOwner, - const Glib::ustring &newOwner) { - if (!Core::App().domain().started() - || (Activatable().value_or(true) && newOwner.empty())) { - return; - } - - crl::on_main([] { - Core::App().notifications().createManager(); - }); - }); - } catch (...) { - } -} - -NotificationServiceWatcher::~NotificationServiceWatcher() { - if (_private->dbusConnection && _private->signalId != 0) { - _private->dbusConnection->signal_unsubscribe(_private->signalId); - } -} - -} // namespace internal -} // namespace Platform diff --git a/Telegram/SourceFiles/platform/linux/linux_notification_service_watcher.h b/Telegram/SourceFiles/platform/linux/linux_notification_service_watcher.h deleted file mode 100644 index 034b49c7b..000000000 --- a/Telegram/SourceFiles/platform/linux/linux_notification_service_watcher.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -This file is part of Telegram Desktop, -the official desktop application for the Telegram messaging service. - -For license and copyright information please follow this link: -https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL -*/ -#pragma once - -namespace Platform { -namespace internal { - -class NotificationServiceWatcher { -public: - NotificationServiceWatcher(); - ~NotificationServiceWatcher(); - -private: - class Private; - const std::unique_ptr _private; -}; - -} // namespace internal -} // namespace Platform diff --git a/Telegram/SourceFiles/platform/linux/linux_xdp_file_dialog.cpp b/Telegram/SourceFiles/platform/linux/linux_xdp_file_dialog.cpp index af392bee3..c6dd88fcb 100644 --- a/Telegram/SourceFiles/platform/linux/linux_xdp_file_dialog.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_xdp_file_dialog.cpp @@ -176,20 +176,14 @@ public: } } - bool defaultNameFilterDisables() const; QUrl directory() const; void setDirectory(const QUrl &directory); void selectFile(const QUrl &filename); QList selectedFiles() const; - void setFilter(); - void selectNameFilter(const QString &filter); - QString selectedNameFilter() const; - void selectMimeTypeFilter(const QString &filter); - QString selectedMimeTypeFilter() const; int exec() override; - bool failedToOpen() { + bool failedToOpen() const { return _failedToOpen; } @@ -517,10 +511,6 @@ void XDPFileDialog::openPortal() { } } -bool XDPFileDialog::defaultNameFilterDisables() const { - return false; -} - void XDPFileDialog::setDirectory(const QUrl &directory) { _directory = directory.path().toStdString(); } @@ -544,23 +534,6 @@ QList XDPFileDialog::selectedFiles() const { return files; } -void XDPFileDialog::setFilter() { -} - -void XDPFileDialog::selectMimeTypeFilter(const QString &filter) { -} - -QString XDPFileDialog::selectedMimeTypeFilter() const { - return QString::fromStdString(_selectedMimeTypeFilter); -} - -void XDPFileDialog::selectNameFilter(const QString &filter) { -} - -QString XDPFileDialog::selectedNameFilter() const { - return QString::fromStdString(_selectedNameFilter); -} - int XDPFileDialog::exec() { setAttribute(Qt::WA_DeleteOnClose, false); diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index 82955b01c..0c5cbd18f 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -49,6 +49,43 @@ bool InhibitionSupported = false; std::optional CurrentServerInformation; QStringList CurrentCapabilities; +std::unique_ptr CreateServiceWatcher() { + try { + const auto connection = Gio::DBus::Connection::get_sync( + Gio::DBus::BusType::BUS_TYPE_SESSION); + + const auto activatable = [&] { + try { + return ranges::contains( + base::Platform::DBus::ListActivatableNames(connection), + Glib::ustring(std::string(kService))); + } catch (...) { + // avoid service restart loop in sandboxed environments + return true; + } + }(); + + return std::make_unique( + connection, + std::string(kService), + [=]( + const Glib::ustring &service, + const Glib::ustring &oldOwner, + const Glib::ustring &newOwner) { + if (activatable && newOwner.empty()) { + return; + } + + crl::on_main([] { + Core::App().notifications().createManager(); + }); + }); + } catch (...) { + } + + return nullptr; +} + void StartServiceAsync(Fn callback) { try { const auto connection = Gio::DBus::Connection::get_sync( @@ -632,13 +669,17 @@ void NotificationData::close() { } void NotificationData::setImage(const QString &imagePath) { - if (_imageKey.empty()) { + if (imagePath.isEmpty() || _imageKey.empty()) { return; } const auto image = QImage(imagePath) .convertToFormat(QImage::Format_RGBA8888); + if (image.isNull()) { + return; + } + _hints[_imageKey] = MakeGlibVariant(std::tuple{ image.width(), image.height(), @@ -712,6 +753,8 @@ bool ByDefault() { } void Create(Window::Notifications::System *system) { + static const auto ServiceWatcher = CreateServiceWatcher(); + const auto managerSetter = [=] { using ManagerType = Window::Notifications::ManagerType; if ((Core::App().settings().nativeNotifications() && Supported()) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index e0e742a2c..24d471548 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -27,9 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION #include "base/platform/linux/base_linux_dbus_utilities.h" #include "base/platform/linux/base_linux_xdp_utilities.h" -#include "platform/linux/linux_notification_service_watcher.h" #include "platform/linux/linux_xdp_file_dialog.h" -#include "platform/linux/linux_gsd_media_keys.h" #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION #ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION @@ -44,8 +42,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include -#include -#include #include #include #include @@ -72,20 +68,13 @@ namespace { constexpr auto kDesktopFile = ":/misc/kotatogramdesktop.desktop"_cs; constexpr auto kIconName = "kotatogram"_cs; -constexpr auto kHandlerTypeName = "x-scheme-handler/tg"_cs; constexpr auto kDarkColorLimit = 192; constexpr auto kXDGDesktopPortalService = "org.freedesktop.portal.Desktop"_cs; constexpr auto kXDGDesktopPortalObjectPath = "/org/freedesktop/portal/desktop"_cs; constexpr auto kIBusPortalService = "org.freedesktop.portal.IBus"_cs; -constexpr auto kSnapcraftSettingsService = "io.snapcraft.Settings"_cs; -constexpr auto kSnapcraftSettingsObjectPath = "/io/snapcraft/Settings"_cs; -constexpr auto kSnapcraftSettingsInterface = kSnapcraftSettingsService; - #ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION -std::unique_ptr NSWInstance; - void PortalAutostart(bool start, bool silent) { if (cExeName().isEmpty()) { return; @@ -213,67 +202,6 @@ void PortalAutostart(bool start, bool silent) { } } -void SnapDefaultHandler(const QString &protocol) { - try { - const auto connection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); - - auto reply = connection->call_sync( - std::string(kSnapcraftSettingsObjectPath), - std::string(kSnapcraftSettingsInterface), - "GetSub", - base::Platform::MakeGlibVariant(std::tuple{ - Glib::ustring("default-url-scheme-handler"), - Glib::ustring(protocol.toStdString()), - }), - std::string(kSnapcraftSettingsService)); - - const auto currentHandler = base::Platform::GlibVariantCast< - Glib::ustring>(reply.get_child(0)); - - const auto expectedHandler = qEnvironmentVariable("SNAP_NAME") - + qsl(".desktop"); - - if (currentHandler == expectedHandler.toStdString()) { - return; - } - - const auto context = Glib::MainContext::create(); - const auto loop = Glib::MainLoop::create(context); - g_main_context_push_thread_default(context->gobj()); - - connection->call( - std::string(kSnapcraftSettingsObjectPath), - std::string(kSnapcraftSettingsInterface), - "SetSub", - base::Platform::MakeGlibVariant(std::tuple{ - Glib::ustring("default-url-scheme-handler"), - Glib::ustring(protocol.toStdString()), - Glib::ustring(expectedHandler.toStdString()), - }), - [&](const Glib::RefPtr &result) { - try { - connection->call_finish(result); - } catch (const Glib::Error &e) { - LOG(("Snap Default Handler Error: %1").arg( - QString::fromStdString(e.what()))); - } - - loop->quit(); - }, - std::string(kSnapcraftSettingsService)); - - QWindow window; - QGuiApplicationPrivate::showModalWindow(&window); - loop->run(); - g_main_context_pop_thread_default(context->gobj()); - QGuiApplicationPrivate::hideModalWindow(&window); - } catch (const Glib::Error &e) { - LOG(("Snap Default Handler Error: %1").arg( - QString::fromStdString(e.what()))); - } -} - bool IsIBusPortalPresent() { static const auto Result = [&] { try { @@ -526,22 +454,6 @@ void SetDarkMode() { } // namespace -void SetWatchingMediaKeys(bool watching) { -#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION - static std::unique_ptr GSDInstance; - - if (watching) { - if (!GSDInstance) { - GSDInstance = std::make_unique(); - } - } else { - if (GSDInstance) { - GSDInstance = nullptr; - } - } -#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION -} - void SetApplicationIcon(const QIcon &icon) { QApplication::setWindowIcon(icon); } @@ -820,76 +732,6 @@ void InstallLauncher(bool force) { }); } -void RegisterCustomScheme(bool force) { - try { -#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION - if (InSnap()) { - SnapDefaultHandler(qsl("tg")); - return; - } -#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION - - if (cExeName().isEmpty()) { - return; - } - - const auto neededCommandlineBuilder = qsl("%1 -workdir %2 --").arg( - QString(EscapeShell(QFile::encodeName(cExeDir() + cExeName()))), - QString(EscapeShell(QFile::encodeName(cWorkingDir())))); - - const auto neededCommandline = qsl("%1 %u") - .arg(neededCommandlineBuilder); - - const auto currentAppInfo = Gio::AppInfo::get_default_for_type( - std::string(kHandlerTypeName), - true); - - if (currentAppInfo) { - const auto currentCommandline = QString::fromStdString( - currentAppInfo->get_commandline()); - - if (currentCommandline == neededCommandline) { - return; - } - } - - auto registeredAppInfoList = g_app_info_get_recommended_for_type( - kHandlerTypeName.utf8().constData()); - - for (auto l = registeredAppInfoList; l != nullptr; l = l->next) { - const auto currentRegisteredAppInfo = reinterpret_cast( - l->data); - - const auto currentAppInfoId = QString( - g_app_info_get_id(currentRegisteredAppInfo)); - - const auto currentCommandline = QString( - g_app_info_get_commandline(currentRegisteredAppInfo)); - - if (currentCommandline == neededCommandline - && currentAppInfoId.startsWith(qsl("userapp-"))) { - g_app_info_delete(currentRegisteredAppInfo); - } - } - - if (registeredAppInfoList) { - g_list_free_full(registeredAppInfoList, g_object_unref); - } - - const auto newAppInfo = Gio::AppInfo::create_from_commandline( - neededCommandlineBuilder.toStdString(), - std::string(AppName), - Gio::AppInfoCreateFlags::APP_INFO_CREATE_SUPPORTS_URIS); - - if (newAppInfo) { - newAppInfo->set_as_default_for_type( - std::string(kHandlerTypeName)); - } - } catch (const Glib::Error &e) { - LOG(("App Error: %1").arg(QString::fromStdString(e.what()))); - } -} - PermissionStatus GetPermissionStatus(PermissionType type) { return PermissionStatus::Granted; } @@ -965,15 +807,11 @@ void start() { crl::async(SetDarkMode); #ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION - NSWInstance = std::make_unique(); FileDialog::XDP::Start(); #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION } void finish() { -#ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION - NSWInstance = nullptr; -#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION } } // namespace ThirdParty @@ -984,7 +822,6 @@ void psNewVersion() { #ifndef __HAIKU__ Platform::InstallLauncher(); #endif // __HAIKU__ - Platform::RegisterCustomScheme(); } void psAutoStart(bool start, bool silent) { diff --git a/Telegram/SourceFiles/platform/mac/specific_mac.mm b/Telegram/SourceFiles/platform/mac/specific_mac.mm index 6b283d461..f07ba21cd 100644 --- a/Telegram/SourceFiles/platform/mac/specific_mac.mm +++ b/Telegram/SourceFiles/platform/mac/specific_mac.mm @@ -112,11 +112,6 @@ void WriteCrashDumpDetails() { #endif // DESKTOP_APP_DISABLE_CRASH_REPORTS } -void RegisterCustomScheme(bool force) { - OSStatus result = LSSetDefaultHandlerForURLScheme(CFSTR("tg"), (CFStringRef)[[NSBundle mainBundle] bundleIdentifier]); - DEBUG_LOG(("App Info: set default handler for 'tg' scheme result: %1").arg(result)); -} - // I do check for availability, just not in the exact way clang is content with #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunguarded-availability" @@ -196,7 +191,6 @@ void IgnoreApplicationActivationRightNow() { } // namespace Platform void psNewVersion() { - Platform::RegisterCustomScheme(); } void psAutoStart(bool start, bool silent) { diff --git a/Telegram/SourceFiles/platform/mac/specific_mac_p.mm b/Telegram/SourceFiles/platform/mac/specific_mac_p.mm index edd85a666..eee9c89d6 100644 --- a/Telegram/SourceFiles/platform/mac/specific_mac_p.mm +++ b/Telegram/SourceFiles/platform/mac/specific_mac_p.mm @@ -243,9 +243,6 @@ ApplicationDelegate *_sharedDelegate = nil; namespace Platform { -void SetWatchingMediaKeys(bool watching) { -} - void SetApplicationIcon(const QIcon &icon) { NSImage *image = nil; if (!icon.isNull()) { diff --git a/Telegram/SourceFiles/platform/platform_specific.h b/Telegram/SourceFiles/platform/platform_specific.h index f7112b214..0dec322f7 100644 --- a/Telegram/SourceFiles/platform/platform_specific.h +++ b/Telegram/SourceFiles/platform/platform_specific.h @@ -27,10 +27,8 @@ enum class SystemSettingsType { Audio, }; -void SetWatchingMediaKeys(bool watching); void SetApplicationIcon(const QIcon &icon); QString SingleInstanceLocalServerName(const QString &hash); -void RegisterCustomScheme(bool force = false); PermissionStatus GetPermissionStatus(PermissionType type); void RequestPermission(PermissionType type, Fn resultCallback); void OpenSystemSettingsForPermission(PermissionType type); diff --git a/Telegram/SourceFiles/platform/win/specific_win.cpp b/Telegram/SourceFiles/platform/win/specific_win.cpp index 733c698ce..ef83597ab 100644 --- a/Telegram/SourceFiles/platform/win/specific_win.cpp +++ b/Telegram/SourceFiles/platform/win/specific_win.cpp @@ -372,58 +372,6 @@ namespace { namespace Platform { -void RegisterCustomScheme(bool force) { - if (cExeName().isEmpty()) { - return; - } - DEBUG_LOG(("App Info: Checking custom scheme 'tg'...")); - - HKEY rkey; - QString exe = QDir::toNativeSeparators(cExeDir() + cExeName()); - QString possibleParams; - - if (!cUseEnvApi()) { - possibleParams += " -no-env-api"; - } - if (cApiFromStartParams()) { - possibleParams += " -api-id \"" + QString::number(cApiId()) + "\""; - possibleParams += " -api-hash \"" + cApiHash() + "\""; - } - - // Legacy URI scheme registration - if (!_psOpenRegKey(L"Software\\Classes\\tg", &rkey)) return; - if (!_psSetKeyValue(rkey, L"URL Protocol", QString())) return; - if (!_psSetKeyValue(rkey, 0, qsl("URL:Telegram Link"))) return; - - if (!_psOpenRegKey(L"Software\\Classes\\tg\\DefaultIcon", &rkey)) return; - if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl(",1\""))) return; - - if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell", &rkey)) return; - if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open", &rkey)) return; - if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open\\command", &rkey)) return; - if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl("\" -workdir \"") + cWorkingDir() + qsl("\"") + possibleParams + qsl(" -- \"%1\""))) return; - - // URI scheme registration as Default Program - Windows Vista and above - if (!_psOpenRegKey(L"Software\\Classes\\ktgdesktop.tg", &rkey)) return; - if (!_psOpenRegKey(L"Software\\Classes\\ktgdesktop.tg\\DefaultIcon", &rkey)) return; - if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl(",1\""))) return; - - if (!_psOpenRegKey(L"Software\\Classes\\ktgdesktop.tg\\shell", &rkey)) return; - if (!_psOpenRegKey(L"Software\\Classes\\ktgdesktop.tg\\shell\\open", &rkey)) return; - if (!_psOpenRegKey(L"Software\\Classes\\ktgdesktop.tg\\shell\\open\\command", &rkey)) return; - if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl("\" -workdir \"") + cWorkingDir() + qsl("\"") + possibleParams + qsl(" -- \"%1\""))) return; - - if (!_psOpenRegKey(L"Software\\KotatogramDesktop", &rkey)) return; - if (!_psOpenRegKey(L"Software\\KotatogramDesktop\\Capabilities", &rkey)) return; - if (!_psSetKeyValue(rkey, L"ApplicationName", qsl("Kotatogram Desktop"))) return; - if (!_psSetKeyValue(rkey, L"ApplicationDescription", qsl("Kotatogram Desktop"))) return; - if (!_psOpenRegKey(L"Software\\KotatogramDesktop\\Capabilities\\UrlAssociations", &rkey)) return; - if (!_psSetKeyValue(rkey, L"tg", qsl("ktgdesktop.tg"))) return; - - if (!_psOpenRegKey(L"Software\\RegisteredApplications", &rkey)) return; - if (!_psSetKeyValue(rkey, L"Kotatogram Desktop", qsl("SOFTWARE\\KotatogramDesktop\\Capabilities"))) return; -} - PermissionStatus GetPermissionStatus(PermissionType type) { if (type==PermissionType::Microphone) { PermissionStatus result=PermissionStatus::Granted; @@ -476,7 +424,6 @@ bool OpenSystemSettings(SystemSettingsType type) { } // namespace Platform void psNewVersion() { - Platform::RegisterCustomScheme(); if (Local::oldSettingsVersion() < 8051) { AppUserModelId::checkPinned(); } diff --git a/Telegram/SourceFiles/platform/win/specific_win.h b/Telegram/SourceFiles/platform/win/specific_win.h index d35c3fcf3..84a8c8250 100644 --- a/Telegram/SourceFiles/platform/win/specific_win.h +++ b/Telegram/SourceFiles/platform/win/specific_win.h @@ -16,9 +16,6 @@ class LocationPoint; namespace Platform { -inline void SetWatchingMediaKeys(bool watching) { -} - inline void IgnoreApplicationActivationRightNow() { } diff --git a/Telegram/SourceFiles/settings/settings_codes.cpp b/Telegram/SourceFiles/settings/settings_codes.cpp index ebf5d4c18..9a7ecabce 100644 --- a/Telegram/SourceFiles/settings/settings_codes.cpp +++ b/Telegram/SourceFiles/settings/settings_codes.cpp @@ -127,7 +127,7 @@ auto GenerateCodes() { } }); codes.emplace(qsl("registertg"), [](SessionController *window) { - Platform::RegisterCustomScheme(true); + Core::Application::RegisterUrlScheme(); Ui::Toast::Show("Forced custom scheme register."); }); diff --git a/Telegram/SourceFiles/settings/settings_intro.cpp b/Telegram/SourceFiles/settings/settings_intro.cpp index bf0053b48..e214b5c3e 100644 --- a/Telegram/SourceFiles/settings/settings_intro.cpp +++ b/Telegram/SourceFiles/settings/settings_intro.cpp @@ -49,7 +49,6 @@ protected: private: void updateControlsGeometry(int newWidth); Ui::RpWidget *pushButton(base::unique_qptr button); - void removeButton(not_null button); const style::InfoTopBar &_st; std::vector> _buttons; @@ -136,12 +135,6 @@ Ui::RpWidget *TopBar::pushButton(base::unique_qptr button) { return weak; } -void TopBar::removeButton(not_null button) { - _buttons.erase( - std::remove(_buttons.begin(), _buttons.end(), button), - _buttons.end()); -} - int TopBar::resizeGetHeight(int newWidth) { updateControlsGeometry(newWidth); return _st.height; diff --git a/Telegram/SourceFiles/ui/boxes/choose_date_time.cpp b/Telegram/SourceFiles/ui/boxes/choose_date_time.cpp index 58af031ab..482826e55 100644 --- a/Telegram/SourceFiles/ui/boxes/choose_date_time.cpp +++ b/Telegram/SourceFiles/ui/boxes/choose_date_time.cpp @@ -126,7 +126,6 @@ private: void setInnerFocus(); void putNext(const object_ptr &field, QChar ch); void erasePrevious(const object_ptr &field); - void finishInnerAnimating(); void setErrorShown(bool error); void setFocused(bool focused); void startBorderAnimation(); @@ -538,14 +537,6 @@ void TimeInput::setFocused(bool focused) { } } -void TimeInput::finishInnerAnimating() { - _hour->finishAnimating(); - _minute->finishAnimating(); - _a_borderOpacity.stop(); - _a_borderShown.stop(); - _a_error.stop(); -} - void TimeInput::startBorderAnimation() { auto borderVisible = (_error || _focused); if (_borderVisible != borderVisible) { diff --git a/Telegram/SourceFiles/ui/empty_userpic.cpp b/Telegram/SourceFiles/ui/empty_userpic.cpp index 6229a59ff..cf6991e5c 100644 --- a/Telegram/SourceFiles/ui/empty_userpic.cpp +++ b/Telegram/SourceFiles/ui/empty_userpic.cpp @@ -593,7 +593,7 @@ void EmptyUserpic::fillString(const QString &name) { auto ch = name.constData(), end = ch + name.size(); while (ch != end) { auto emojiLength = 0; - if (auto emoji = Ui::Emoji::Find(ch, end, &emojiLength)) { + if (Ui::Emoji::Find(ch, end, &emojiLength)) { ch += emojiLength; } else if (ch->isHighSurrogate()) { ++ch; diff --git a/Telegram/SourceFiles/window/main_window.cpp b/Telegram/SourceFiles/window/main_window.cpp index e9097bff9..0eca24372 100644 --- a/Telegram/SourceFiles/window/main_window.cpp +++ b/Telegram/SourceFiles/window/main_window.cpp @@ -520,11 +520,9 @@ void MainWindow::initSize() { } const auto primaryScreen = QGuiApplication::primaryScreen(); - auto geometryScreen = primaryScreen; const auto available = primaryScreen ? primaryScreen->availableGeometry() : QRect(0, 0, st::windowDefaultWidth, st::windowDefaultHeight); - bool maximized = false; const auto initialWidth = Core::Settings::ThirdColumnByDefault() ? st::windowBigDefaultWidth : st::windowDefaultWidth; @@ -590,13 +588,11 @@ void MainWindow::initSize() { position.y + st::windowMinHeight <= screenGeometry.y() + screenGeometry.height()) { DEBUG_LOG(("Window Pos: Resulting geometry is %1, %2, %3, %4").arg(position.x).arg(position.y).arg(position.w).arg(position.h)); geometry = QRect(position.x, position.y, position.w, position.h); - geometryScreen = screen; } } break; } } - maximized = position.maximized; } geometry += _padding; DEBUG_LOG(("Window Pos: Setting first %1, %2, %3, %4").arg(geometry.x()).arg(geometry.y()).arg(geometry.width()).arg(geometry.height())); diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp index cdcd972db..11c2d5a15 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp @@ -320,7 +320,7 @@ bool EditorBlock::selectSkip(int direction) { if (newSelected < -1 || newSelected > maxSelected) { newSelected = maxSelected; } - if (auto changed = (newSelected != _selected)) { + if (newSelected != _selected) { setSelected(newSelected); scrollToSelected(); return (newSelected >= 0); diff --git a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp index 4dc37072d..e88f10ff7 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp @@ -31,7 +31,7 @@ QString fillLetters(const QString &name) { auto ch = name.constData(), end = ch + name.size(); while (ch != end) { auto emojiLength = 0; - if (auto emoji = Ui::Emoji::Find(ch, end, &emojiLength)) { + if (Ui::Emoji::Find(ch, end, &emojiLength)) { ch += emojiLength; } else if (ch->isHighSurrogate()) { ++ch; @@ -246,10 +246,8 @@ void Generator::addAudioBubble(QVector waveform, int waveactive, QString wa auto skipBlock = computeSkipBlock(status, date); auto width = st::msgFileMinWidth; - auto tleft = 0, tright = 0; const auto &st = st::msgFileLayout; - tleft = st.padding.left() + st.thumbSize + st.padding.right(); - tright = st.padding.left(); + auto tleft = st.padding.left() + st.thumbSize + st.padding.right(); accumulate_max(width, tleft + st::normalFont->width(wavestatus) + skipBlock.width() + st::msgPadding.right()); if (!AdaptiveBubbles()) { accumulate_min(width, st::msgMaxWidth); diff --git a/Telegram/SourceFiles/window/window_outdated_bar.cpp b/Telegram/SourceFiles/window/window_outdated_bar.cpp index d3ba377cc..5c2c6352d 100644 --- a/Telegram/SourceFiles/window/window_outdated_bar.cpp +++ b/Telegram/SourceFiles/window/window_outdated_bar.cpp @@ -22,6 +22,7 @@ constexpr auto kMinimalSkip = 7; constexpr auto kSoonSkip = 30; constexpr auto kNowSkip = 90; +#ifdef DESKTOP_APP_SPECIAL_TARGET class Bar : public Ui::RpWidget { public: Bar(not_null parent, QDate date); @@ -96,7 +97,6 @@ void Bar::paintEvent(QPaintEvent *e) { _soon ? st::outdateSoonBg : st::outdatedBg); } -#ifdef DESKTOP_APP_SPECIAL_TARGET QString LastHiddenPath() { return cWorkingDir() + qsl("tdata/outdated_hidden"); } diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index 4865cdc8d..9cbba9cac 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -33,6 +33,7 @@ RUN git clone $GIT/desktop-app/patches.git WORKDIR patches RUN git checkout 87a2e9ee07 +WORKDIR .. FROM builder AS extra-cmake-modules diff --git a/Telegram/build/setup.iss b/Telegram/build/setup.iss index b13f93de7..6a7ceedf1 100644 --- a/Telegram/build/setup.iss +++ b/Telegram/build/setup.iss @@ -21,6 +21,7 @@ DefaultGroupName={#MyAppName} AllowNoIcons=yes OutputDir={#ReleasePath} SetupIconFile={#SourcePath}..\Resources\art\icon256.ico +UninstallDisplayName={#MyAppName} UninstallDisplayIcon={app}\Kotatogram.exe Compression=lzma SolidCompression=yes diff --git a/Telegram/cmake/lib_tgvoip.cmake b/Telegram/cmake/lib_tgvoip.cmake index 6c97e3c7f..f7007c4e4 100644 --- a/Telegram/cmake/lib_tgvoip.cmake +++ b/Telegram/cmake/lib_tgvoip.cmake @@ -191,7 +191,7 @@ if (NOT TGVOIP_FOUND) if (LINUX) if (NOT LIBTGVOIP_DISABLE_ALSA) find_package(ALSA REQUIRED) - target_include_directories(lib_tgvoip_bundled PRIVATE ${ALSA_INCLUDE_DIRS}) + target_include_directories(lib_tgvoip_bundled SYSTEM PRIVATE ${ALSA_INCLUDE_DIRS}) else() remove_target_sources(lib_tgvoip_bundled ${tgvoip_loc} os/linux/AudioInputALSA.cpp @@ -206,7 +206,7 @@ if (NOT TGVOIP_FOUND) if (NOT LIBTGVOIP_DISABLE_PULSEAUDIO) find_package(PkgConfig REQUIRED) pkg_check_modules(PULSE REQUIRED libpulse) - target_include_directories(lib_tgvoip_bundled PRIVATE ${PULSE_INCLUDE_DIRS}) + target_include_directories(lib_tgvoip_bundled SYSTEM PRIVATE ${PULSE_INCLUDE_DIRS}) else() remove_target_sources(lib_tgvoip_bundled ${tgvoip_loc} os/linux/AudioOutputPulse.cpp diff --git a/Telegram/codegen b/Telegram/codegen index 18b6e547c..248614b49 160000 --- a/Telegram/codegen +++ b/Telegram/codegen @@ -1 +1 @@ -Subproject commit 18b6e547c970e8ba2e5f817df18f0d613a7b2d8f +Subproject commit 248614b49cd7d5aff69d75a737f2e35b79fbb119 diff --git a/Telegram/lib_base b/Telegram/lib_base index df2331b99..13f02ee5e 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit df2331b99693756b52008aa2628554ce1fe2f0d2 +Subproject commit 13f02ee5ef3c109f5bb447c14fdde3da9f8e70f7 diff --git a/Telegram/lib_crl b/Telegram/lib_crl index 16150bf71..3ccf2ed50 160000 --- a/Telegram/lib_crl +++ b/Telegram/lib_crl @@ -1 +1 @@ -Subproject commit 16150bf71d79382738114b913f137ec1a1a7630c +Subproject commit 3ccf2ed5095442e5874bba8852cb7dc4efeae29f diff --git a/Telegram/lib_lottie b/Telegram/lib_lottie index 71fecd909..0770df009 160000 --- a/Telegram/lib_lottie +++ b/Telegram/lib_lottie @@ -1 +1 @@ -Subproject commit 71fecd909b0d5553153ecb6803f03a91158aeefb +Subproject commit 0770df009db7928df1d0cad0900dc5110106d229 diff --git a/Telegram/lib_spellcheck b/Telegram/lib_spellcheck index 0a0097b9c..68c9b7889 160000 --- a/Telegram/lib_spellcheck +++ b/Telegram/lib_spellcheck @@ -1 +1 @@ -Subproject commit 0a0097b9c8b89257b9c78d962f780078f961c88b +Subproject commit 68c9b788958904aea7de79f986a0f82ec8c5b094 diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 2f8789f26..f206cb7bb 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 2f8789f265c93f2de4745102e9d0f14dbba688a5 +Subproject commit f206cb7bbb060e5b19ca85fddb5b6e0223f266d6 diff --git a/Telegram/lib_webrtc b/Telegram/lib_webrtc index 1ea86a387..4a722c1f2 160000 --- a/Telegram/lib_webrtc +++ b/Telegram/lib_webrtc @@ -1 +1 @@ -Subproject commit 1ea86a387b1bc4fb1374c53a098a749bf024f7e6 +Subproject commit 4a722c1f267b2491f8e9ef6200ae4ec61b46f397 diff --git a/Telegram/lib_webview b/Telegram/lib_webview index 87a002f9c..9ded693d9 160000 --- a/Telegram/lib_webview +++ b/Telegram/lib_webview @@ -1 +1 @@ -Subproject commit 87a002f9c746e83c14994098eee8e84ba22de2f2 +Subproject commit 9ded693d98ba55d18a36dcc3cc4db98b786ae258 diff --git a/cmake b/cmake index 5b39ef4b8..cbf0e4202 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 5b39ef4b82d6d0d08a71b669233d2c34d585a5ff +Subproject commit cbf0e420290319b6bd086d3403e5f30faabeee09