Apply webpage media from sent message via bot.

This commit is contained in:
John Preston 2018-02-24 02:46:35 +03:00
parent 00aa6d5ac3
commit a285dca39e
5 changed files with 19 additions and 5 deletions

View File

@ -732,6 +732,8 @@ void HistoryMessage::refreshSentMedia(const MTPMessageMedia *media) {
refreshMedia(media);
if (wasGrouped) {
Auth().data().groups().refreshMessage(this);
} else {
Auth().data().requestItemViewRefresh(this);
}
}

View File

@ -2235,7 +2235,9 @@ void HistoryWidget::destroyUnreadBar() {
if (_migrated) _migrated->destroyUnreadBar();
}
void HistoryWidget::newUnreadMsg(History *history, HistoryItem *item) {
void HistoryWidget::newUnreadMsg(
not_null<History*> history,
not_null<HistoryItem*> item) {
if (_history == history) {
// If we get here in non-resized state we can't rely on results of
// doWeReadServerHistory() and mark chat as read.
@ -2256,7 +2258,11 @@ void HistoryWidget::newUnreadMsg(History *history, HistoryItem *item) {
}
}
Auth().notifications().schedule(history, item);
history->changeUnreadCount(1);
if (history->unreadCountKnown()) {
history->changeUnreadCount(1);
} else {
Auth().api().requestDialogEntry(history);
}
}
void HistoryWidget::historyToDown(History *history) {

View File

@ -201,7 +201,9 @@ public:
void firstLoadMessages();
void delayedShowAt(MsgId showAtMsgId);
void newUnreadMsg(History *history, HistoryItem *item);
void newUnreadMsg(
not_null<History*> history,
not_null<HistoryItem*> item);
void historyToDown(History *history);
void unreadCountChanged(not_null<History*> history);

View File

@ -2684,7 +2684,9 @@ void MainWidget::dialogsToUp() {
_dialogs->dialogsToUp();
}
void MainWidget::newUnreadMsg(History *history, HistoryItem *item) {
void MainWidget::newUnreadMsg(
not_null<History*> history,
not_null<HistoryItem*> item) {
_history->newUnreadMsg(history, item);
}

View File

@ -125,7 +125,9 @@ public:
const MTPUpdates &updates);
void historyToDown(History *hist);
void dialogsToUp();
void newUnreadMsg(History *history, HistoryItem *item);
void newUnreadMsg(
not_null<History*> history,
not_null<HistoryItem*> item);
void markActiveHistoryAsRead();
Dialogs::RowDescriptor chatListEntryBefore(