Skip to content

Commit

Permalink
wip updates
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Sep 18, 2024
1 parent d243070 commit 5a47671
Showing 1 changed file with 35 additions and 21 deletions.
56 changes: 35 additions & 21 deletions Telegram/SourceFiles/api/api_updates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2881,6 +2881,10 @@ void Updates::applyUpdate(const TLupdate &update) {
owner.applyLastMessage(data);
}, [&](const TLDupdateChatPosition &data) {
owner.applyDialogPosition(data);
}, [&](const TLDupdateChatAddedToList &data) {
// todo
}, [&](const TLDupdateChatRemovedFromList &data) {
// todo
}, [&](const TLDupdateChatMessageSender &data) {
const auto peerId = peerFromTdbChat(data.vchat_id());
if (const auto peer = owner.peerLoaded(peerId)) {
Expand Down Expand Up @@ -2915,6 +2919,8 @@ void Updates::applyUpdate(const TLupdate &update) {
if (const auto history = owner.historyLoaded(peerId)) {
history->setUnreadMark(data.vis_marked_as_unread().v);
}
}, [&](const TLDupdateChatViewAsTopics &data) {
// todo
}, [&](const TLDupdateChatBlockList &data) {
const auto peerId = peerFromTdbChat(data.vchat_id());
if (const auto peer = session().data().peerLoaded(peerId)) {
Expand Down Expand Up @@ -2986,6 +2992,8 @@ void Updates::applyUpdate(const TLupdate &update) {
}
}, [&](const TLDupdateActiveEmojiReactions &data) {
owner.reactions().refreshActive(data);
}, [&](const TLDupdateAvailableMessageEffects &data) {
// todo
}, [&](const TLDupdateDefaultReactionType &data) {
owner.reactions().refreshFavorite(data);
}, [&](const TLDupdateChatNotificationSettings &data) {
Expand All @@ -3005,6 +3013,8 @@ void Updates::applyUpdate(const TLupdate &update) {
return Data::DefaultNotify::Broadcast;
});
owner.notifySettings().apply(type, data.vnotification_settings());
}, [&](const TLDupdateReactionNotificationSettings &data) {
// todo
}, [&](const TLDupdateChatMessageAutoDeleteTime &data) {
const auto peerId = peerFromTdbChat(data.vchat_id());
if (const auto peer = owner.peerLoaded(peerId)) {
Expand All @@ -3015,6 +3025,8 @@ void Updates::applyUpdate(const TLupdate &update) {
if (const auto peer = owner.peerLoaded(peerId)) {
peer->setActionBar(data.vaction_bar());
}
}, [&](const TLDupdateChatBusinessBotManageBar &data) {
// todo
}, [&](const TLDupdateChatBackground &data) {
const auto peerId = peerFromTdbChat(data.vchat_id());
if (const auto peer = owner.peerLoaded(peerId)) {
Expand Down Expand Up @@ -3055,6 +3067,8 @@ void Updates::applyUpdate(const TLupdate &update) {
history->applyPosition(position.data());
}
}
}, [&](const TLDupdateChatEmojiStatus &data) {
// todo
}, [&](const TLDupdateChatFolders &data) {
owner.chatsFilters().apply(data);
}, [&](const TLDupdateChatOnlineMemberCount &data) {
Expand Down Expand Up @@ -3168,11 +3182,12 @@ void Updates::applyUpdate(const TLupdate &update) {
session().data().stickers().apply(data);
}, [&](const TLDupdateSavedNotificationSounds &data) {
session().api().ringtones().applyUpdate();
}, [&](const TLDupdateSelectedBackground &data) {
}, [&](const TLDupdateDefaultBackground &data) {
}, [&](const TLDupdateChatThemes &data) {
session().data().cloudThemes().applyUpdate(data);
}, [&](const TLDupdateAccentColors &data) {
session().applyAccentColors(data);
}, [&](const TLDupdateProfileAccentColors &data) {
}, [&](const TLDupdateLanguagePackStrings &data) {
Lang::CurrentCloudManager().apply(data);
}, [&](const TLDupdateTermsOfService &data) {
Expand Down Expand Up @@ -3238,26 +3253,6 @@ void Updates::applyUpdate(const TLupdate &update) {
}, [&](const TLDupdateFileAddedToDownloads &data) {
}, [&](const TLDupdateFileDownload &data) {
}, [&](const TLDupdateFileRemovedFromDownloads &data) {
}, [&](const TLDupdateAddChatMembersPrivacyForbidden &data) {
const auto peerId = peerFromTdbChat(data.vchat_id());
if (const auto peer = owner.peerLoaded(peerId)) {
auto users = std::vector<not_null<UserData*>>();
for (const auto &id : data.vuser_ids().v) {
if (const auto user = owner.userLoaded(UserId(id.v))) {
users.push_back(user);
}
}
if (const auto window = Core::App().windowFor(peer)) {
if (const auto controller = window->sessionController()) {
if (&controller->session() == &peer->session()) {
ChatInviteForbidden(
window->uiShow(),
peer,
std::move(users));
}
}
}
}
}, [&](const TLDupdateAutosaveSettings &data) {
}, [&](const TLDupdateForumTopicInfo &data) {
const auto peerId = peerFromTdbChat(data.vchat_id());
Expand All @@ -3267,6 +3262,18 @@ void Updates::applyUpdate(const TLupdate &update) {
topic->applyInfo(data.vinfo());
}
}
}, [&](const TLDupdateOwnedStarCount &data) {
// todo
}, [&](const TLDupdateChatRevenueAmount &data) {
// todo
}, [&](const TLDupdateStarRevenueStatus &data) {
// todo
}, [&](const TLDupdateSpeechRecognitionTrial &data) {
// todo
}, [&](const TLDupdateSpeedLimitNotification &data) {
// todo
}, [&](const TLDupdateContactCloseBirthdays &data) {

}, [&](const TLDupdateStory &data) {
owner.stories().apply(data);
}, [&](const TLDupdateStoryDeleted &data) {
Expand All @@ -3278,6 +3285,13 @@ void Updates::applyUpdate(const TLupdate &update) {
}, [&](const TLDupdateStoryStealthMode &data) {
owner.stories().apply(data);

}, [&](const TLDupdateSavedMessagesTags &data) {
// todo
}, [&](const TLDupdateSavedMessagesTopic &data) {
// todo
}, [&](const TLDupdateSavedMessagesTopicCount &data) {
// todo

}, [&](const TLDupdateQuickReplyShortcut &data) {
owner.shortcutMessages().apply(data);
}, [&](const TLDupdateQuickReplyShortcutDeleted &data) {
Expand Down

0 comments on commit 5a47671

Please sign in to comment.