mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-03 08:05:12 +00:00
Updated TDesktop sources to 2.5.1+feff514
This commit is contained in:
@@ -524,8 +524,10 @@ void Widget::refreshFolderTopBar() {
|
||||
updateControlsGeometry();
|
||||
}
|
||||
_folderTopBar->setActiveChat(
|
||||
_openedFolder,
|
||||
HistoryView::TopBarWidget::Section::History,
|
||||
HistoryView::TopBarWidget::ActiveChat{
|
||||
.key = _openedFolder,
|
||||
.section = Dialogs::EntryState::Section::ChatsList,
|
||||
},
|
||||
nullptr);
|
||||
} else {
|
||||
_folderTopBar.destroy();
|
||||
@@ -851,12 +853,12 @@ bool Widget::onSearchMessages(bool searchCache) {
|
||||
MTP_int(0),
|
||||
MTP_int(0)
|
||||
)).done([=](const MTPmessages_Messages &result) {
|
||||
searchReceived(type, result, _searchRequest);
|
||||
_searchInHistoryRequest = 0;
|
||||
searchReceived(type, result, _searchRequest);
|
||||
finish();
|
||||
}).fail([=](const RPCError &error) {
|
||||
searchFailed(type, error, _searchRequest);
|
||||
_searchInHistoryRequest = 0;
|
||||
searchFailed(type, error, _searchRequest);
|
||||
finish();
|
||||
}).send();
|
||||
_searchQueries.emplace(_searchRequest, _searchQuery);
|
||||
@@ -1279,7 +1281,15 @@ void Widget::searchFailed(
|
||||
SearchRequestType type,
|
||||
const RPCError &error,
|
||||
mtpRequestId requestId) {
|
||||
if (_searchRequest == requestId) {
|
||||
if (error.type() == qstr("SEARCH_QUERY_EMPTY")) {
|
||||
searchReceived(
|
||||
type,
|
||||
MTP_messages_messages(
|
||||
MTP_vector<MTPMessage>(),
|
||||
MTP_vector<MTPChat>(),
|
||||
MTP_vector<MTPUser>()),
|
||||
requestId);
|
||||
} else if (_searchRequest == requestId) {
|
||||
_searchRequest = 0;
|
||||
if (type == SearchRequestType::MigratedFromStart || type == SearchRequestType::MigratedFromOffset) {
|
||||
_searchFullMigrated = true;
|
||||
@@ -1775,7 +1785,7 @@ bool Widget::onCancelSearch() {
|
||||
if (const auto peer = _searchInChat.peer()) {
|
||||
Ui::showPeerHistory(peer, ShowAtUnreadMsgId);
|
||||
//} else if (const auto feed = _searchInChat.feed()) { // #feed
|
||||
// controller()->showSection(HistoryFeed::Memento(feed));
|
||||
// controller()->showSection(std::make_shared<HistoryFeed::Memento>(feed));
|
||||
} else {
|
||||
Unexpected("Empty key in onCancelSearch().");
|
||||
}
|
||||
@@ -1793,11 +1803,13 @@ bool Widget::onCancelSearch() {
|
||||
void Widget::onCancelSearchInChat() {
|
||||
cancelSearchRequest();
|
||||
if (_searchInChat) {
|
||||
if (Adaptive::OneColumn() && !controller()->selectingPeer()) {
|
||||
if (Adaptive::OneColumn()
|
||||
&& !controller()->selectingPeer()
|
||||
&& _filter->getLastText().trimmed().isEmpty()) {
|
||||
if (const auto peer = _searchInChat.peer()) {
|
||||
Ui::showPeerHistory(peer, ShowAtUnreadMsgId);
|
||||
//} else if (const auto feed = _searchInChat.feed()) { // #feed
|
||||
// controller()->showSection(HistoryFeed::Memento(feed));
|
||||
// controller()->showSection(std::make_shared<HistoryFeed::Memento>(feed));
|
||||
} else {
|
||||
Unexpected("Empty key in onCancelSearchInPeer().");
|
||||
}
|
||||
|
Reference in New Issue
Block a user