| 5372 | } |
| 5373 | |
| 5374 | void Session::serviceNotification( |
| 5375 | const TextWithEntities &message, |
| 5376 | const MTPMessageMedia &media, |
| 5377 | bool invertMedia) { |
| 5378 | const auto date = base::unixtime::now(); |
| 5379 | if (!peerLoaded(PeerData::kServiceNotificationsId)) { |
| 5380 | processUser(MTP_user( |
| 5381 | MTP_flags( |
| 5382 | MTPDuser::Flag::f_first_name |
| 5383 | | MTPDuser::Flag::f_phone |
| 5384 | | MTPDuser::Flag::f_status |
| 5385 | | MTPDuser::Flag::f_verified), |
| 5386 | MTP_long(peerToUser(PeerData::kServiceNotificationsId).bare), |
| 5387 | MTPlong(), // access_hash |
| 5388 | MTP_string("Telegram"), |
| 5389 | MTPstring(), // last_name |
| 5390 | MTPstring(), // username |
| 5391 | MTP_string("42777"), |
| 5392 | MTP_userProfilePhotoEmpty(), |
| 5393 | MTP_userStatusRecently(MTP_flags(0)), |
| 5394 | MTPint(), // bot_info_version |
| 5395 | MTPVector<MTPRestrictionReason>(), |
| 5396 | MTPstring(), // bot_inline_placeholder |
| 5397 | MTPstring(), // lang_code |
| 5398 | MTPEmojiStatus(), |
| 5399 | MTPVector<MTPUsername>(), |
| 5400 | MTPRecentStory(), |
| 5401 | MTPPeerColor(), // color |
| 5402 | MTPPeerColor(), // profile_color |
| 5403 | MTPint(), // bot_active_users |
| 5404 | MTPlong(), // bot_verification_icon |
| 5405 | MTPlong())); // send_paid_messages_stars |
| 5406 | } |
| 5407 | const auto history = this->history(PeerData::kServiceNotificationsId); |
| 5408 | const auto insert = [=] { |
| 5409 | insertCheckedServiceNotification(message, media, date, invertMedia); |
| 5410 | }; |
| 5411 | if (!history->folderKnown()) { |
| 5412 | histories().requestDialogEntry(history, insert); |
| 5413 | } else { |
| 5414 | insert(); |
| 5415 | } |
| 5416 | } |
| 5417 | |
| 5418 | void Session::insertCheckedServiceNotification( |
| 5419 | const TextWithEntities &message, |
no test coverage detected