2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Update topic mute state on history mute changes.

This commit is contained in:
John Preston
2022-10-13 22:02:31 +04:00
parent d92580b8fc
commit b68ffcd75d
6 changed files with 36 additions and 2 deletions

View File

@@ -452,8 +452,19 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupMuteToggle() {
if (button == Qt::RightButton) {
return true;
}
if (notifySettings->isMuted(peer)) {
notifySettings->update(peer, { .unmute = true });
const auto topic = topicRootId
? peer->forumTopicFor(topicRootId)
: nullptr;
Assert(!topicRootId || topic != nullptr);
const auto is = topic
? notifySettings->isMuted(topic)
: notifySettings->isMuted(peer);
if (is) {
if (topic) {
notifySettings->update(topic, { .unmute = true });
} else {
notifySettings->update(peer, { .unmute = true });
}
return false;
} else {
return true;