mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Respect invert_media in service notifications.
This commit is contained in:
parent
17578be4b9
commit
041ec1157f
3 changed files with 21 additions and 10 deletions
|
@ -2071,7 +2071,10 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
|||
windows.front()->window().show(Ui::MakeInformBox(text));
|
||||
}
|
||||
} else {
|
||||
session().data().serviceNotification(text, d.vmedia());
|
||||
session().data().serviceNotification(
|
||||
text,
|
||||
d.vmedia(),
|
||||
d.is_invert_media());
|
||||
session().api().authorizations().reload();
|
||||
}
|
||||
} break;
|
||||
|
|
|
@ -4347,7 +4347,8 @@ auto Session::dialogsRowReplacements() const
|
|||
|
||||
void Session::serviceNotification(
|
||||
const TextWithEntities &message,
|
||||
const MTPMessageMedia &media) {
|
||||
const MTPMessageMedia &media,
|
||||
bool invertMedia) {
|
||||
const auto date = base::unixtime::now();
|
||||
if (!peerLoaded(PeerData::kServiceNotificationsId)) {
|
||||
processUser(MTP_user(
|
||||
|
@ -4375,22 +4376,27 @@ void Session::serviceNotification(
|
|||
MTPlong())); // background_emoji_id
|
||||
}
|
||||
const auto history = this->history(PeerData::kServiceNotificationsId);
|
||||
const auto insert = [=] {
|
||||
insertCheckedServiceNotification(message, media, date, invertMedia);
|
||||
};
|
||||
if (!history->folderKnown()) {
|
||||
histories().requestDialogEntry(history, [=] {
|
||||
insertCheckedServiceNotification(message, media, date);
|
||||
});
|
||||
histories().requestDialogEntry(history, insert);
|
||||
} else {
|
||||
insertCheckedServiceNotification(message, media, date);
|
||||
insert();
|
||||
}
|
||||
}
|
||||
|
||||
void Session::insertCheckedServiceNotification(
|
||||
const TextWithEntities &message,
|
||||
const MTPMessageMedia &media,
|
||||
TimeId date) {
|
||||
TimeId date,
|
||||
bool invertMedia) {
|
||||
const auto flags = MTPDmessage::Flag::f_entities
|
||||
| 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
|
||||
| MessageFlag::Local;
|
||||
auto sending = TextWithEntities(), left = message;
|
||||
|
|
|
@ -705,7 +705,8 @@ public:
|
|||
|
||||
void serviceNotification(
|
||||
const TextWithEntities &message,
|
||||
const MTPMessageMedia &media = MTP_messageMediaEmpty());
|
||||
const MTPMessageMedia &media = MTP_messageMediaEmpty(),
|
||||
bool invertMedia = false);
|
||||
|
||||
void setMimeForwardIds(MessageIdsList &&list);
|
||||
MessageIdsList takeMimeForwardIds();
|
||||
|
@ -851,7 +852,8 @@ private:
|
|||
void insertCheckedServiceNotification(
|
||||
const TextWithEntities &message,
|
||||
const MTPMessageMedia &media,
|
||||
TimeId date);
|
||||
TimeId date,
|
||||
bool invertMedia);
|
||||
|
||||
void setWallpapers(const QVector<MTPWallPaper> &data, uint64 hash);
|
||||
void highlightProcessDone(uint64 processId);
|
||||
|
|
Loading…
Add table
Reference in a new issue