mirror of https://github.com/procxx/kepka.git
Fixed editing of the last message on KeyUp.
Skip stickers, video-messages, call-messages and edit following message.
This commit is contained in:
parent
31e3a426a6
commit
dc8abc74ed
|
@ -18,6 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "styles/style_dialogs.h"
|
#include "styles/style_dialogs.h"
|
||||||
#include "data/data_drafts.h"
|
#include "data/data_drafts.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
|
#include "data/data_media_types.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
#include "mainwidget.h"
|
#include "mainwidget.h"
|
||||||
|
@ -2405,6 +2406,10 @@ HistoryItem *History::lastSentMessage() const {
|
||||||
for (const auto &block : base::reversed(blocks)) {
|
for (const auto &block : base::reversed(blocks)) {
|
||||||
for (const auto &message : base::reversed(block->messages)) {
|
for (const auto &message : base::reversed(block->messages)) {
|
||||||
const auto item = message->data();
|
const auto item = message->data();
|
||||||
|
// Skip if message is video message or sticker.
|
||||||
|
if (const auto media = item->media()) {
|
||||||
|
if (!media->allowsEditCaption()) continue;
|
||||||
|
}
|
||||||
if (IsServerMsgId(item->id)
|
if (IsServerMsgId(item->id)
|
||||||
&& !item->serviceMsg()
|
&& !item->serviceMsg()
|
||||||
&& (item->out() || peer->isSelf())) {
|
&& (item->out() || peer->isSelf())) {
|
||||||
|
|
Loading…
Reference in New Issue