diff options
-rw-r--r-- | .SRCINFO | 243 | ||||
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | 0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch | 156 | ||||
-rw-r--r-- | 0002-Block-sponsored_messages.patch (renamed from block-sponsored_messages.patch) | 6 | ||||
-rw-r--r-- | 0003-Allow-downloading-and-copying-from-restricted-channels.patch | 52 | ||||
-rw-r--r-- | 101.patch | 21 | ||||
-rw-r--r-- | 326.patch | 23 | ||||
-rw-r--r-- | 333.patch | 62 | ||||
-rw-r--r-- | 334.patch | 119 | ||||
-rw-r--r-- | 335.patch | 97 | ||||
-rw-r--r-- | 337.patch | 52 | ||||
-rw-r--r-- | PKGBUILD | 504 | ||||
-rw-r--r-- | include.patch | 13 | ||||
-rw-r--r-- | kf594.patch | 57 | ||||
-rw-r--r-- | tg_owt-fix.patch | 49 |
15 files changed, 1112 insertions, 350 deletions
@@ -1,133 +1,166 @@ pkgbase = kotatogram-desktop - pkgdesc = Kotatogram – experimental Telegram Desktop fork - Stable version - pkgver = 1.4.8 - pkgrel = 2 - url = https://kotatogram.github.io + pkgdesc = Experimental fork of Telegram Desktop + pkgver = 1.4.9 + pkgrel = 1 + url = https://github.com/kotatogram/kotatogram-desktop arch = x86_64 license = GPL3 makedepends = cmake + makedepends = extra-cmake-modules makedepends = git + makedepends = meson + makedepends = microsoft-gsl makedepends = ninja + makedepends = pipewire + makedepends = plasma-wayland-protocols makedepends = python makedepends = range-v3 makedepends = tl-expected - makedepends = microsoft-gsl - makedepends = extra-cmake-modules - makedepends = webkit2gtk makedepends = unzip + makedepends = wayland-protocols + makedepends = webkit2gtk makedepends = yasm - makedepends = libtg_owt - depends = hunspell + depends = abseil-cpp depends = ffmpeg4.4 - depends = hicolor-icon-theme - depends = lz4 - depends = minizip - depends = openal - depends = ttf-opensans - depends = qt5-imageformats - depends = qt5-svg - depends = qt5-wayland - depends = libdbusmenu-qt5 - depends = xxhash - depends = kwayland + depends = gcc-libs + depends = glib2 + depends = glibc depends = glibmm - depends = rnnoise - depends = pipewire - depends = libxtst + depends = hicolor-icon-theme + depends = hunspell depends = jemalloc - depends = libxrandr - depends = abseil-cpp + depends = kwayland5 + depends = libdispatch depends = libjpeg-turbo - depends = opus - depends = openssl-1.1 - depends = libx11 + depends = libpipewire + depends = libsigc++ depends = libvpx + depends = libx11 + depends = libxcb depends = libxcomposite depends = libxdamage depends = libxext depends = libxfixes - depends = zlib + depends = libxrandr + depends = libxtst + depends = lz4 + depends = minizip + depends = openal + depends = opus + depends = qt5-imageformats + depends = qt5-svg + depends = qt5-wayland + depends = rnnoise + depends = ttf-opensans depends = wayland - depends = glibc - depends = libsigc++ - depends = glib2 depends = xcb-util-keysyms - depends = libxcb - depends = gcc-libs + depends = xxhash + depends = zlib optdepends = webkit2gtk: embedded browser features optdepends = xdg-desktop-portal: desktop integration provides = kotatogram-desktop - conflicts = kotatogram-desktop-bin - conflicts = kotatogram-desktop-dynamic-bin - conflicts = kotatogram-dev-git - conflicts = kotatogram-desktop-git - source = kotatogram-desktop::git+https://github.com/kotatogram/kotatogram-desktop.git#tag=k1.4.8 - source = kotatogram-desktop-libtgvoip::git+https://github.com/telegramdesktop/libtgvoip.git - source = kotatogram-desktop-GSL::git+https://github.com/Microsoft/GSL.git - source = kotatogram-desktop-Catch::git+https://github.com/philsquared/Catch - source = kotatogram-desktop-xxHash::git+https://github.com/Cyan4973/xxHash.git - source = kotatogram-desktop-rlottie::git+https://github.com/desktop-app/rlottie.git - source = kotatogram-desktop-lz4::git+https://github.com/lz4/lz4.git - source = kotatogram-desktop-lib_crl::git+https://github.com/desktop-app/lib_crl.git - source = kotatogram-desktop-lib_rpl::git+https://github.com/desktop-app/lib_rpl.git - source = kotatogram-desktop-lib_base::git+https://github.com/desktop-app/lib_base.git - source = kotatogram-desktop-codegen::git+https://github.com/desktop-app/codegen.git - source = kotatogram-desktop-lib_ui::git+https://github.com/kotatogram/lib_ui.git - source = kotatogram-desktop-lib_lottie::git+https://github.com/desktop-app/lib_lottie.git - source = kotatogram-desktop-lib_tl::git+https://github.com/desktop-app/lib_tl.git - source = kotatogram-desktop-lib_spellcheck::git+https://github.com/desktop-app/lib_spellcheck.git - source = kotatogram-desktop-lib_storage::git+https://github.com/desktop-app/lib_storage.git - source = kotatogram-desktop-cmake_helpers::git+https://github.com/kotatogram/cmake_helpers.git - source = kotatogram-desktop-expected::git+https://github.com/TartanLlama/expected.git - source = kotatogram-desktop-QR-Code-generator::git+https://github.com/nayuki/QR-Code-generator.git - source = kotatogram-desktop-lib_qr::git+https://github.com/desktop-app/lib_qr.git - source = kotatogram-desktop-libdbusmenu-qt::git+https://github.com/desktop-app/libdbusmenu-qt.git - source = kotatogram-desktop-hunspell::git+https://github.com/hunspell/hunspell.git - source = kotatogram-desktop-range-v3::git+https://github.com/ericniebler/range-v3.git - source = kotatogram-desktop-fcitx-qt5::git+https://github.com/fcitx/fcitx-qt5.git - source = kotatogram-desktop-nimf::git+https://github.com/hamonikr/nimf.git - source = kotatogram-desktop-hime::git+https://github.com/hime-ime/hime.git - source = kotatogram-desktop-fcitx5-qt::git+https://github.com/fcitx/fcitx5-qt.git - source = kotatogram-desktop-lib_webrtc::git+https://github.com/desktop-app/lib_webrtc.git - source = kotatogram-desktop-tgcalls::git+https://github.com/TelegramMessenger/tgcalls.git - source = kotatogram-desktop-lib_webview::git+https://github.com/desktop-app/lib_webview.git - source = kotatogram-desktop-lib_waylandshells::git+https://github.com/desktop-app/lib_waylandshells.git - source = kotatogram-desktop-jemalloc::git+https://github.com/jemalloc/jemalloc.git + conflicts = kotatogram-desktop + source = kotatogram-desktop::git+https://github.com/kotatogram/kotatogram-desktop.git#tag=k1.4.9 + source = include.patch + source = kf594.patch + source = https://patch-diff.githubusercontent.com/raw/kotatogram/kotatogram-desktop/pull/326.patch + source = https://patch-diff.githubusercontent.com/raw/kotatogram/kotatogram-desktop/pull/333.patch + source = https://patch-diff.githubusercontent.com/raw/kotatogram/kotatogram-desktop/pull/334.patch + source = https://patch-diff.githubusercontent.com/raw/kotatogram/kotatogram-desktop/pull/335.patch + source = https://patch-diff.githubusercontent.com/raw/kotatogram/kotatogram-desktop/pull/337.patch + source = kotatogram-tg_owt::git+https://github.com/desktop-app/tg_owt.git#commit=63a934db1ed212ebf8aaaa20f0010dd7b0d7b396 + source = https://patch-diff.githubusercontent.com/raw/desktop-app/tg_owt/pull/101.patch + source = tg_owt-fix.patch source = 0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch - source = block-sponsored_messages.patch - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = SKIP - b2sums = 462900e97b9d7a9d40bc02d3dc7dacd3060cc19af02135065628e38e83835a2fb438581ca78001aaffc27d8b0473a78d39509c35f50e4ebb25607fe9c6bae264 - b2sums = 1e2705008ea8cef1a5c46793a6115ba0f35f77529d18ea04a03e5a0e89980916d78d49a9aa86863b1a0b440debb650262ceb3c9d68600ffe6e5c98fd65804526 + source = 0002-Block-sponsored_messages.patch + source = 0003-Allow-downloading-and-copying-from-restricted-channels.patch + source = apple.swift-corelibs-libdispatch::git+https://github.com/apple/swift-corelibs-libdispatch.git + source = cyan4973.xxhash::git+https://github.com/Cyan4973/xxHash.git + source = desktop-app.codegen::git+https://github.com/desktop-app/codegen.git + source = desktop-app.lib_base::git+https://github.com/desktop-app/lib_base.git + source = desktop-app.lib_crl::git+https://github.com/desktop-app/lib_crl.git + source = desktop-app.lib_lottie::git+https://github.com/desktop-app/lib_lottie.git + source = desktop-app.lib_qr::git+https://github.com/desktop-app/lib_qr.git + source = desktop-app.lib_rpl::git+https://github.com/desktop-app/lib_rpl.git + source = desktop-app.lib_spellcheck::git+https://github.com/desktop-app/lib_spellcheck.git + source = desktop-app.lib_storage::git+https://github.com/desktop-app/lib_storage.git + source = desktop-app.lib_tl::git+https://github.com/desktop-app/lib_tl.git + source = desktop-app.lib_waylandshells::git+https://github.com/desktop-app/lib_waylandshells.git + source = desktop-app.lib_webrtc::git+https://github.com/desktop-app/lib_webrtc.git + source = desktop-app.lib_webview::git+https://github.com/desktop-app/lib_webview.git + source = desktop-app.rlottie::git+https://github.com/desktop-app/rlottie.git + source = ericniebler.range-v3::git+https://github.com/ericniebler/range-v3.git + source = fcitx.fcitx-qt5::git+https://github.com/fcitx/fcitx-qt5.git + source = fcitx.fcitx5-qt::git+https://github.com/fcitx/fcitx5-qt.git + source = gitlab-freedesktop-mirrors.wayland-protocols::git+https://github.com/gitlab-freedesktop-mirrors/wayland-protocols.git + source = hamonikr.nimf::git+https://github.com/hamonikr/nimf.git + source = hime-ime.hime::git+https://github.com/hime-ime/hime.git + source = hunspell::git+https://github.com/hunspell/hunspell.git + source = jemalloc::git+https://github.com/jemalloc/jemalloc.git + source = kde.extra-cmake-modules::git+https://github.com/KDE/extra-cmake-modules.git + source = kde.kwayland::git+https://github.com/KDE/kwayland.git + source = kde.plasma-wayland-protocols::git+https://github.com/KDE/plasma-wayland-protocols.git + source = kotatogram.cmake_helpers::git+https://github.com/kotatogram/cmake_helpers.git + source = kotatogram.lib_ui::git+https://github.com/kotatogram/lib_ui.git + source = lz4::git+https://github.com/lz4/lz4.git + source = microsoft.gsl::git+https://github.com/Microsoft/GSL.git + source = nayuki.qr-code-generator::git+https://github.com/nayuki/QR-Code-generator.git + source = tartanllama.expected::git+https://github.com/TartanLlama/expected.git + source = telegramdesktop.libtgvoip::git+https://github.com/telegramdesktop/libtgvoip.git + source = telegrammessenger.tgcalls::git+https://github.com/TelegramMessenger/tgcalls.git + source = desktop-app.cmake_helpers::git+https://github.com/desktop-app/cmake_helpers.git + source = chromiumsrc.libyuv::git+https://gitlab.com/chromiumsrc/libyuv.git + source = pipewire::git+https://github.com/PipeWire/pipewire.git + sha256sums = SKIP + sha256sums = 133cde2fb9e1b5f837396e487783adf5e1899e20d335f1654a71e6ef1121918c + sha256sums = 25160a4a687b0032151f5c7a295996e4322b5c9ed1122dfa6c3985d57e866b2c + sha256sums = 289b69c980fe4877ab94d3b68180e586ffabecd15c4205f008fe21498d12f7ee + sha256sums = d27016d67bd0baf5eb7c49ce1a0658e584d3892c344edde38843ca39a1d63a42 + sha256sums = 533576f87db701100b2fda4b4ccbbb9957234d86447960a7c6b1dd07c8830d19 + sha256sums = 26bd7d7e683dbf8d3fc7675afafac3fa3a140c21ca9087c8c98241a9041b981c + sha256sums = b794229b2b2cec355219fe6d33dba1efd782dc9ad53c50ab90f5f682db370bea + sha256sums = SKIP + sha256sums = f4d26c1048a7fd1ac3419042009c3b52c001458e44309a765d42d7df9f45f1ef + sha256sums = 8d3a1c4b2e40eef7a4cc8e6f498c416af47a91b878ec3762b51476e89695cb13 + sha256sums = 639b0b659685ff11daee21efd0ca0e473ee1cfb533709ea8ecf357945e058f43 + sha256sums = 229c85f7fe86c11139b4d6b4fd44086d737e25ac94c89302aabe09eedb436f7e + sha256sums = bb2aa0ec20d9769a513a41033a7f00baf08afd7a40c710431576d0f8b3a27a0e + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP pkgname = kotatogram-desktop diff --git a/.gitignore b/.gitignore index 686b60ee601e..018a3de08144 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -kotatogram-desktop* -pipewire -pkg/ -src/ +* +!PKGBUILD +!.SRCINFO +!.gitignore diff --git a/0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch b/0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch index c409e1481e36..5698362efc4d 100644 --- a/0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch +++ b/0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch @@ -1,4 +1,4 @@ -From 1a636ab4e3dce29a08a32c5282441076fa199f23 Mon Sep 17 00:00:00 2001 +From 51ec84e88a3c60d6ba65ba2400d76eea97ef7745 Mon Sep 17 00:00:00 2001 From: Ilya Fedin <fedin-ilja2010@ya.ru> Date: Sun, 14 Jun 2020 03:25:53 +0400 Subject: [PATCH] Add an option to hide messages from blocked users in groups @@ -6,18 +6,16 @@ Subject: [PATCH] Add an option to hide messages from blocked users in groups --- Telegram/Resources/langs/rewrites/en.json | 1 + Telegram/Resources/langs/rewrites/ru.json | 1 + - .../history/history_item_components.cpp | 7 +++- - .../SourceFiles/history/history_widget.cpp | 29 ++++++++++++++ + .../history/history_item_components.cpp | 9 ++++- + .../SourceFiles/history/history_widget.cpp | 30 ++++++++++++++ .../history/view/history_view_element.cpp | 7 ++++ - Telegram/SourceFiles/kotato/json_settings.cpp | 5 +++ - Telegram/SourceFiles/kotato/settings.cpp | 11 +++++ - Telegram/SourceFiles/kotato/settings.h | 4 ++ - Telegram/SourceFiles/kotato/settings_menu.cpp | 1 + + .../SourceFiles/kotato/kotato_settings.cpp | 3 ++ + .../kotato/kotato_settings_menu.cpp | 1 + Telegram/SourceFiles/main/main_session.cpp | 40 +++++++++++++++++++ - 10 files changed, 104 insertions(+), 2 deletions(-) + 8 files changed, 90 insertions(+), 2 deletions(-) diff --git a/Telegram/Resources/langs/rewrites/en.json b/Telegram/Resources/langs/rewrites/en.json -index 846807a44..3d3f8205d 100644 +index e50ac3e25..bd67e4d27 100644 --- a/Telegram/Resources/langs/rewrites/en.json +++ b/Telegram/Resources/langs/rewrites/en.json @@ -167,6 +167,7 @@ @@ -29,7 +27,7 @@ index 846807a44..3d3f8205d 100644 "ktg_settings_forward_retain_selection": "Retain selection after forward", "ktg_settings_forward_chat_on_click": "Open chat on click", diff --git a/Telegram/Resources/langs/rewrites/ru.json b/Telegram/Resources/langs/rewrites/ru.json -index be0be9f7e..e8085cb45 100644 +index 5f4c7e775..cb1509722 100644 --- a/Telegram/Resources/langs/rewrites/ru.json +++ b/Telegram/Resources/langs/rewrites/ru.json @@ -167,6 +167,7 @@ @@ -41,10 +39,18 @@ index be0be9f7e..e8085cb45 100644 "ktg_settings_forward_retain_selection": "Сохранять выделение после пересылки", "ktg_settings_forward_chat_on_click": "Открывать чат по клику", diff --git a/Telegram/SourceFiles/history/history_item_components.cpp b/Telegram/SourceFiles/history/history_item_components.cpp -index 563cc4bcf..6535a7ba9 100644 +index 09e2fe34e..1939d3570 100644 --- a/Telegram/SourceFiles/history/history_item_components.cpp +++ b/Telegram/SourceFiles/history/history_item_components.cpp -@@ -355,7 +355,10 @@ void HistoryMessageReply::paint( +@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + */ + #include "history/history_item_components.h" + ++#include "kotato/kotato_settings.h" + #include "kotato/kotato_lang.h" + #include "base/qt/qt_key_modifiers.h" + #include "lang/lang_keys.h" +@@ -334,7 +335,11 @@ void HistoryMessageReply::paint( p.fillRect(rbar, bar); if (w > st::msgReplyBarSkip) { @@ -52,28 +58,30 @@ index 563cc4bcf..6535a7ba9 100644 + auto blocked = replyToMsg + && replyToMsg->from()->isUser() + && replyToMsg->from()->asUser()->isBlocked(); -+ if (replyToMsg && (!blocked || !BlockUsersInGroups())) { ++ const auto blockUsersInGroups = ::Kotato::JsonSettings::GetBool("block_users_in_groups"); ++ if (replyToMsg && (!blocked || !blockUsersInGroups)) { auto hasPreview = replyToMsg->media() ? replyToMsg->media()->hasReplyPreview() : false; if (hasPreview && w < st::msgReplyBarSkip + st::msgReplyBarSize.height()) { hasPreview = false; -@@ -402,7 +405,7 @@ void HistoryMessageReply::paint( +@@ -380,7 +385,7 @@ void HistoryMessageReply::paint( p.setPen(inBubble ? stm->msgDateFg : st->msgDateImgFg()); - p.drawTextLeft(x + st::msgReplyBarSkip, y + st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2, w + 2 * x, st::msgDateFont->elided(replyToMsgId ? tr::lng_profile_loading(tr::now) : tr::lng_deleted_message(tr::now), w - st::msgReplyBarSkip)); -+ p.drawTextLeft(x + st::msgReplyBarSkip, y + st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2, w + 2 * x, st::msgDateFont->elided((replyToMsgId && (!blocked || !BlockUsersInGroups())) ? tr::lng_profile_loading(tr::now) : tr::lng_deleted_message(tr::now), w - st::msgReplyBarSkip)); ++ p.drawTextLeft(x + st::msgReplyBarSkip, y + st::msgReplyPadding.top() + (st::msgReplyBarSize.height() - st::msgDateFont->height) / 2, w + 2 * x, st::msgDateFont->elided((replyToMsgId && (!blocked || !blockUsersInGroups)) ? tr::lng_profile_loading(tr::now) : tr::lng_deleted_message(tr::now), w - st::msgReplyBarSkip)); } } } diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp -index 4324c7edc..8466e0055 100644 +index c09939134..79e020277 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp -@@ -641,6 +641,35 @@ HistoryWidget::HistoryWidget( +@@ -682,6 +682,36 @@ HistoryWidget::HistoryWidget( }); }, lifetime()); -+ BlockUsersInGroupsChanges( ++ ::Kotato::JsonSettings::Events( ++ "block_users_in_groups" + ) | rpl::start_with_next([=] { + crl::on_main(this, [=] { + if (_history) { @@ -102,26 +110,26 @@ index 4324c7edc..8466e0055 100644 + }); + }, lifetime()); + - HoverEmojiPanelChanges( - ) | rpl::start_with_next([=] { - crl::on_main(this, [=] { + session().data().animationPlayInlineRequest( + ) | rpl::start_with_next([=](not_null<HistoryItem*> item) { + if (const auto view = item->mainView()) { diff --git a/Telegram/SourceFiles/history/view/history_view_element.cpp b/Telegram/SourceFiles/history/view/history_view_element.cpp -index e588bdb92..ee8133474 100644 +index f6938da0c..975d502ae 100644 --- a/Telegram/SourceFiles/history/view/history_view_element.cpp +++ b/Telegram/SourceFiles/history/view/history_view_element.cpp -@@ -28,6 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +@@ -35,6 +35,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/toast/toast.h" #include "ui/toasts/common_toasts.h" #include "data/data_session.h" +#include "data/data_user.h" #include "data/data_groups.h" #include "data/data_media_types.h" - #include "lang/lang_keys.h" -@@ -477,6 +478,12 @@ bool Element::isHiddenByGroup() const { + #include "data/data_sponsored_messages.h" +@@ -521,6 +522,12 @@ bool Element::isHiddenByGroup() const { } bool Element::isHidden() const { -+ if (BlockUsersInGroups() ++ if (::Kotato::JsonSettings::GetBool("block_users_in_groups") + && data()->from()->isUser() + && data()->from()->asUser()->isBlocked()) { + return true; @@ -130,80 +138,34 @@ index e588bdb92..ee8133474 100644 return isHiddenByGroup(); } -diff --git a/Telegram/SourceFiles/kotato/json_settings.cpp b/Telegram/SourceFiles/kotato/json_settings.cpp -index 7b1fab50a..37f657bd4 100644 ---- a/Telegram/SourceFiles/kotato/json_settings.cpp -+++ b/Telegram/SourceFiles/kotato/json_settings.cpp -@@ -366,6 +366,7 @@ QByteArray GenerateSettingsJson(bool areDefault = false) { - settings.insert(qsl("sticker_scale_both"), StickerScaleBoth()); - settings.insert(qsl("adaptive_bubbles"), AdaptiveBubbles()); - settings.insert(qsl("big_emoji_outline"), BigEmojiOutline()); -+ settings.insert(qsl("block_users_in_groups"), BlockUsersInGroups()); - settings.insert(qsl("always_show_scheduled"), cAlwaysShowScheduled()); - settings.insert(qsl("show_chat_id"), ShowChatId()); - settings.insert(qsl("show_phone_in_drawer"), cShowPhoneInDrawer()); -@@ -529,6 +530,10 @@ bool Manager::readCustomFile() { - SetBigEmojiOutline(v); - }); - -+ ReadBoolOption(settings, "block_users_in_groups", [&](auto v) { -+ SetBlockUsersInGroups(v); -+ }); -+ - ReadBoolOption(settings, "always_show_scheduled", [&](auto v) { - cSetAlwaysShowScheduled(v); - }); -diff --git a/Telegram/SourceFiles/kotato/settings.cpp b/Telegram/SourceFiles/kotato/settings.cpp -index e073d96f6..0b2dd5241 100644 ---- a/Telegram/SourceFiles/kotato/settings.cpp -+++ b/Telegram/SourceFiles/kotato/settings.cpp -@@ -79,6 +79,17 @@ rpl::producer<bool> MonospaceLargeBubblesChanges() { - return gMonospaceLargeBubbles.changes(); - } - -+rpl::variable<bool> gBlockUsersInGroups = false; -+void SetBlockUsersInGroups(bool enabled) { -+ gBlockUsersInGroups = enabled; -+} -+bool BlockUsersInGroups() { -+ return gBlockUsersInGroups.current(); -+} -+rpl::producer<bool> BlockUsersInGroupsChanges() { -+ return gBlockUsersInGroups.changes(); -+} -+ - bool gAlwaysShowScheduled = false; - - rpl::variable<int> gShowChatId = 2; -diff --git a/Telegram/SourceFiles/kotato/settings.h b/Telegram/SourceFiles/kotato/settings.h -index 6d3a82d9d..dcc98b319 100644 ---- a/Telegram/SourceFiles/kotato/settings.h -+++ b/Telegram/SourceFiles/kotato/settings.h -@@ -62,6 +62,10 @@ void SetMonospaceLargeBubbles(bool enabled); - [[nodiscard]] bool MonospaceLargeBubbles(); - [[nodiscard]] rpl::producer<bool> MonospaceLargeBubblesChanges(); - -+void SetBlockUsersInGroups(bool enabled); -+[[nodiscard]] bool BlockUsersInGroups(); -+[[nodiscard]] rpl::producer<bool> BlockUsersInGroupsChanges(); -+ - DeclareSetting(bool, AlwaysShowScheduled); - - void SetShowChatId(int chatIdType); -diff --git a/Telegram/SourceFiles/kotato/settings_menu.cpp b/Telegram/SourceFiles/kotato/settings_menu.cpp -index 6c9ab475b..d7760b729 100644 ---- a/Telegram/SourceFiles/kotato/settings_menu.cpp -+++ b/Telegram/SourceFiles/kotato/settings_menu.cpp -@@ -444,6 +444,7 @@ void SetupKotatoMessages(not_null<Ui::VerticalLayout*> container) { +diff --git a/Telegram/SourceFiles/kotato/kotato_settings.cpp b/Telegram/SourceFiles/kotato/kotato_settings.cpp +index 9b0513d82..ebceb4f8f 100644 +--- a/Telegram/SourceFiles/kotato/kotato_settings.cpp ++++ b/Telegram/SourceFiles/kotato/kotato_settings.cpp +@@ -326,6 +326,9 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap { + { "big_emoji_outline", { + .type = SettingType::BoolSetting, + .defaultValue = true, }}, ++ { "block_users_in_groups", { ++ .type = SettingType::BoolSetting, ++ .defaultValue = true, }}, + { "sticker_height", { + .type = SettingType::IntSetting, + .defaultValue = 170, +diff --git a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp +index 88249d0d3..73ef1f8a2 100644 +--- a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp ++++ b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp +@@ -472,6 +472,7 @@ void SetupKotatoMessages(not_null<Ui::VerticalLayout*> container) { } - SettingsMenuSwitch(ktg_settings_emoji_outline, BigEmojiOutline); -+ SettingsMenuSwitch(ktg_settings_block_users_in_groups, BlockUsersInGroups); + SettingsMenuJsonSwitch(ktg_settings_emoji_outline, big_emoji_outline); ++ SettingsMenuJsonSwitch(ktg_settings_block_users_in_groups, block_users_in_groups); AddSkip(container); } diff --git a/Telegram/SourceFiles/main/main_session.cpp b/Telegram/SourceFiles/main/main_session.cpp -index 99e02e2aa..40d4f8fa1 100644 +index 084137b82..cf882a238 100644 --- a/Telegram/SourceFiles/main/main_session.cpp +++ b/Telegram/SourceFiles/main/main_session.cpp @@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL @@ -214,7 +176,7 @@ index 99e02e2aa..40d4f8fa1 100644 #include "main/main_account.h" #include "main/main_domain.h" #include "main/main_session_settings.h" -@@ -61,6 +62,43 @@ constexpr auto kTmpPasswordReserveTime = TimeId(10); +@@ -68,6 +69,43 @@ constexpr auto kTmpPasswordReserveTime = TimeId(10); return MTP::ConfigFields().internalLinksDomain; } @@ -258,7 +220,7 @@ index 99e02e2aa..40d4f8fa1 100644 } // namespace Session::Session( -@@ -149,6 +187,8 @@ Session::Session( +@@ -158,6 +196,8 @@ Session::Session( _api->requestNotifySettings(MTP_inputNotifyUsers()); _api->requestNotifySettings(MTP_inputNotifyChats()); _api->requestNotifySettings(MTP_inputNotifyBroadcasts()); @@ -268,5 +230,5 @@ index 99e02e2aa..40d4f8fa1 100644 void Session::setTmpPassword(const QByteArray &password, TimeId validUntil) { -- -2.33.1 +2.35.1 diff --git a/block-sponsored_messages.patch b/0002-Block-sponsored_messages.patch index f3640501fbe5..4ccdd789f4e8 100644 --- a/block-sponsored_messages.patch +++ b/0002-Block-sponsored_messages.patch @@ -4,10 +4,10 @@ index 1dc5b49..91cba9c 100644 +++ b/Telegram/SourceFiles/data/data_sponsored_messages.cpp @@ -93,7 +93,7 @@ bool SponsoredMessages::append(not_null<History*> history) { } - + bool SponsoredMessages::canHaveFor(not_null<History*> history) const { -- return history->isChannel(); +- return history->peer->isChannel(); + return false; } - + void SponsoredMessages::request(not_null<History*> history) { diff --git a/0003-Allow-downloading-and-copying-from-restricted-channels.patch b/0003-Allow-downloading-and-copying-from-restricted-channels.patch new file mode 100644 index 000000000000..cf96c089c286 --- /dev/null +++ b/0003-Allow-downloading-and-copying-from-restricted-channels.patch @@ -0,0 +1,52 @@ +diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp +index eedcd4cb6..efe87ce59 100644 +--- a/Telegram/SourceFiles/history/history_inner_widget.cpp ++++ b/Telegram/SourceFiles/history/history_inner_widget.cpp +@@ -2314,6 +2314,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { + } + + bool HistoryInner::hasCopyRestriction(HistoryItem *item) const { ++ return false; + return !_peer->allowsForwarding() || (item && item->forbidsForward()); + } + +@@ -2330,6 +2331,7 @@ bool HistoryInner::showCopyRestriction(HistoryItem *item) { + } + + bool HistoryInner::hasCopyRestrictionForSelected() const { ++ return false; + if (hasCopyRestriction()) { + return true; + } +diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +index 87b8611f7..b0cfc7670 100644 +--- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp ++++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +@@ -1218,6 +1218,7 @@ bool ListWidget::isEmpty() const { + } + + bool ListWidget::hasCopyRestriction(HistoryItem *item) const { ++ return false; + return _delegate->listCopyRestrictionType(item) + != CopyRestrictionType::None; + } +@@ -1236,6 +1237,7 @@ bool ListWidget::showCopyRestriction(HistoryItem *item) { + } + + bool ListWidget::hasCopyRestrictionForSelected() const { ++ return false; + if (hasCopyRestriction()) { + return true; + } +diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +index 6b77cfefe..75ceb075d 100644 +--- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp ++++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +@@ -560,6 +560,7 @@ QSize OverlayWidget::flipSizeByRotation(QSize size) const { + } + + bool OverlayWidget::hasCopyRestriction() const { ++ return false; + return (_history && !_history->peer->allowsForwarding()) + || (_message && _message->forbidsForward()); + } diff --git a/101.patch b/101.patch new file mode 100644 index 000000000000..cb21f1bd0e05 --- /dev/null +++ b/101.patch @@ -0,0 +1,21 @@ +From 86d2bcd7afb8706663d29e30f65863de5a626142 Mon Sep 17 00:00:00 2001 +From: Xiretza <xiretza@xiretza.xyz> +Date: Sun, 15 May 2022 12:47:41 +0200 +Subject: [PATCH] fix(h265_pps_parser): fix missing cstdint include + +--- + src/common_video/h265/h265_pps_parser.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/common_video/h265/h265_pps_parser.h b/src/common_video/h265/h265_pps_parser.h +index 28c95ea9b..c180b1b9f 100644 +--- a/src/common_video/h265/h265_pps_parser.h ++++ b/src/common_video/h265/h265_pps_parser.h +@@ -12,6 +12,7 @@ + #define COMMON_VIDEO_H265_PPS_PARSER_H_ + + #include "absl/types/optional.h" ++#include <cstdint> + + namespace rtc { + class BitBuffer; diff --git a/326.patch b/326.patch new file mode 100644 index 000000000000..8555cc2bdf87 --- /dev/null +++ b/326.patch @@ -0,0 +1,23 @@ +From 39bfd4d1603141e196bb8d3d64a50083f20dbcbc Mon Sep 17 00:00:00 2001 +From: blank X <blankie@nixnetmail.com> +Date: Thu, 3 Mar 2022 09:38:03 +0700 +Subject: [PATCH] Remember compress images by default + +Regression introduced in 845957f33aea4aac7038a9fac0e5e6321b13fcb6 +--- + Telegram/SourceFiles/kotato/kotato_settings.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Telegram/SourceFiles/kotato/kotato_settings.cpp b/Telegram/SourceFiles/kotato/kotato_settings.cpp +index 9b0513d82d..db3362e1c3 100644 +--- a/Telegram/SourceFiles/kotato/kotato_settings.cpp ++++ b/Telegram/SourceFiles/kotato/kotato_settings.cpp +@@ -461,7 +461,7 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap { + .defaultValue = false, }}, + { "remember_compress_images", { + .type = SettingType::BoolSetting, +- .defaultValue = false, }}, ++ .defaultValue = true, }}, + { "view_profile_on_top", { + .type = SettingType::BoolSetting, + .defaultValue = false, }}, diff --git a/333.patch b/333.patch new file mode 100644 index 000000000000..c101e314b267 --- /dev/null +++ b/333.patch @@ -0,0 +1,62 @@ +From 7ef51f18c966b29d56b4af7cb3edc83bcc7efc2f Mon Sep 17 00:00:00 2001 +From: blank X <blankie@nixnetmail.com> +Date: Sat, 12 Mar 2022 20:11:26 +0700 +Subject: [PATCH] Fix account hotkey when accounts are reordered + +--- + .../dialogs/dialogs_inner_widget.cpp | 28 +++++++++++++++++-- + 1 file changed, 25 insertions(+), 3 deletions(-) + +diff --git a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +index df918d584d..aa10524e0b 100644 +--- a/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp ++++ b/Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp +@@ -103,6 +103,28 @@ int PinnedDialogsCount( + return result; + } + ++// Duplicated code from window/window_main_menu.cpp ++[[nodiscard]] std::vector<not_null<Main::Account*>> OrderedAccounts() { ++ const auto order = Core::App().settings().accountsOrder(); ++ auto accounts = ranges::views::all( ++ Core::App().domain().accounts() ++ ) | ranges::views::transform([](const Main::Domain::AccountWithIndex &a) { ++ return not_null{ a.account.get() }; ++ }) | ranges::to_vector; ++ ranges::stable_sort(accounts, [&]( ++ not_null<Main::Account*> a, ++ not_null<Main::Account*> b) { ++ const auto aIt = a->sessionExists() ++ ? ranges::find(order, a->session().uniqueId()) ++ : end(order); ++ const auto bIt = b->sessionExists() ++ ? ranges::find(order, b->session().uniqueId()) ++ : end(order); ++ return aIt < bIt; ++ }); ++ return accounts; ++} ++ + } // namespace + + struct InnerWidget::CollapsedRow { +@@ -3174,8 +3196,8 @@ void InnerWidget::setupShortcuts() { + } + } + +- const auto accounts = &Core::App().domain().accounts(); +- if (const auto accountsCount = int(accounts->size())) { ++ const auto accounts = OrderedAccounts(); ++ if (const auto accountsCount = int(accounts.size())) { + auto &&accountShortcuts = ranges::views::zip( + Shortcuts::kShowAccount, + ranges::views::ints(0, ranges::unreachable)); +@@ -3186,7 +3208,7 @@ void InnerWidget::setupShortcuts() { + : std::clamp(index, 0, accountsCount - 1); + request->check(command) && request->handle([=] { + if (select <= accountsCount) { +- const auto account = (*accounts)[select].account.get(); ++ const auto account = accounts[select]; + if (account != &Core::App().domain().active()) { + Core::App().domain().maybeActivate(account); + } diff --git a/334.patch b/334.patch new file mode 100644 index 000000000000..98a67e2abfcb --- /dev/null +++ b/334.patch @@ -0,0 +1,119 @@ +From d95b85c16af87f35ba5489277a7e46402fe72b48 Mon Sep 17 00:00:00 2001 +From: blank X <blankie@nixnetmail.com> +Date: Sat, 12 Mar 2022 21:26:49 +0700 +Subject: [PATCH] Add option to disable short info box + +Fixes #332 +--- + Telegram/Resources/langs/rewrites/en.json | 1 + + Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp | 3 ++- + Telegram/SourceFiles/boxes/peers/edit_peer_requests_box.cpp | 5 +++++ + .../history/view/reactions/message_reactions_list.cpp | 5 +++++ + Telegram/SourceFiles/kotato/kotato_settings.cpp | 3 +++ + Telegram/SourceFiles/kotato/kotato_settings_menu.cpp | 1 + + 6 files changed, 17 insertions(+), 1 deletion(-) + +diff --git a/Telegram/Resources/langs/rewrites/en.json b/Telegram/Resources/langs/rewrites/en.json +index e50ac3e253..3d6481d69e 100644 +--- a/Telegram/Resources/langs/rewrites/en.json ++++ b/Telegram/Resources/langs/rewrites/en.json +@@ -274,5 +274,6 @@ + "ktg_settings_view_profile_on_top_about": "This option also enables \"Add \"View Profile\"\" from TDesktop's experimental settings.", + "ktg_settings_emoji_sidebar": "Enable emoji sidebar", + "ktg_settings_emoji_sidebar_right_click": "Emoji sidebar on right click", ++ "ktg_settings_disable_short_info_box": "Disable short info box", + "dummy_last_string": "" + } +diff --git a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp +index 83bf0fb6fb..9b0d9119e5 100644 +--- a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp ++++ b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp +@@ -7,6 +7,7 @@ For license and copyright information please follow this link: + */ + #include "boxes/peers/edit_participants_box.h" + ++#include "kotato/kotato_settings.h" + #include "kotato/kotato_lang.h" + #include "api/api_chat_participants.h" + #include "boxes/peer_list_controllers.h" +@@ -1495,7 +1496,7 @@ void ParticipantsBoxController::rowClicked(not_null<PeerListRow*> row) { + showRestricted(user); + } else { + Assert(_navigation != nullptr); +- if (_role != Role::Profile) { ++ if (_role != Role::Profile && !::Kotato::JsonSettings::GetBool("disable_short_info_box")) { + _navigation->parentController()->show(PrepareShortInfoBox( + participant, + _navigation)); +diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_requests_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_requests_box.cpp +index 02370e74a9..f64254e4dd 100644 +--- a/Telegram/SourceFiles/boxes/peers/edit_peer_requests_box.cpp ++++ b/Telegram/SourceFiles/boxes/peers/edit_peer_requests_box.cpp +@@ -7,6 +7,7 @@ For license and copyright information please follow this link: + */ + #include "boxes/peers/edit_peer_requests_box.h" + ++#include "kotato/kotato_settings.h" + #include "ui/effects/ripple_animation.h" + #include "boxes/peer_list_controllers.h" + #include "boxes/peers/edit_participants_box.h" // SubscribeToMigration +@@ -355,6 +356,10 @@ void RequestsBoxController::refreshDescription() { + } + + void RequestsBoxController::rowClicked(not_null<PeerListRow*> row) { ++ if (::Kotato::JsonSettings::GetBool("disable_short_info_box")) { ++ _navigation->showPeerInfo(row->peer()); ++ return; ++ } + _navigation->parentController()->show(PrepareShortInfoBox( + row->peer(), + _navigation)); +diff --git a/Telegram/SourceFiles/history/view/reactions/message_reactions_list.cpp b/Telegram/SourceFiles/history/view/reactions/message_reactions_list.cpp +index a5f6e67991..8731933996 100644 +--- a/Telegram/SourceFiles/history/view/reactions/message_reactions_list.cpp ++++ b/Telegram/SourceFiles/history/view/reactions/message_reactions_list.cpp +@@ -7,6 +7,7 @@ For license and copyright information please follow this link: + */ + #include "history/view/reactions/message_reactions_list.h" + ++#include "kotato/kotato_settings.h" + #include "history/view/reactions/message_reactions_selector.h" + #include "boxes/peer_list_box.h" + #include "boxes/peers/prepare_short_info_box.h" +@@ -284,6 +285,10 @@ void Controller::rowClicked(not_null<PeerListRow*> row) { + const auto window = _window; + const auto peer = row->peer(); + crl::on_main(window, [=] { ++ if (::Kotato::JsonSettings::GetBool("disable_short_info_box")) { ++ window->showPeerInfo(peer); ++ return; ++ } + window->show(PrepareShortInfoBox(peer, window)); + }); + } +diff --git a/Telegram/SourceFiles/kotato/kotato_settings.cpp b/Telegram/SourceFiles/kotato/kotato_settings.cpp +index 9b0513d82d..28640c00fa 100644 +--- a/Telegram/SourceFiles/kotato/kotato_settings.cpp ++++ b/Telegram/SourceFiles/kotato/kotato_settings.cpp +@@ -471,6 +471,9 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap { + { "emoji_sidebar_right_click", { + .type = SettingType::BoolSetting, + .defaultValue = false, }}, ++ { "disable_short_info_box", { ++ .type = SettingType::BoolSetting, ++ .defaultValue = false, }}, + }; + + using OldOptionKey = QString; +diff --git a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp +index 88249d0d37..2f65eb3f4b 100644 +--- a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp ++++ b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp +@@ -770,6 +770,7 @@ void SetupKotatoOther( + }); + + SettingsMenuJsonSwitch(ktg_settings_call_confirm, confirm_before_calls); ++ SettingsMenuJsonSwitch(ktg_settings_disable_short_info_box, disable_short_info_box); + SettingsMenuJsonSwitch(ktg_settings_remember_compress_images, remember_compress_images); + AddButton( + container, diff --git a/335.patch b/335.patch new file mode 100644 index 000000000000..1d68335ea8f5 --- /dev/null +++ b/335.patch @@ -0,0 +1,97 @@ +From 3037bd0c42ec17d1c07ac22e3c039ef2400e1708 Mon Sep 17 00:00:00 2001 +From: blank X <blankie@nixnetmail.com> +Date: Mon, 14 Mar 2022 11:26:43 +0700 +Subject: [PATCH] Fix scaling webm stickers + +--- + .../SourceFiles/history/history_widget.cpp | 18 ++++++++++++++++-- + .../history/view/media/history_view_gif.cpp | 2 +- + .../view/media/history_view_sticker.cpp | 13 ++++++------- + 3 files changed, 23 insertions(+), 10 deletions(-) + +diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp +index c09939134c..6024229b1f 100644 +--- a/Telegram/SourceFiles/history/history_widget.cpp ++++ b/Telegram/SourceFiles/history/history_widget.cpp +@@ -640,7 +640,14 @@ HistoryWidget::HistoryWidget( + "sticker_height" + ) | rpl::start_with_next([=] { + crl::on_main(this, [=] { +- updateHistoryGeometry(); ++ if (_history) { ++ _history->forceFullResize(); ++ if (_migrated) { ++ _migrated->forceFullResize(); ++ } ++ updateHistoryGeometry(); ++ update(); ++ } + }); + }, lifetime()); + +@@ -648,7 +655,14 @@ HistoryWidget::HistoryWidget( + "sticker_scale_both" + ) | rpl::start_with_next([=] { + crl::on_main(this, [=] { +- updateHistoryGeometry(); ++ if (_history) { ++ _history->forceFullResize(); ++ if (_migrated) { ++ _migrated->forceFullResize(); ++ } ++ updateHistoryGeometry(); ++ update(); ++ } + }); + }, lifetime()); + +diff --git a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp +index f16bc34107..b3c97907d5 100644 +--- a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp ++++ b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp +@@ -139,7 +139,7 @@ QSize Gif::countThumbSize(int &inOutWidthMax) const { + + st::msgPadding.right() + : 0; + const auto maxSize = _data->sticker() +- ? Sticker::Size().width() ++ ? Sticker::Size().height() + : _data->isVideoFile() + ? st::maxMediaSize + : _data->isVideoMessage() +diff --git a/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp b/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp +index 80793ce6ef..1f5554faef 100644 +--- a/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp ++++ b/Telegram/SourceFiles/history/view/media/history_view_sticker.cpp +@@ -95,17 +95,13 @@ bool Sticker::isEmojiSticker() const { + } + + void Sticker::initSize() { +- const auto currentStickerHeight = ::Kotato::JsonSettings::GetInt("sticker_height"); +- const auto currentScaleBoth = ::Kotato::JsonSettings::GetBool("sticker_scale_both"); +- const auto maxHeight = int(st::maxStickerSize / 256.0 * currentStickerHeight); +- const auto maxWidth = currentScaleBoth ? maxHeight : st::maxStickerSize; + if (isEmojiSticker() || _diceIndex >= 0) { + _size = Sticker::EmojiSize(); + if (_diceIndex > 0) { + [[maybe_unused]] bool result = readyToDrawLottie(); + } + } else { +- _size = DownscaledSize(_data->dimensions, { maxWidth, maxHeight }); ++ _size = DownscaledSize(_data->dimensions, Sticker::Size()); + } + } + +@@ -135,8 +131,11 @@ bool Sticker::readyToDrawLottie() { + } + + QSize Sticker::Size() { +- const auto side = std::min(st::maxStickerSize, kMaxSizeFixed); +- return { side, side }; ++ const auto currentStickerHeight = ::Kotato::JsonSettings::GetInt("sticker_height"); ++ const auto currentScaleBoth = ::Kotato::JsonSettings::GetBool("sticker_scale_both"); ++ const auto maxHeight = int(st::maxStickerSize / 256.0 * currentStickerHeight); ++ const auto maxWidth = currentScaleBoth ? maxHeight : st::maxStickerSize; ++ return { maxWidth, maxHeight }; + } + + QSize Sticker::EmojiSize() { diff --git a/337.patch b/337.patch new file mode 100644 index 000000000000..a5a06b678084 --- /dev/null +++ b/337.patch @@ -0,0 +1,52 @@ +From 1513b7b2dd73c9a09c8fb9da74b62e3483a1318b Mon Sep 17 00:00:00 2001 +From: blank X <blankie@nixnetmail.com> +Date: Sun, 20 Mar 2022 13:46:01 +0700 +Subject: [PATCH] Respect userpic rounding for service messages + +--- + .../history/view/media/history_view_photo.cpp | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +diff --git a/Telegram/SourceFiles/history/view/media/history_view_photo.cpp b/Telegram/SourceFiles/history/view/media/history_view_photo.cpp +index 74244a0019..abf3da9202 100644 +--- a/Telegram/SourceFiles/history/view/media/history_view_photo.cpp ++++ b/Telegram/SourceFiles/history/view/media/history_view_photo.cpp +@@ -405,7 +405,7 @@ void Photo::paintUserpicFrame( + auto request = ::Media::Streaming::FrameRequest(); + request.outer = size * cIntRetinaFactor(); + request.resize = size * cIntRetinaFactor(); +- request.radius = ImageRoundRadius::Ellipse; ++ request.radius = KotatoImageRoundRadius(); + if (_streamed->instance.playerLocked()) { + if (_streamed->frozenFrame.isNull()) { + _streamed->frozenFrame = _streamed->instance.frame(request); +@@ -423,7 +423,7 @@ void Photo::paintUserpicFrame( + const auto pix = [&] { + const auto size = QSize(_pixw, _pixh); + const auto args = Images::PrepareArgs{ +- .options = Images::Option::RoundCircle, ++ .options = KotatoImageRoundOption(), + }; + if (const auto large = _dataMedia->image(PhotoSize::Large)) { + return large->pix(size, args); +@@ -453,7 +453,19 @@ void Photo::paintUserpicFrame( + } + { + PainterHighQualityEnabler hq(p); +- p.drawEllipse(inner); ++ switch (KotatoImageRoundRadius()) { ++ case ImageRoundRadius::None: ++ p.drawRoundedRect(inner, 0, 0); ++ break; ++ case ImageRoundRadius::Small: ++ p.drawRoundedRect(inner, st::buttonRadius, st::buttonRadius); ++ break; ++ case ImageRoundRadius::Large: ++ p.drawRoundedRect(inner, st::dateRadius, st::dateRadius); ++ break; ++ default: ++ p.drawEllipse(inner); ++ } + } + sti->historyFileThumbPlay.paintInCenter(p, inner); + } @@ -1,155 +1,377 @@ -# Maintainer: 3Jl0y_PYCCKUi <3jl0y_pycckui@riseup.net> +# Maintainer: +# Contributor: Francesco Minnocci <ascoli dot minnocci at gmail dot com> +# Contributor: 3Jl0y_PYCCKUi <3jl0y_pycckui@riseup.net> # Contributor: solopasha <daron439 at gmail dot com> # Contributor: Ilya Fedin <fedin-ilja2010@ya.ru> # Contributor: Auteiy <dmitry@auteiy.me> -pkgname=kotatogram-desktop -pkgver=1.4.8 -pkgrel=2 -pkgdesc='Kotatogram – experimental Telegram Desktop fork - Stable version' -arch=('x86_64') -url="https://kotatogram.github.io" +_pkgname="kotatogram-desktop" +pkgname="$_pkgname" +pkgver=1.4.9 +pkgrel=1 +pkgdesc='Experimental fork of Telegram Desktop' +url="https://github.com/kotatogram/kotatogram-desktop" license=('GPL3') -provides=(kotatogram-desktop) -depends=('hunspell' 'ffmpeg4.4' 'hicolor-icon-theme' 'lz4' 'minizip' 'openal' 'ttf-opensans' - 'qt5-imageformats' 'qt5-svg' 'qt5-wayland' 'libdbusmenu-qt5' 'xxhash' 'kwayland' 'glibmm' - 'rnnoise' 'pipewire' 'libxtst' 'jemalloc' 'libxrandr' 'abseil-cpp' 'libjpeg-turbo' 'opus' 'openssl-1.1' 'libx11' 'libvpx' 'libxcomposite' - 'libxdamage' 'libxext' 'libxfixes' 'zlib' 'wayland' 'glibc' 'libsigc++' 'glib2' 'xcb-util-keysyms' 'libxcb' 'gcc-libs') -makedepends=('cmake' 'git' 'ninja' 'python' 'range-v3' 'tl-expected' 'microsoft-gsl' - 'extra-cmake-modules' 'webkit2gtk' 'unzip' - 'yasm' 'libtg_owt') -optdepends=('webkit2gtk: embedded browser features' - 'xdg-desktop-portal: desktop integration') -conflicts=('kotatogram-desktop-bin' 'kotatogram-desktop-dynamic-bin' 'kotatogram-dev-git' 'kotatogram-desktop-git') -source=("${pkgname}::git+https://github.com/kotatogram/${pkgname}.git#tag=k${pkgver}" - "${pkgname}-libtgvoip::git+https://github.com/telegramdesktop/libtgvoip.git" - "${pkgname}-GSL::git+https://github.com/Microsoft/GSL.git" - "${pkgname}-Catch::git+https://github.com/philsquared/Catch" - "${pkgname}-xxHash::git+https://github.com/Cyan4973/xxHash.git" - "${pkgname}-rlottie::git+https://github.com/desktop-app/rlottie.git" - "${pkgname}-lz4::git+https://github.com/lz4/lz4.git" - "${pkgname}-lib_crl::git+https://github.com/desktop-app/lib_crl.git" - "${pkgname}-lib_rpl::git+https://github.com/desktop-app/lib_rpl.git" - "${pkgname}-lib_base::git+https://github.com/desktop-app/lib_base.git" - "${pkgname}-codegen::git+https://github.com/desktop-app/codegen.git" - "${pkgname}-lib_ui::git+https://github.com/kotatogram/lib_ui.git" - "${pkgname}-lib_lottie::git+https://github.com/desktop-app/lib_lottie.git" - "${pkgname}-lib_tl::git+https://github.com/desktop-app/lib_tl.git" - "${pkgname}-lib_spellcheck::git+https://github.com/desktop-app/lib_spellcheck.git" - "${pkgname}-lib_storage::git+https://github.com/desktop-app/lib_storage.git" - "${pkgname}-cmake_helpers::git+https://github.com/kotatogram/cmake_helpers.git" - "${pkgname}-expected::git+https://github.com/TartanLlama/expected.git" - "${pkgname}-QR-Code-generator::git+https://github.com/nayuki/QR-Code-generator.git" - "${pkgname}-lib_qr::git+https://github.com/desktop-app/lib_qr.git" - "${pkgname}-libdbusmenu-qt::git+https://github.com/desktop-app/libdbusmenu-qt.git" - "${pkgname}-hunspell::git+https://github.com/hunspell/hunspell.git" - "${pkgname}-range-v3::git+https://github.com/ericniebler/range-v3.git" - "${pkgname}-fcitx-qt5::git+https://github.com/fcitx/fcitx-qt5.git" - "${pkgname}-nimf::git+https://github.com/hamonikr/nimf.git" - "${pkgname}-hime::git+https://github.com/hime-ime/hime.git" - "${pkgname}-fcitx5-qt::git+https://github.com/fcitx/fcitx5-qt.git" - "${pkgname}-lib_webrtc::git+https://github.com/desktop-app/lib_webrtc.git" - "${pkgname}-tgcalls::git+https://github.com/TelegramMessenger/tgcalls.git" - "${pkgname}-lib_webview::git+https://github.com/desktop-app/lib_webview.git" - "${pkgname}-lib_waylandshells::git+https://github.com/desktop-app/lib_waylandshells.git" - "${pkgname}-jemalloc::git+https://github.com/jemalloc/jemalloc.git" - - "0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch" - "block-sponsored_messages.patch") - -b2sums=('SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - '462900e97b9d7a9d40bc02d3dc7dacd3060cc19af02135065628e38e83835a2fb438581ca78001aaffc27d8b0473a78d39509c35f50e4ebb25607fe9c6bae264' - '1e2705008ea8cef1a5c46793a6115ba0f35f77529d18ea04a03e5a0e89980916d78d49a9aa86863b1a0b440debb650262ceb3c9d68600ffe6e5c98fd65804526') +arch=('x86_64') + +depends=( + # 'qt6-5compat' + # 'qt6-imageformats' + # 'qt6-svg' + # 'qt6-wayland' + 'abseil-cpp' + 'ffmpeg4.4' + 'gcc-libs' + 'glib2' + 'glibc' + 'glibmm' + 'hicolor-icon-theme' + 'hunspell' + 'jemalloc' + 'kwayland5' + 'libdispatch' + 'libjpeg-turbo' + 'libpipewire' + 'libsigc++' + 'libvpx' + 'libx11' + 'libxcb' + 'libxcomposite' + 'libxdamage' + 'libxext' + 'libxfixes' + 'libxrandr' + 'libxtst' + 'lz4' + 'minizip' + 'openal' + 'opus' + 'qt5-imageformats' + 'qt5-svg' + 'qt5-wayland' + 'rnnoise' + 'ttf-opensans' + 'wayland' + 'xcb-util-keysyms' + 'xxhash' + 'zlib' +) +makedepends=( + 'cmake' + 'extra-cmake-modules' + 'git' + 'meson' + 'microsoft-gsl' + 'ninja' + 'pipewire' + 'plasma-wayland-protocols' + 'python' + 'range-v3' + 'tl-expected' + 'unzip' + 'wayland-protocols' + 'webkit2gtk' + 'yasm' +) +optdepends=( + 'webkit2gtk: embedded browser features' + 'xdg-desktop-portal: desktop integration' +) + +provides=('kotatogram-desktop') +conflicts=('kotatogram-desktop') + +_tg_owt_commit=63a934db1ed212ebf8aaaa20f0010dd7b0d7b396 + +_pkgsrc="$_pkgname" +source=( + # kotatogram-desktop and patches + "$_pkgsrc"::"git+$url.git#tag=k${pkgver%%.r*}" + + "include.patch" + "kf594.patch" + "https://patch-diff.githubusercontent.com/raw/kotatogram/kotatogram-desktop/pull/326.patch" + "https://patch-diff.githubusercontent.com/raw/kotatogram/kotatogram-desktop/pull/333.patch" + "https://patch-diff.githubusercontent.com/raw/kotatogram/kotatogram-desktop/pull/334.patch" + "https://patch-diff.githubusercontent.com/raw/kotatogram/kotatogram-desktop/pull/335.patch" + "https://patch-diff.githubusercontent.com/raw/kotatogram/kotatogram-desktop/pull/337.patch" + + # tg_owt and patches + "kotatogram-tg_owt"::"git+https://github.com/desktop-app/tg_owt.git#commit=${_tg_owt_commit}" + + "https://patch-diff.githubusercontent.com/raw/desktop-app/tg_owt/pull/101.patch" + "tg_owt-fix.patch" + + # other patches + "0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch" + "0002-Block-sponsored_messages.patch" + "0003-Allow-downloading-and-copying-from-restricted-channels.patch" + + # submodules for kotatogram-desktop + 'apple.swift-corelibs-libdispatch'::'git+https://github.com/apple/swift-corelibs-libdispatch.git' + 'cyan4973.xxhash'::'git+https://github.com/Cyan4973/xxHash.git' + 'desktop-app.codegen'::'git+https://github.com/desktop-app/codegen.git' + 'desktop-app.lib_base'::'git+https://github.com/desktop-app/lib_base.git' + 'desktop-app.lib_crl'::'git+https://github.com/desktop-app/lib_crl.git' + 'desktop-app.lib_lottie'::'git+https://github.com/desktop-app/lib_lottie.git' + 'desktop-app.lib_qr'::'git+https://github.com/desktop-app/lib_qr.git' + 'desktop-app.lib_rpl'::'git+https://github.com/desktop-app/lib_rpl.git' + 'desktop-app.lib_spellcheck'::'git+https://github.com/desktop-app/lib_spellcheck.git' + 'desktop-app.lib_storage'::'git+https://github.com/desktop-app/lib_storage.git' + 'desktop-app.lib_tl'::'git+https://github.com/desktop-app/lib_tl.git' + 'desktop-app.lib_waylandshells'::'git+https://github.com/desktop-app/lib_waylandshells.git' + 'desktop-app.lib_webrtc'::'git+https://github.com/desktop-app/lib_webrtc.git' + 'desktop-app.lib_webview'::'git+https://github.com/desktop-app/lib_webview.git' + 'desktop-app.rlottie'::'git+https://github.com/desktop-app/rlottie.git' + 'ericniebler.range-v3'::'git+https://github.com/ericniebler/range-v3.git' + 'fcitx.fcitx-qt5'::'git+https://github.com/fcitx/fcitx-qt5.git' + 'fcitx.fcitx5-qt'::'git+https://github.com/fcitx/fcitx5-qt.git' + 'gitlab-freedesktop-mirrors.wayland-protocols'::'git+https://github.com/gitlab-freedesktop-mirrors/wayland-protocols.git' + 'hamonikr.nimf'::'git+https://github.com/hamonikr/nimf.git' + 'hime-ime.hime'::'git+https://github.com/hime-ime/hime.git' + 'hunspell'::'git+https://github.com/hunspell/hunspell.git' + 'jemalloc'::'git+https://github.com/jemalloc/jemalloc.git' + 'kde.extra-cmake-modules'::'git+https://github.com/KDE/extra-cmake-modules.git' + 'kde.kwayland'::'git+https://github.com/KDE/kwayland.git' + 'kde.plasma-wayland-protocols'::'git+https://github.com/KDE/plasma-wayland-protocols.git' + 'kotatogram.cmake_helpers'::'git+https://github.com/kotatogram/cmake_helpers.git' + 'kotatogram.lib_ui'::'git+https://github.com/kotatogram/lib_ui.git' + 'lz4'::'git+https://github.com/lz4/lz4.git' + 'microsoft.gsl'::'git+https://github.com/Microsoft/GSL.git' + 'nayuki.qr-code-generator'::'git+https://github.com/nayuki/QR-Code-generator.git' + 'tartanllama.expected'::'git+https://github.com/TartanLlama/expected.git' + 'telegramdesktop.libtgvoip'::'git+https://github.com/telegramdesktop/libtgvoip.git' + 'telegrammessenger.tgcalls'::'git+https://github.com/TelegramMessenger/tgcalls.git' + + # submodules for telegramdesktop.libtgvoip + 'desktop-app.cmake_helpers'::'git+https://github.com/desktop-app/cmake_helpers.git' + + # submodules for ericniebler.range-v3 + #'ericniebler.range-v3'::'git+https://github.com/ericniebler/range-v3.git' + + # submodules for kotatogram-tg_owt + 'chromiumsrc.libyuv'::'git+https://gitlab.com/chromiumsrc/libyuv.git' + 'pipewire'::'git+https://github.com/PipeWire/pipewire.git' +) + +sha256sums=( + 'SKIP' + '133cde2fb9e1b5f837396e487783adf5e1899e20d335f1654a71e6ef1121918c' + '25160a4a687b0032151f5c7a295996e4322b5c9ed1122dfa6c3985d57e866b2c' + '289b69c980fe4877ab94d3b68180e586ffabecd15c4205f008fe21498d12f7ee' + 'd27016d67bd0baf5eb7c49ce1a0658e584d3892c344edde38843ca39a1d63a42' + '533576f87db701100b2fda4b4ccbbb9957234d86447960a7c6b1dd07c8830d19' + '26bd7d7e683dbf8d3fc7675afafac3fa3a140c21ca9087c8c98241a9041b981c' + 'b794229b2b2cec355219fe6d33dba1efd782dc9ad53c50ab90f5f682db370bea' + + 'SKIP' + 'f4d26c1048a7fd1ac3419042009c3b52c001458e44309a765d42d7df9f45f1ef' + '8d3a1c4b2e40eef7a4cc8e6f498c416af47a91b878ec3762b51476e89695cb13' + + '639b0b659685ff11daee21efd0ca0e473ee1cfb533709ea8ecf357945e058f43' + '229c85f7fe86c11139b4d6b4fd44086d737e25ac94c89302aabe09eedb436f7e' + 'bb2aa0ec20d9769a513a41033a7f00baf08afd7a40c710431576d0f8b3a27a0e' + + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + + 'SKIP' + + #'SKIP' + + 'SKIP' + 'SKIP' +) + +_pkgver() { + cd "$_pkgsrc" + git describe --long --tags | sed 's/^k//;s/\([^-]*-g\)/r\1/;s/-/./g' +} + +_prepare_kotatogram() ( + cd "${srcdir:?}/$_pkgsrc" + local -A _submodules=( + ['apple.swift-corelibs-libdispatch']='Telegram/ThirdParty/dispatch' + ['cyan4973.xxhash']='Telegram/ThirdParty/xxHash' + ['desktop-app.codegen']='Telegram/codegen' + ['desktop-app.lib_base']='Telegram/lib_base' + ['desktop-app.lib_crl']='Telegram/lib_crl' + ['desktop-app.lib_lottie']='Telegram/lib_lottie' + ['desktop-app.lib_qr']='Telegram/lib_qr' + ['desktop-app.lib_rpl']='Telegram/lib_rpl' + ['desktop-app.lib_spellcheck']='Telegram/lib_spellcheck' + ['desktop-app.lib_storage']='Telegram/lib_storage' + ['desktop-app.lib_tl']='Telegram/lib_tl' + ['desktop-app.lib_waylandshells']='Telegram/lib_waylandshells' + ['desktop-app.lib_webrtc']='Telegram/lib_webrtc' + ['desktop-app.lib_webview']='Telegram/lib_webview' + ['desktop-app.rlottie']='Telegram/ThirdParty/rlottie' + ['ericniebler.range-v3']='Telegram/ThirdParty/range-v3' + ['fcitx.fcitx-qt5']='Telegram/ThirdParty/fcitx-qt5' + ['fcitx.fcitx5-qt']='Telegram/ThirdParty/fcitx5-qt' + ['gitlab-freedesktop-mirrors.wayland-protocols']='Telegram/ThirdParty/wayland-protocols' + ['hamonikr.nimf']='Telegram/ThirdParty/nimf' + ['hime-ime.hime']='Telegram/ThirdParty/hime' + ['hunspell']='Telegram/ThirdParty/hunspell' + ['jemalloc']='Telegram/ThirdParty/jemalloc' + ['kde.extra-cmake-modules']='Telegram/ThirdParty/extra-cmake-modules' + ['kde.kwayland']='Telegram/ThirdParty/kwayland' + ['kde.plasma-wayland-protocols']='Telegram/ThirdParty/plasma-wayland-protocols' + ['kotatogram.cmake_helpers']='cmake' + ['kotatogram.lib_ui']='Telegram/lib_ui' + ['lz4']='Telegram/ThirdParty/lz4' + ['microsoft.gsl']='Telegram/ThirdParty/GSL' + ['nayuki.qr-code-generator']='Telegram/ThirdParty/QR' + ['tartanllama.expected']='Telegram/ThirdParty/expected' + ['telegramdesktop.libtgvoip']='Telegram/ThirdParty/libtgvoip' + ['telegrammessenger.tgcalls']='Telegram/ThirdParty/tgcalls' + ) + for key in ${!_submodules[@]} ; do + git submodule init "${_submodules[${key}]}" + git submodule set-url "${_submodules[${key}]}" "${srcdir}/${key}" + git -c protocol.file.allow=always submodule update "${_submodules[${key}]}" + done + + ( + # submodules for telegramdesktop.libtgvoip + cd "Telegram/ThirdParty/libtgvoip" + local -A _submodules=( + ['desktop-app.cmake_helpers']='cmake' + ) + for key in ${!_submodules[@]} ; do + git submodule init "${_submodules[${key}]}" + git submodule set-url "${_submodules[${key}]}" "${srcdir}/${key}" + git -c protocol.file.allow=always submodule update "${_submodules[${key}]}" + done + ) + ( + # submodules for ericniebler.range-v3 + cd "Telegram/ThirdParty/range-v3" + local -A _submodules=( + ['ericniebler.range-v3']='doc/gh-pages' + ) + for key in ${!_submodules[@]} ; do + git submodule init "${_submodules[${key}]}" + git submodule set-url "${_submodules[${key}]}" "${srcdir}/${key}" + git -c protocol.file.allow=always submodule update "${_submodules[${key}]}" + done + ) + + cd "${srcdir:?}/$_pkgsrc" + apply-patch "${srcdir:?}/kf594.patch" + apply-patch "${srcdir:?}/326.patch" + apply-patch "${srcdir:?}/333.patch" + apply-patch "${srcdir:?}/334.patch" + apply-patch "${srcdir:?}/335.patch" + apply-patch "${srcdir:?}/337.patch" + + apply-patch "${srcdir:?}/0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch" + apply-patch "${srcdir:?}/0002-Block-sponsored_messages.patch" + apply-patch "${srcdir:?}/0003-Allow-downloading-and-copying-from-restricted-channels.patch" +) + +_prepare_tg_owt() ( + cd "${srcdir:?}/kotatogram-tg_owt" + local -A _submodules=( + ['chromiumsrc.libyuv']='src/third_party/libyuv' + ['pipewire']='src/third_party/pipewire' + ) + for key in ${!_submodules[@]} ; do + git submodule init "${_submodules[${key}]}" + git submodule set-url "${_submodules[${key}]}" "${srcdir}/${key}" + done + + git -c protocol.file.allow=always submodule update --recursive + + apply-patch "${srcdir:?}/101.patch" + ## apply-patch "${srcdir:?}/include.patch" + apply-patch "${srcdir:?}/tg_owt-fix.patch" +) prepare() { - cd "${srcdir}/${pkgname}" - git submodule init - - git config submodule.cmake.url "${srcdir}/${pkgname}-cmake_helpers" - - git config submodule.Telegram/lib_crl.url "${srcdir}/${pkgname}-lib_crl" - git config submodule.Telegram/lib_rpl.url "${srcdir}/${pkgname}-lib_rpl" - git config submodule.Telegram/lib_base.url "${srcdir}/${pkgname}-lib_base" - git config submodule.Telegram/codegen.url "${srcdir}/${pkgname}-codegen" - git config submodule.Telegram/lib_ui.url "${srcdir}/${pkgname}-lib_ui" - git config submodule.Telegram/lib_lottie.url "${srcdir}/${pkgname}-lib_lottie" - git config submodule.Telegram/lib_tl.url "${srcdir}/${pkgname}-lib_tl" - git config submodule.Telegram/lib_spellcheck.url "${srcdir}/${pkgname}-lib_spellcheck" - git config submodule.Telegram/lib_storage.url "${srcdir}/${pkgname}-lib_storage" - git config submodule.Telegram/lib_qr.url "${srcdir}/${pkgname}-lib_qr" - git config submodule.Telegram/lib_webrtc.url "${srcdir}/${pkgname}-lib_webrtc" - git config submodule.Telegram/lib_webview.url "${srcdir}/${pkgname}-lib_webview" - git config submodule.Telegram/lib_waylandshells.url "${srcdir}/${pkgname}-lib_waylandshells" - - git config submodule.Telegram/ThirdParty/libtgvoip.url "${srcdir}/${pkgname}-libtgvoip" - git config submodule.Telegram/ThirdParty/GSL.url "${srcdir}/${pkgname}-GSL" - git config submodule.Telegram/ThirdParty/Catch.url "${srcdir}/${pkgname}-Catch" - git config submodule.Telegram/ThirdParty/xxHash.url "${srcdir}/${pkgname}-xxHash" - git config submodule.Telegram/ThirdParty/rlottie.url "${srcdir}/${pkgname}-rlottie" - git config submodule.Telegram/ThirdParty/lz4.url "${srcdir}/${pkgname}-lz4" - git config submodule.Telegram/ThirdParty/expected.url "${srcdir}/${pkgname}-expected" - git config submodule.Telegram/ThirdParty/QR.url "${srcdir}/${pkgname}-QR-Code-generator" - git config submodule.Telegram/ThirdParty/libdbusmenu-qt.url "${srcdir}/${pkgname}-libdbusmenu-qt" - git config submodule.Telegram/ThirdParty/hunspell.url "${srcdir}/${pkgname}-hunspell" - git config submodule.Telegram/ThirdParty/range-v3.url "${srcdir}/${pkgname}-range-v3" - git config submodule.Telegram/ThirdParty/fcitx-qt5.url "${srcdir}/${pkgname}-fcitx-qt5" - git config submodule.Telegram/ThirdParty/nimf.url "${srcdir}/${pkgname}-nimf" - git config submodule.Telegram/ThirdParty/hime.url "${srcdir}/${pkgname}-hime" - git config submodule.Telegram/ThirdParty/fcitx5-qt.url "${srcdir}/${pkgname}-fcitx5-qt" - git config submodule.Telegram/ThirdParty/tgcalls.url "${srcdir}/${pkgname}-tgcalls" - git config submodule.Telegram/ThirdParty/jemalloc.url "${srcdir}/${pkgname}-jemalloc" - - git -c protocol.file.allow=always submodule update - - #patches - patch -p1 < "${srcdir}/0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch" - patch -p1 < "${srcdir}/block-sponsored_messages.patch" + apply-patch() { + printf '\nApplying patch %s\n' "$1" + patch -Np1 -F100 -i "$1" + } + + _prepare_kotatogram + _prepare_tg_owt } +_build_tg_owt() ( + local _cmake_options=( + -B "build-tg_owt" + -S "kotatogram-tg_owt" + -G Ninja + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DBUILD_SHARED_LIBS=OFF + -DTG_OWT_PACKAGED_BUILD=ON + + -DCMAKE_C_FLAGS="${CFLAGS} -ffat-lto-objects" + -DCMAKE_CXX_FLAGS="${CXXFLAGS} -ffat-lto-objects -I/usr/include/libdrm" + ) + + cmake "${_cmake_options[@]}" + cmake --build "build-tg_owt" +) + +_build_kotatogram() ( + local _cmake_options=( + -B build + -S "$_pkgsrc" + -G Ninja + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX="/usr" + -DTDESKTOP_API_TEST=ON + -Dtg_owt_DIR="${srcdir:?}/build-tg_owt" + -DDESKTOP_APP_QT6=OFF + ) + + cmake "${_cmake_options[@]}" + cmake --build build +) + build() { - cd "${srcdir}/${pkgname}" - cmake . \ - -B build \ - -G Ninja \ - -DCMAKE_INSTALL_PREFIX="/usr" \ - -DCMAKE_BUILD_TYPE=Release \ - -DDESKTOP_APP_QT6=off \ - -DTDESKTOP_API_TEST=ON - cmake --build build + export CXXFLAGS+=" -Wp,-U_GLIBCXX_ASSERTIONS" + export PKG_CONFIG_PATH='/usr/lib/ffmpeg4.4/pkgconfig' # force build with ffmpeg4.4 + + _build_tg_owt + _build_kotatogram } package() { - cd "${srcdir}/${pkgname}" - DESTDIR="$pkgdir" cmake --install build + DESTDIR="${pkgdir:?}" cmake --install build } diff --git a/include.patch b/include.patch new file mode 100644 index 000000000000..1cedb97ffb85 --- /dev/null +++ b/include.patch @@ -0,0 +1,13 @@ +diff --git a/src/modules/include/module_common_types_public.h b/src/modules/include/module_common_types_public.h +index 345e45ce..de74bf69 100644 +--- a/src/modules/include/module_common_types_public.h ++++ b/src/modules/include/module_common_types_public.h +@@ -10,7 +10,7 @@ + + #ifndef MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_ + #define MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_ +- ++#include <cstdint> + #include <limits> + + #include "absl/types/optional.h" diff --git a/kf594.patch b/kf594.patch new file mode 100644 index 000000000000..0fa2d8bc8f6e --- /dev/null +++ b/kf594.patch @@ -0,0 +1,57 @@ +diff --git a/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp b/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp +index 7641579aa..3c195e397 100644 +--- a/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp ++++ b/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp +@@ -9,10 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + + #include "base/platform/base_platform_info.h" + +-#include <connection_thread.h> +-#include <registry.h> +-#include <surface.h> +-#include <plasmashell.h> ++#include <KWayland/Client/connection_thread.h> ++#include <KWayland/Client/registry.h> ++#include <KWayland/Client/surface.h> ++#include <KWayland/Client/plasmashell.h> + + using namespace KWayland::Client; + +Submodule Telegram/lib_base contains modified content +diff --git a/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration.cpp b/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration.cpp +index 32f0de6..30a087f 100644 +--- a/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration.cpp ++++ b/Telegram/lib_base/base/platform/linux/base_linux_wayland_integration.cpp +@@ -13,11 +13,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + #include <QtCore/QPointer> + #include <QtGui/QWindow> + +-#include <connection_thread.h> +-#include <registry.h> +-#include <surface.h> +-#include <xdgforeign.h> +-#include <idleinhibit.h> ++#include <KWayland/Client/connection_thread.h> ++#include <KWayland/Client/registry.h> ++#include <KWayland/Client/surface.h> ++#include <KWayland/Client/xdgforeign.h> ++#include <KWayland/Client/idleinhibit.h> + + using namespace KWayland::Client; + +Submodule Telegram/lib_ui contains modified content +diff --git a/Telegram/lib_ui/ui/platform/linux/ui_linux_wayland_integration.cpp b/Telegram/lib_ui/ui/platform/linux/ui_linux_wayland_integration.cpp +index 01f1e80..163cb6a 100644 +--- a/Telegram/lib_ui/ui/platform/linux/ui_linux_wayland_integration.cpp ++++ b/Telegram/lib_ui/ui/platform/linux/ui_linux_wayland_integration.cpp +@@ -24,8 +24,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + #include <private/qwaylandwindow_p.h> + #include <private/qwaylandshellsurface_p.h> + +-#include <connection_thread.h> +-#include <registry.h> ++#include <KWayland/Client/connection_thread.h> ++#include <KWayland/Client/registry.h> + + Q_DECLARE_METATYPE(QMargins); + diff --git a/tg_owt-fix.patch b/tg_owt-fix.patch new file mode 100644 index 000000000000..8a8bedb5ce53 --- /dev/null +++ b/tg_owt-fix.patch @@ -0,0 +1,49 @@ +diff --git a/src/common_video/h265/h265_pps_parser.h b/src/common_video/h265/h265_pps_parser.h +index 28c95ea9..790b0b73 100644 +--- a/src/common_video/h265/h265_pps_parser.h ++++ b/src/common_video/h265/h265_pps_parser.h +@@ -13,6 +13,8 @@ + + #include "absl/types/optional.h" + ++#include <stdint.h> ++ + namespace rtc { + class BitBuffer; + } +diff --git a/src/modules/audio_processing/transient/file_utils.h b/src/modules/audio_processing/transient/file_utils.h +index b7483377..56696708 100644 +--- a/src/modules/audio_processing/transient/file_utils.h ++++ b/src/modules/audio_processing/transient/file_utils.h +@@ -14,6 +14,7 @@ + #include <string.h> + + #include "rtc_base/system/file_wrapper.h" ++#include <cstdint> + + namespace webrtc { + +diff --git a/src/modules/include/module_common_types_public.h b/src/modules/include/module_common_types_public.h +index 345e45ce..8338a514 100644 +--- a/src/modules/include/module_common_types_public.h ++++ b/src/modules/include/module_common_types_public.h +@@ -11,6 +11,7 @@ + #ifndef MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_ + #define MODULES_INCLUDE_MODULE_COMMON_TYPES_PUBLIC_H_ + ++#include <cstdint> + #include <limits> + + #include "absl/types/optional.h" +diff --git a/src/rtc_base/third_party/base64/base64.h b/src/rtc_base/third_party/base64/base64.h +index ca249541..b5cf3f73 100644 +--- a/src/rtc_base/third_party/base64/base64.h ++++ b/src/rtc_base/third_party/base64/base64.h +@@ -16,6 +16,7 @@ + #include <vector> + + #include "rtc_base/system/rtc_export.h" ++#include <cstdint> + + namespace rtc { + |