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

cloud synced report spam panel visibility

This commit is contained in:
John Preston
2016-03-12 19:32:28 +03:00
parent 17aaa5ceab
commit 5aa5a62b74
6 changed files with 128 additions and 97 deletions

View File

@@ -433,8 +433,8 @@ namespace App {
data->setBotInfoVersion(-1);
}
data->contact = (d.is_contact() || d.is_mutual_contact()) ? 1 : (data->phone.isEmpty() ? -1 : 0);
if (data->contact == 1 && cReportSpamStatuses().value(data->id, dbiprsNoButton) != dbiprsNoButton) {
cRefReportSpamStatuses().insert(data->id, dbiprsNoButton);
if (data->contact == 1 && cReportSpamStatuses().value(data->id, dbiprsHidden) != dbiprsHidden) {
cRefReportSpamStatuses().insert(data->id, dbiprsHidden);
Local::writeReportSpamStatuses();
}
if (d.is_self() && ::self != data) {
@@ -1158,8 +1158,8 @@ namespace App {
switch (myLink.type()) {
case mtpc_contactLinkContact:
user->contact = 1;
if (user->contact == 1 && cReportSpamStatuses().value(user->id, dbiprsNoButton) != dbiprsNoButton) {
cRefReportSpamStatuses().insert(user->id, dbiprsNoButton);
if (user->contact == 1 && cReportSpamStatuses().value(user->id, dbiprsHidden) != dbiprsHidden) {
cRefReportSpamStatuses().insert(user->id, dbiprsHidden);
Local::writeReportSpamStatuses();
}
break;