Post-merge fixes

This commit is contained in:
Eric Kotato 2020-12-24 17:05:17 +03:00
parent 6230ec59dd
commit 0fe738ee3a
7 changed files with 20 additions and 12 deletions

View file

@ -4109,7 +4109,7 @@ void ApiWrap::forwardMessages(
const auto media = item->media();
auto inputMedia = media->photo()
? MTP_inputMediaPhoto(MTP_flags(0), media->photo()->mtpInput(), MTPint())
: MTP_inputMediaDocument(MTP_flags(0), media->document()->mtpInput(), MTPint());
: MTP_inputMediaDocument(MTP_flags(0), media->document()->mtpInput(), MTPint(), MTPstring());
auto caption = cForwardCaptioned()
? item->originalText()
: TextWithEntities();

View file

@ -24,6 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "apiwrap.h"
#include "mainwidget.h"
#include "styles/style_dialogs.h"
#include "styles/style_widgets.h"
namespace Data {
namespace {

View file

@ -263,6 +263,8 @@ void paintOneLineRow(
p.fillRect(fullRect, bg);
row->paintRipple(p, 0, 0, fullWidth, &ripple->c);
const auto history = chat.history();
if (flags & Flag::SavedMessages) {
Ui::EmptyUserpic::PaintSavedMessages(
p,
@ -274,7 +276,8 @@ void paintOneLineRow(
row->paintUserpic(
p,
from,
(flags & Flag::AllowUserOnline),
(flags & Flag::AllowUserOnline) ? history : nullptr,
ms,
active,
fullWidth);
} else if (hiddenSenderInfo) {
@ -302,7 +305,6 @@ void paintOneLineRow(
return;
}
const auto history = chat.history();
auto namewidth = fullWidth - nameleft - st::dialogsPadding.x();
auto rectForName = QRect(
nameleft,

View file

@ -404,7 +404,7 @@ HistoryWidget::HistoryWidget(
_fieldAutocomplete->mentionChosen(
) | rpl::start_with_next([=](FieldAutocomplete::MentionChosen data) {
onMentionInsert(data.user, data.method);
insertMention(data.user, data.method);
}, lifetime());
_fieldAutocomplete->hashtagChosen(
@ -1341,7 +1341,7 @@ void HistoryWidget::start() {
});
}
void HistoryWidget::onMentionInsert(UserData *user, FieldAutocomplete::ChooseMethod method) {
void HistoryWidget::insertMention(UserData *user, FieldAutocomplete::ChooseMethod method) {
QString replacement, entityTag;
if (user->username.isEmpty()
|| method == FieldAutocomplete::ChooseMethod::ByRightClick
@ -1730,7 +1730,7 @@ void HistoryWidget::setupShortcuts() {
});
}
request->check(Command::SaveDraft, 1) && request->handle([=] {
onCloudDraftSave();
saveCloudDraft();
return true;
});
request->check(Command::JumpToDate, 1) && request->handle([=] {

View file

@ -1098,10 +1098,13 @@ void ComposeControls::initAutocomplete() {
_field->insertTag(string);
}
};
const auto insertMention = [=](not_null<UserData*> user) {
const auto insertMention = [=](not_null<UserData*> user, FieldAutocomplete::ChooseMethod method) {
auto replacement = QString();
auto entityTag = QString();
if (user->username.isEmpty()) {
if (user->username.isEmpty()
|| method == FieldAutocomplete::ChooseMethod::ByRightClick
|| method == FieldAutocomplete::ChooseMethod::ByCtrlEnter
|| method == FieldAutocomplete::ChooseMethod::ByCtrlClick) {
_field->insertTag(
user->firstName.isEmpty() ? user->name : user->firstName,
PrepareMentionTag(user));
@ -1112,7 +1115,7 @@ void ComposeControls::initAutocomplete() {
_autocomplete->mentionChosen(
) | rpl::start_with_next([=](FieldAutocomplete::MentionChosen data) {
insertMention(data.user);
insertMention(data.user, data.method);
}, _autocomplete->lifetime());
_autocomplete->hashtagChosen(

View file

@ -1023,8 +1023,10 @@ void ManageFiller::addChannelRecentActions(
_wrap,
tr::lng_manage_peer_recent_actions(),
rpl::single(true),
[=] { controller->showSection(AdminLog::SectionMemento(channel)); }
);
[=] {
controller->showSection(
std::make_shared<AdminLog::SectionMemento>(channel));
});
object_ptr<FloatingIcon>(
button,
st::infoIconRecentActions,

View file

@ -1311,7 +1311,7 @@ QPointer<Ui::RpWidget> ShowForwardMessagesBox(
const auto media = item->media();
const auto inputMedia = media->photo()
? MTP_inputMediaPhoto(MTP_flags(0), media->photo()->mtpInput(), MTPint())
: MTP_inputMediaDocument(MTP_flags(0), media->document()->mtpInput(), MTPint());
: MTP_inputMediaDocument(MTP_flags(0), media->document()->mtpInput(), MTPint(), MTPstring());
const auto caption = cForwardCaptioned()
? item->originalText()
: TextWithEntities();