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

Use isConstant bool instead of ContactStatus enum.

This commit is contained in:
John Preston
2019-06-06 19:48:42 +03:00
parent 14b82698f8
commit 30dea3a2e7
9 changed files with 35 additions and 71 deletions

View File

@@ -138,9 +138,6 @@ public:
// Duplicated in Data::CanWriteValue().
return !isInaccessible();
}
bool isContact() const {
return (_contactStatus == ContactStatus::Contact);
}
bool canShareThisContact() const;
bool canAddContact() const {
@@ -166,15 +163,10 @@ public:
Text phoneText;
TimeId onlineTill = 0;
enum class ContactStatus : char {
PhoneUnknown,
CanAdd,
Contact,
};
ContactStatus contactStatus() const {
return _contactStatus;
[[nodiscard]] bool isContact() const {
return _isContact;
}
void setContactStatus(ContactStatus status);
void setIsContact(bool is);
enum class BlockStatus : char {
Unknown,
@@ -217,7 +209,7 @@ private:
QString _unavailableReason;
QString _phone;
ContactStatus _contactStatus = ContactStatus::PhoneUnknown;
bool _isContact = false;
BlockStatus _blockStatus = BlockStatus::Unknown;
CallsStatus _callsStatus = CallsStatus::Unknown;
int _commonChatsCount = 0;