2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

report spam almost done

This commit is contained in:
John Preston
2015-09-08 20:22:29 +03:00
parent 28e09ab39e
commit 7a278729e1
15 changed files with 2423 additions and 2273 deletions

View File

@@ -446,6 +446,10 @@ namespace App {
data->setBotInfoVersion(-1);
}
data->contact = (flags & (MTPDuser_flag_contact | MTPDuser_flag_mutual_contact)) ? 1 : (data->phone.isEmpty() ? -1 : 0);
if (data->contact == 1 && cReportSpamStatuses().value(data->id, dbiprsNoButton) != dbiprsNoButton) {
cRefReportSpamStatuses().insert(data->id, dbiprsNoButton);
Local::writeReportSpamStatuses();
}
if ((flags & MTPDuser_flag_self) && ::self != data) {
::self = data;
if (App::wnd()) App::wnd()->updateGlobalMenu();
@@ -875,6 +879,10 @@ 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);
Local::writeReportSpamStatuses();
}
break;
case mtpc_contactLinkHasPhone:
user->contact = 0;