diff options
author | udf | 2019-08-17 22:38:41 +0200 |
---|---|---|
committer | udf | 2019-08-17 22:59:27 +0200 |
commit | a862e4c0448db25e9fce36d00636db86f504f423 (patch) | |
tree | ff8a1e5154e153e5de7106c8f1c87e1aef17b5ed | |
parent | 5d3ab760fdc598adc08e04c24382a19dd0942af7 (diff) | |
download | aur-a862e4c0448db25e9fce36d00636db86f504f423.tar.gz |
Add search_by_any_user.patch
-rw-r--r-- | PKGBUILD | 3 | ||||
-rw-r--r-- | search_by_any_user.patch | 111 |
2 files changed, 114 insertions, 0 deletions
@@ -45,6 +45,7 @@ source=( "always_delete_for_everyone.patch" "always_pin_without_notify.patch" "always_send_as_photo_or_album.patch" + "search_by_any_user.patch" ) sha512sums=( 'SKIP' @@ -67,6 +68,7 @@ sha512sums=( '31ed454cbfe5811dedfac516e1c55cd6a2ea69fedb5e09035c04ed1b9647270eafdee1501494ecd948b6baa7a38dbf0747ba686dc89f31804589a39470793ac2' 'b4eeeb4b2801f3edcc7423f28403b1dfabd3f3869425e4f102a2a4554bde93e63bd73d2d4dbf3e5748ce831b570e441d3917f532fc5cceac1ee5e8fd0832cb30' '650a2a2568cacd2775979614c06c90a4c505207246eb229bbf4fccd8e9fc2540093eaa5bd748e3801c1e1b43beb89b19674c27c5f400d451475b0ee068b04ca2' + 'b6527b9d71de1a7688071418778a6935a38e65718d96ea750a8a6c1430220279b0e2b4e0eec148e4a82623dff5e334d98f808b042cf6e9c51ec4afc221419fe2' ) prepare() { @@ -92,6 +94,7 @@ prepare() { patch -Np1 -i "$srcdir/always_delete_for_everyone.patch" patch -Np1 -i "$srcdir/always_pin_without_notify.patch" patch -Np1 -i "$srcdir/always_send_as_photo_or_album.patch" + patch -Np1 -i "$srcdir/search_by_any_user.patch" # disable static-qt for rlottie sed "/RLOTTIE_WITH_STATIC_QT/d" -i "$srcdir/tdesktop/Telegram/gyp/lib_rlottie.gyp" diff --git a/search_by_any_user.patch b/search_by_any_user.patch new file mode 100644 index 000000000000..931a52bb46bb --- /dev/null +++ b/search_by_any_user.patch @@ -0,0 +1,111 @@ +Author: TheWug (https://github.com/TheWug) +Description: Allows searching by any user instead of only members of a chat + +diff --git a/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp +index dfea07f62..617ba8d6a 100644 +--- a/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp ++++ b/Telegram/SourceFiles/boxes/peers/add_participants_box.cpp +@@ -312,6 +312,8 @@ void AddSpecialBoxController::prepare() { + delegate()->peerListSetSearchMode(PeerListSearchMode::Enabled); + auto title = [&] { + switch (_role) { ++ case Role::Members: ++ return tr::lng_profile_participants_section(); + case Role::Admins: + return tr::lng_channel_add_admin(); + case Role::Restricted: +diff --git a/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.cpp b/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.cpp +index b5823b308..a474436e1 100644 +--- a/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.cpp ++++ b/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.cpp +@@ -19,18 +19,15 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + namespace Dialogs { + + void ShowSearchFromBox( +- not_null<Window::SessionNavigation*> navigation, + not_null<PeerData*> peer, + Fn<void(not_null<UserData*>)> callback, + Fn<void()> closedCallback) { + auto createController = [ +- navigation, + peer, + callback = std::move(callback) + ]() -> std::unique_ptr<PeerListController> { + if (peer && (peer->isChat() || peer->isMegagroup())) { + return std::make_unique<Dialogs::SearchFromController>( +- navigation, + peer, + std::move(callback)); + } +@@ -50,18 +47,18 @@ void ShowSearchFromBox( + } + + SearchFromController::SearchFromController( +- not_null<Window::SessionNavigation*> navigation, + not_null<PeerData*> peer, + Fn<void(not_null<UserData*>)> callback) +-: ParticipantsBoxController( +- navigation, ++: AddSpecialBoxController( + peer, +- ParticipantsBoxController::Role::Members) ++ ParticipantsBoxController::Role::Members, ++ AdminDoneCallback(), ++ BannedDoneCallback()) + , _callback(std::move(callback)) { + } + + void SearchFromController::prepare() { +- ParticipantsBoxController::prepare(); ++ AddSpecialBoxController::prepare(); + delegate()->peerListSetTitle(tr::lng_search_messages_from()); + } + +diff --git a/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.h b/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.h +index 3a45b7b5c..709353bb5 100644 +--- a/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.h ++++ b/Telegram/SourceFiles/dialogs/dialogs_search_from_controllers.h +@@ -8,20 +8,18 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL + #pragma once + + #include "boxes/peer_list_box.h" +-#include "boxes/peers/edit_participants_box.h" ++#include "boxes/peers/add_participants_box.h" + + namespace Dialogs { + + void ShowSearchFromBox( +- not_null<Window::SessionNavigation*> navigation, + not_null<PeerData*> peer, + Fn<void(not_null<UserData*>)> callback, + Fn<void()> closedCallback); + +-class SearchFromController : public ParticipantsBoxController { ++class SearchFromController : public AddSpecialBoxController { + public: + SearchFromController( +- not_null<Window::SessionNavigation*> navigation, + not_null<PeerData*> peer, + Fn<void(not_null<UserData*>)> callback); + +@@ -29,7 +27,7 @@ public: + void rowClicked(not_null<PeerListRow*> row) override; + + protected: +- std::unique_ptr<PeerListRow> createRow(not_null<UserData*> user) const override; ++ std::unique_ptr<PeerListRow> createRow(not_null<UserData*> user) const; + + private: + Fn<void(not_null<UserData*>)> _callback; +diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +index 68797353e..888b2dc4d 100644 +--- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp ++++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +@@ -1322,7 +1322,6 @@ void Widget::showSearchFrom() { + if (const auto peer = _searchInChat.peer()) { + const auto chat = _searchInChat; + ShowSearchFromBox( +- controller(), + peer, + crl::guard(this, [=](not_null<UserData*> user) { + Ui::hideLayer();
\ No newline at end of file |