diff options
author | Francesco Minnocci | 2021-04-14 12:11:19 +0200 |
---|---|---|
committer | Francesco Minnocci | 2021-04-14 12:11:19 +0200 |
commit | 7713c3f3f825630813cee760d8b5c91c717b4cbb (patch) | |
tree | c5dcf154e797ed34df951766cf8ea9a4266cadcc | |
download | aur-7713c3f3f825630813cee760d8b5c91c717b4cbb.tar.gz |
Initial package upload: kotatogram-dev-git
-rw-r--r-- | .SRCINFO | 69 | ||||
-rw-r--r-- | 0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch | 219 | ||||
-rw-r--r-- | PKGBUILD | 134 |
3 files changed, 422 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..8a7fc6465478 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,69 @@ +pkgbase = kotatogram-dev-git + pkgdesc = Kotatogram – experimental Telegram Desktop fork - Dev branch + pkgver = r10100.2eabfee52 + pkgrel = 1 + url = https://github.com/kotatogram/kotatogram-desktop + arch = x86_64 + license = GPL3 + makedepends = cmake + makedepends = git + makedepends = ninja + makedepends = python + makedepends = range-v3 + makedepends = tl-expected + makedepends = microsoft-gsl + makedepends = libtg_owt + depends = qt5-imageformats + depends = gtk3 + depends = ffmpeg + depends = openal + depends = glibmm + depends = kwayland + depends = lz4 + depends = xxhash + depends = minizip + depends = libdbusmenu-qt5 + depends = hunspell + optdepends = ttf-opensans: default Open Sans font family + provides = kotatogram-desktop + conflicts = kotatogram-desktop + source = kotatogram-desktop::git+https://github.com/kotatogram/kotatogram-desktop.git + source = kotatogram-desktop-libtgvoip::git+https://github.com/telegramdesktop/libtgvoip + source = kotatogram-desktop-rlottie::git+https://github.com/desktop-app/rlottie.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/kotatogram/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_rlottie::git+https://github.com/desktop-app/lib_rlottie.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 + 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-QR-Code-generator::git+https://github.com/nayuki/QR-Code-generator + source = kotatogram-desktop-lib_qr::git+https://github.com/desktop-app/lib_qr.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 = 0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = 13357d081fb658c735bb2575360f5d48214e1cf5002719ba410405a2fe05c7c3d2379588c2ca3c2ca6a5e6ff64e01e6d1ff3aecdaee8f3dd0519a64f6ee94182 + +pkgname = kotatogram-dev-git 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 new file mode 100644 index 000000000000..7f8221f0b276 --- /dev/null +++ b/0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch @@ -0,0 +1,219 @@ +From c492b914837cead3fc5f2530c560ad76b65f4113 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 + +--- + Telegram/Resources/langs/lang.strings | 2 ++ + 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 | 28 +++++++++++++++++++ + .../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 + + 10 files changed, 65 insertions(+), 2 deletions(-) + +diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings +index 2b8212d73..e1c7f2643 100644 +--- a/Telegram/Resources/langs/lang.strings ++++ b/Telegram/Resources/langs/lang.strings +@@ -2897,6 +2897,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + "ktg_settings_forward_chat_on_click" = "Open chat on click"; + "ktg_settings_forward_chat_on_click_description" = "You can hold Ctrl to select multiple chats regardless of this option."; + ++"ktg_settings_block_users_in_groups" = "Block users in groups"; ++ + "ktg_forward_menu_quoted" = "Quoted"; + "ktg_forward_menu_unquoted" = "Unquoted with captions"; + "ktg_forward_menu_uncaptioned" = "Unquoted without captions"; +diff --git a/Telegram/Resources/langs/rewrites/en.json b/Telegram/Resources/langs/rewrites/en.json +index 8c828daa4..2a1616ec9 100644 +--- a/Telegram/Resources/langs/rewrites/en.json ++++ b/Telegram/Resources/langs/rewrites/en.json +@@ -181,6 +181,7 @@ + "ktg_admin_log_banned_send_games": "Send games", + "ktg_admin_log_banned_use_inline": "Use inline bots", + "ktg_forward_go_to_chat": "Go to chat", ++ "ktg_settings_block_users_in_groups": "Block users in groups", + "ktg_settings_forward": "Forward", + "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 96c961099..b2ff772bd 100644 +--- a/Telegram/Resources/langs/rewrites/ru.json ++++ b/Telegram/Resources/langs/rewrites/ru.json +@@ -181,6 +181,7 @@ + "ktg_admin_log_banned_send_games": "Отправка игр", + "ktg_admin_log_banned_use_inline": "Отправка через ботов", + "ktg_forward_go_to_chat": "Перейти в чат", ++ "ktg_settings_block_users_in_groups": "Блокировать пользователей в группах", + "ktg_settings_forward": "Пересылка", + "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 90ab65500..fa921b256 100644 +--- a/Telegram/SourceFiles/history/history_item_components.cpp ++++ b/Telegram/SourceFiles/history/history_item_components.cpp +@@ -349,7 +349,10 @@ void HistoryMessageReply::paint( + p.fillRect(rbar, bar); + + if (w > st::msgReplyBarSkip) { +- if (replyToMsg) { ++ auto blocked = replyToMsg ++ && replyToMsg->from()->isUser() ++ && replyToMsg->from()->asUser()->isBlocked(); ++ if (replyToMsg && (!blocked || !BlockUsersInGroups())) { + auto hasPreview = replyToMsg->media() ? replyToMsg->media()->hasReplyPreview() : false; + if (hasPreview && w < st::msgReplyBarSkip + st::msgReplyBarSize.height()) { + hasPreview = false; +@@ -390,7 +393,7 @@ void HistoryMessageReply::paint( + p.setFont(st::msgDateFont); + auto &date = outbg ? (selected ? st::msgOutDateFgSelected : st::msgOutDateFg) : (selected ? st::msgInDateFgSelected : st::msgInDateFg); + p.setPen((flags & PaintFlag::InBubble) ? date : 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)); + } + } + } +diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp +index 1ceb4badf..585416c57 100644 +--- a/Telegram/SourceFiles/history/history_widget.cpp ++++ b/Telegram/SourceFiles/history/history_widget.cpp +@@ -601,6 +601,34 @@ HistoryWidget::HistoryWidget( + }); + }, lifetime()); + ++ BlockUsersInGroupsChanges( ++ ) | rpl::start_with_next([=] { ++ crl::on_main(this, [=] { ++ if (_history) { ++ _history->forceFullResize(); ++ if (_migrated) { ++ _migrated->forceFullResize(); ++ } ++ updateHistoryGeometry(); ++ update(); ++ } ++ }); ++ }, lifetime()); ++ ++ session().api().blockedPeersSlice( ++ ) | rpl::start_with_next([=] { ++ crl::on_main(this, [=] { ++ if (_history) { ++ _history->forceFullResize(); ++ if (_migrated) { ++ _migrated->forceFullResize(); ++ } ++ updateHistoryGeometry(); ++ update(); ++ } ++ }); ++ }, lifetime()); ++ + HoverEmojiPanelChanges( + ) | rpl::start_with_next([=] { + crl::on_main(this, [=] { +diff --git a/Telegram/SourceFiles/history/view/history_view_element.cpp b/Telegram/SourceFiles/history/view/history_view_element.cpp +index ede5b7b51..fb361696a 100644 +--- a/Telegram/SourceFiles/history/view/history_view_element.cpp ++++ b/Telegram/SourceFiles/history/view/history_view_element.cpp +@@ -25,6 +25,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" +@@ -433,6 +434,12 @@ bool Element::isHiddenByGroup() const { + } + + bool Element::isHidden() const { ++ if (BlockUsersInGroups() ++ && data()->from()->isUser() ++ && data()->from()->asUser()->isBlocked()) { ++ return true; ++ } ++ + return isHiddenByGroup(); + } + +diff --git a/Telegram/SourceFiles/kotato/json_settings.cpp b/Telegram/SourceFiles/kotato/json_settings.cpp +index 464264048..9a7b904e0 100644 +--- a/Telegram/SourceFiles/kotato/json_settings.cpp ++++ b/Telegram/SourceFiles/kotato/json_settings.cpp +@@ -359,6 +359,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"), cShowChatId()); + settings.insert(qsl("show_phone_in_drawer"), cShowPhoneInDrawer()); +@@ -509,6 +510,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 4614fc505..01bf7d71b 100644 +--- a/Telegram/SourceFiles/kotato/settings.cpp ++++ b/Telegram/SourceFiles/kotato/settings.cpp +@@ -77,6 +77,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; + int gShowChatId = 2; + +diff --git a/Telegram/SourceFiles/kotato/settings.h b/Telegram/SourceFiles/kotato/settings.h +index 209c5133d..36f88b338 100644 +--- a/Telegram/SourceFiles/kotato/settings.h ++++ b/Telegram/SourceFiles/kotato/settings.h +@@ -53,6 +53,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); + DeclareSetting(int, ShowChatId); + +diff --git a/Telegram/SourceFiles/kotato/settings_menu.cpp b/Telegram/SourceFiles/kotato/settings_menu.cpp +index 2c836018c..13396a94e 100644 +--- a/Telegram/SourceFiles/kotato/settings_menu.cpp ++++ b/Telegram/SourceFiles/kotato/settings_menu.cpp +@@ -377,6 +377,7 @@ void SetupKotatoMessages(not_null<Ui::VerticalLayout*> container) { + } + + SettingsMenuSwitch(ktg_settings_emoji_outline, BigEmojiOutline); ++ SettingsMenuSwitch(ktg_settings_block_users_in_groups, BlockUsersInGroups); + + AddSkip(container); + } +-- +2.31.1 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..c124677dc192 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,134 @@ +# Maintainer: Francesco Minnocci <ascoli dot minnocci at gmail dot com> + +pkgname=kotatogram-dev-git +_pkgname=kotatogram-desktop +pkgver=r10100.2eabfee52 +pkgrel=1 +pkgdesc="Kotatogram – experimental Telegram Desktop fork - Dev branch" +arch=(x86_64) +url="https://github.com/kotatogram/kotatogram-desktop" +license=(GPL3) +depends=( + qt5-imageformats + gtk3 + ffmpeg + openal + glibmm + kwayland + lz4 + xxhash + minizip + libdbusmenu-qt5 + hunspell +) +makedepends=( + cmake + git + ninja + python + range-v3 + tl-expected + microsoft-gsl + libtg_owt +) +optdepends=( + 'ttf-opensans: default Open Sans font family' +) +conflicts=('kotatogram-desktop') +provides=('kotatogram-desktop') +source=( + "${_pkgname}::git+${url}.git" + "${_pkgname}-libtgvoip::git+https://github.com/telegramdesktop/libtgvoip" + "${_pkgname}-rlottie::git+https://github.com/desktop-app/rlottie.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/kotatogram/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_rlottie::git+https://github.com/desktop-app/lib_rlottie.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" + "${_pkgname}-lib_storage::git+https://github.com/desktop-app/lib_storage.git" + "${_pkgname}-cmake_helpers::git+https://github.com/kotatogram/cmake_helpers.git" + "${_pkgname}-QR-Code-generator::git+https://github.com/nayuki/QR-Code-generator" + "${_pkgname}-lib_qr::git+https://github.com/desktop-app/lib_qr.git" + "${_pkgname}-lib_webrtc::git+https://github.com/desktop-app/lib_webrtc.git" + "${_pkgname}-tgcalls::git+https://github.com/TelegramMessenger/tgcalls.git" + "0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch" +) +sha512sums=('SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + '13357d081fb658c735bb2575360f5d48214e1cf5002719ba410405a2fe05c7c3d2379588c2ca3c2ca6a5e6ff64e01e6d1ff3aecdaee8f3dd0519a64f6ee94182') + +pkgver() { + cd "${srcdir}/${_pkgname}" + + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "${srcdir}/${_pkgname}" + git submodule init + git config submodule.Telegram/ThirdParty/libtgvoip.url "${srcdir}/${_pkgname}-libtgvoip" + git config submodule.Telegram/ThirdParty/rlottie.url "${srcdir}/${_pkgname}-rlottie" + 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_rlottie.url "${srcdir}/${_pkgname}-lib_rlottie" + 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.cmake.url "${srcdir}/${_pkgname}-cmake_helpers" + git config submodule.Telegram/ThirdParty/QR.url "${srcdir}/${_pkgname}-QR-Code-generator" + git config submodule.Telegram/lib_qr.url "${srcdir}/${_pkgname}-lib_qr" + git config sumbodule.Telegram/lib_webrtc.url "${srcdir}/${_pkgname}-lib_webrtc" + git config sumbodule.Telegram/ThirdParty/tgcalls.url "${srcdir}/${_pkgname}-tgcalls" + git submodule update + + pushd cmake + # force webrtc link to libjpeg + echo "target_link_libraries(external_webrtc INTERFACE jpeg)" | tee -a external/webrtc/CMakeLists.txt + popd + + patch -p1 < ${srcdir}/0001-Add-an-option-to-hide-messages-from-blocked-users-in.patch +} + +build() { + cd "${srcdir}/${_pkgname}/" + + cmake . \ + -B build \ + -G Ninja \ + -DCMAKE_INSTALL_PREFIX="/usr" \ + -DCMAKE_BUILD_TYPE=Release \ + -DTDESKTOP_API_TEST=ON + + cmake --build build +} + +package() { + cd "${srcdir}/${_pkgname}" + + DESTDIR="$pkgdir" ninja -C build install +} +# vim:set ts=2 sw=2 et: |