Respect invert_media in service notifications.
This commit is contained in:
parent
17578be4b9
commit
041ec1157f
|
@ -2071,7 +2071,10 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
||||||
windows.front()->window().show(Ui::MakeInformBox(text));
|
windows.front()->window().show(Ui::MakeInformBox(text));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
session().data().serviceNotification(text, d.vmedia());
|
session().data().serviceNotification(
|
||||||
|
text,
|
||||||
|
d.vmedia(),
|
||||||
|
d.is_invert_media());
|
||||||
session().api().authorizations().reload();
|
session().api().authorizations().reload();
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
|
@ -4347,7 +4347,8 @@ auto Session::dialogsRowReplacements() const
|
||||||
|
|
||||||
void Session::serviceNotification(
|
void Session::serviceNotification(
|
||||||
const TextWithEntities &message,
|
const TextWithEntities &message,
|
||||||
const MTPMessageMedia &media) {
|
const MTPMessageMedia &media,
|
||||||
|
bool invertMedia) {
|
||||||
const auto date = base::unixtime::now();
|
const auto date = base::unixtime::now();
|
||||||
if (!peerLoaded(PeerData::kServiceNotificationsId)) {
|
if (!peerLoaded(PeerData::kServiceNotificationsId)) {
|
||||||
processUser(MTP_user(
|
processUser(MTP_user(
|
||||||
|
@ -4375,22 +4376,27 @@ void Session::serviceNotification(
|
||||||
MTPlong())); // background_emoji_id
|
MTPlong())); // background_emoji_id
|
||||||
}
|
}
|
||||||
const auto history = this->history(PeerData::kServiceNotificationsId);
|
const auto history = this->history(PeerData::kServiceNotificationsId);
|
||||||
|
const auto insert = [=] {
|
||||||
|
insertCheckedServiceNotification(message, media, date, invertMedia);
|
||||||
|
};
|
||||||
if (!history->folderKnown()) {
|
if (!history->folderKnown()) {
|
||||||
histories().requestDialogEntry(history, [=] {
|
histories().requestDialogEntry(history, insert);
|
||||||
insertCheckedServiceNotification(message, media, date);
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
insertCheckedServiceNotification(message, media, date);
|
insert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::insertCheckedServiceNotification(
|
void Session::insertCheckedServiceNotification(
|
||||||
const TextWithEntities &message,
|
const TextWithEntities &message,
|
||||||
const MTPMessageMedia &media,
|
const MTPMessageMedia &media,
|
||||||
TimeId date) {
|
TimeId date,
|
||||||
|
bool invertMedia) {
|
||||||
const auto flags = MTPDmessage::Flag::f_entities
|
const auto flags = MTPDmessage::Flag::f_entities
|
||||||
| MTPDmessage::Flag::f_from_id
|
| MTPDmessage::Flag::f_from_id
|
||||||
| MTPDmessage::Flag::f_media;
|
| MTPDmessage::Flag::f_media
|
||||||
|
| (invertMedia
|
||||||
|
? MTPDmessage::Flag::f_invert_media
|
||||||
|
: MTPDmessage::Flag());
|
||||||
const auto localFlags = MessageFlag::ClientSideUnread
|
const auto localFlags = MessageFlag::ClientSideUnread
|
||||||
| MessageFlag::Local;
|
| MessageFlag::Local;
|
||||||
auto sending = TextWithEntities(), left = message;
|
auto sending = TextWithEntities(), left = message;
|
||||||
|
|
|
@ -705,7 +705,8 @@ public:
|
||||||
|
|
||||||
void serviceNotification(
|
void serviceNotification(
|
||||||
const TextWithEntities &message,
|
const TextWithEntities &message,
|
||||||
const MTPMessageMedia &media = MTP_messageMediaEmpty());
|
const MTPMessageMedia &media = MTP_messageMediaEmpty(),
|
||||||
|
bool invertMedia = false);
|
||||||
|
|
||||||
void setMimeForwardIds(MessageIdsList &&list);
|
void setMimeForwardIds(MessageIdsList &&list);
|
||||||
MessageIdsList takeMimeForwardIds();
|
MessageIdsList takeMimeForwardIds();
|
||||||
|
@ -851,7 +852,8 @@ private:
|
||||||
void insertCheckedServiceNotification(
|
void insertCheckedServiceNotification(
|
||||||
const TextWithEntities &message,
|
const TextWithEntities &message,
|
||||||
const MTPMessageMedia &media,
|
const MTPMessageMedia &media,
|
||||||
TimeId date);
|
TimeId date,
|
||||||
|
bool invertMedia);
|
||||||
|
|
||||||
void setWallpapers(const QVector<MTPWallPaper> &data, uint64 hash);
|
void setWallpapers(const QVector<MTPWallPaper> &data, uint64 hash);
|
||||||
void highlightProcessDone(uint64 processId);
|
void highlightProcessDone(uint64 processId);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user