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

Remove Notify::userIsContactChanged().

Replace with Notify::peerUpdatedDelayed().
This commit is contained in:
John Preston
2018-01-04 12:21:06 +03:00
parent 139ef5411a
commit 46612ef128
18 changed files with 249 additions and 134 deletions

View File

@@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "messenger.h"
#include "mainwindow.h"
#include "window/window_controller.h"
#include "storage/localstorage.h"
#include "ui/empty_userpic.h"
#include "ui/text_options.h"
@@ -348,7 +349,26 @@ const Text &BotCommand::descriptionText() const {
}
bool UserData::canShareThisContact() const {
return canShareThisContactFast() || !App::phoneFromSharedContact(peerToUser(id)).isEmpty();
return canShareThisContactFast()
|| !App::phoneFromSharedContact(peerToUser(id)).isEmpty();
}
void UserData::setContactStatus(ContactStatus status) {
if (_contactStatus != status) {
const auto changed = (_contactStatus == ContactStatus::Contact)
!= (status == ContactStatus::Contact);
_contactStatus = status;
if (changed) {
Notify::peerUpdatedDelayed(
this,
Notify::PeerUpdate::Flag::UserIsContact);
}
}
if (_contactStatus == ContactStatus::Contact
&& cReportSpamStatuses().value(id, dbiprsHidden) != dbiprsHidden) {
cRefReportSpamStatuses().insert(id, dbiprsHidden);
Local::writeReportSpamStatuses();
}
}
// see Local::readPeer as well