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(); const auto media = item->media();
auto inputMedia = media->photo() auto inputMedia = media->photo()
? MTP_inputMediaPhoto(MTP_flags(0), media->photo()->mtpInput(), MTPint()) ? 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() auto caption = cForwardCaptioned()
? item->originalText() ? item->originalText()
: TextWithEntities(); : TextWithEntities();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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