MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / serviceNotification

Method serviceNotification

Telegram/SourceFiles/data/data_session.cpp:5374–5416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5372}
5373
5374void 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
5418void Session::insertCheckedServiceNotification(
5419 const TextWithEntities &message,

Callers 3

addLocalLogMethod · 0.80
feedUpdateMethod · 0.80
updateRequestFinishedMethod · 0.80

Calls 7

historyMethod · 0.95
MTP_flagsFunction · 0.85
MTP_longFunction · 0.85
peerToUserFunction · 0.85
MTP_stringFunction · 0.85
requestDialogEntryMethod · 0.80
folderKnownMethod · 0.45

Tested by

no test coverage detected