Allow editing last sent saved message by up key.

Also update libtgvoip.
Also replace 🤷 with a shrug.
This commit is contained in:
John Preston 2018-05-15 21:11:29 +03:00
parent 5f063c0151
commit 4bcd1e3c59
4 changed files with 13 additions and 2 deletions

View File

@ -121,6 +121,9 @@ MessageField::MessageField(QWidget *parent, not_null<Window::Controller*> contro
addInstantReplace("--", QString(1, QChar(8212)));
addInstantReplace("<<", QString(1, QChar(171)));
addInstantReplace(">>", QString(1, QChar(187)));
addInstantReplace(
":shrug:",
QChar(175) + QString("\\_(") + QChar(12484) + ")_/" + QChar(175));
const auto &replacements = Ui::Emoji::internal::GetAllReplacements();
for (const auto &one : replacements) {
const auto with = Ui::Emoji::QStringFromUTF16(one.emoji);

View File

@ -315,6 +315,13 @@ Replaces PrepareReplaces(const QString &filename) {
auto name = getString("name");
auto replacement = getString("alpha_code");
auto aliases = getString("aliases").split('|');
const auto Exceptions = { ":shrug:" };
for (const auto &exception : Exceptions) {
const auto index = aliases.indexOf(exception);
if (index >= 0) {
aliases.removeAt(index);
}
}
if (aliases.size() == 1 && aliases[0].isEmpty()) {
aliases.clear();
}

View File

@ -2284,7 +2284,8 @@ HistoryItem *History::lastSentMessage() const {
for (const auto &block : base::reversed(blocks)) {
for (const auto &message : base::reversed(block->messages)) {
const auto item = message->data();
if (IsServerMsgId(item->id) && item->out()) {
if (IsServerMsgId(item->id)
&& (item->out() || peer->isSelf())) {
return item;
}
}

@ -1 +1 @@
Subproject commit 3d82d03bbb03c0cdb11bcaa399c01a57671044d8
Subproject commit ed3a899bbe26c56dc25e40730ca6d0e95f59717d