mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-04 19:03:42 +00:00
Merge tag 'v5.5.3' into dev
# Conflicts: # Telegram/Resources/winrc/Telegram.rc # Telegram/Resources/winrc/Updater.rc # Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp # Telegram/SourceFiles/core/version.h # Telegram/SourceFiles/history/history_widget.cpp # Telegram/SourceFiles/history/view/history_view_element.cpp # Telegram/lib_tl # Telegram/lib_ui # lib/xdg/org.telegram.desktop.metainfo.xml # snap/snapcraft.yaml
This commit is contained in:
@@ -34,6 +34,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/resize_area.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/toast/toast.h"
|
||||
#include "ui/ui_utility.h"
|
||||
#include "window/window_connecting_widget.h"
|
||||
#include "window/window_top_bar_wrap.h"
|
||||
#include "window/notifications_manager.h"
|
||||
@@ -43,6 +44,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "window/window_controller.h"
|
||||
#include "window/window_peer_menu.h"
|
||||
#include "window/themes/window_theme.h"
|
||||
#include "chat_helpers/bot_command.h"
|
||||
#include "chat_helpers/tabbed_selector.h" // TabbedSelector::refreshStickers
|
||||
#include "chat_helpers/message_field.h"
|
||||
#include "info/info_memento.h"
|
||||
@@ -93,6 +95,16 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QMimeData>
|
||||
|
||||
namespace {
|
||||
|
||||
void ClearBotStartToken(PeerData *peer) {
|
||||
if (peer && peer->isUser() && peer->asUser()->isBot()) {
|
||||
peer->asUser()->botInfo->startToken = QString();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
enum StackItemType {
|
||||
HistoryStackItem,
|
||||
SectionStackItem,
|
||||
@@ -1062,16 +1074,6 @@ SendMenu::Details MainWidget::sendMenuDetails() const {
|
||||
return _history->sendMenuDetails();
|
||||
}
|
||||
|
||||
bool MainWidget::sendExistingDocument(not_null<DocumentData*> document) {
|
||||
return sendExistingDocument(document, {});
|
||||
}
|
||||
|
||||
bool MainWidget::sendExistingDocument(
|
||||
not_null<DocumentData*> document,
|
||||
Api::SendOptions options) {
|
||||
return _history->sendExistingDocument(document, options);
|
||||
}
|
||||
|
||||
void MainWidget::dialogsCancelled() {
|
||||
if (_hider) {
|
||||
_hider->startHide();
|
||||
@@ -1215,16 +1217,6 @@ void MainWidget::setInnerFocus() {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWidget::clearBotStartToken(PeerData *peer) {
|
||||
if (peer && peer->isUser() && peer->asUser()->isBot()) {
|
||||
peer->asUser()->botInfo->startToken = QString();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWidget::ctrlEnterSubmitUpdated() {
|
||||
_history->updateFieldSubmitSettings();
|
||||
}
|
||||
|
||||
void MainWidget::showChooseReportMessages(
|
||||
not_null<PeerData*> peer,
|
||||
Ui::ReportReason reason,
|
||||
@@ -1252,7 +1244,8 @@ bool MainWidget::showHistoryInDifferentWindow(
|
||||
const SectionShow ¶ms,
|
||||
MsgId showAtMsgId) {
|
||||
if (!peerId) {
|
||||
return false;
|
||||
// In case we don't have dialogs, we can't clear section stack.
|
||||
return !_dialogs;
|
||||
}
|
||||
const auto peer = session().data().peer(peerId);
|
||||
if (const auto separateChat = _controller->windowId().chat()) {
|
||||
@@ -1304,7 +1297,9 @@ void MainWidget::showHistory(
|
||||
if (peer->migrateTo()) {
|
||||
peer = peer->migrateTo();
|
||||
peerId = peer->id;
|
||||
if (showAtMsgId > 0) showAtMsgId = -showAtMsgId;
|
||||
if (showAtMsgId > 0) {
|
||||
showAtMsgId = -showAtMsgId;
|
||||
}
|
||||
}
|
||||
const auto unavailable = peer->computeUnavailableReason();
|
||||
if (!unavailable.isEmpty()) {
|
||||
@@ -1359,7 +1354,7 @@ void MainWidget::showHistory(
|
||||
bool foundInStack = !peerId;
|
||||
if (foundInStack || (way == Way::ClearStack)) {
|
||||
for (const auto &item : _stack) {
|
||||
clearBotStartToken(item->peer());
|
||||
ClearBotStartToken(item->peer());
|
||||
}
|
||||
_stack.clear();
|
||||
} else {
|
||||
@@ -1367,7 +1362,7 @@ void MainWidget::showHistory(
|
||||
if (_stack.at(i)->type() == HistoryStackItem && _stack.at(i)->peer()->id == peerId) {
|
||||
foundInStack = true;
|
||||
while (int(_stack.size()) > i + 1) {
|
||||
clearBotStartToken(_stack.back()->peer());
|
||||
ClearBotStartToken(_stack.back()->peer());
|
||||
_stack.pop_back();
|
||||
}
|
||||
_stack.pop_back();
|
||||
@@ -1429,7 +1424,7 @@ void MainWidget::showHistory(
|
||||
if (_history->peer()
|
||||
&& _history->peer()->id != peerId
|
||||
&& way != Way::Forward) {
|
||||
clearBotStartToken(_history->peer());
|
||||
ClearBotStartToken(_history->peer());
|
||||
}
|
||||
_history->showHistory(
|
||||
peerId,
|
||||
@@ -1995,8 +1990,8 @@ bool MainWidget::showBackFromStack(const SectionShow ¶ms) {
|
||||
}
|
||||
auto item = std::move(_stack.back());
|
||||
_stack.pop_back();
|
||||
if (auto currentHistoryPeer = _history->peer()) {
|
||||
clearBotStartToken(currentHistoryPeer);
|
||||
if (const auto currentHistoryPeer = _history->peer()) {
|
||||
ClearBotStartToken(currentHistoryPeer);
|
||||
}
|
||||
_thirdSectionFromStack = item->takeThirdSectionMemento();
|
||||
if (item->type() == HistoryStackItem) {
|
||||
|
||||
Reference in New Issue
Block a user