2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Shared media block done in the new profile implementation.

Preparing to call Notify::peerUpdatedSendDelayed() only from event loop.
This commit is contained in:
John Preston
2016-06-02 16:02:55 +03:00
parent 3fc7cc3453
commit 2c4ec3d9f3
35 changed files with 646 additions and 193 deletions

View File

@@ -697,8 +697,16 @@ public:
return _about;
}
int count = 1;
int adminsCount = 1;
int membersCount() const {
return _membersCount;
}
void setMembersCount(int newMembersCount);
int adminsCount() const {
return _adminsCount;
}
void setAdminsCount(int newAdminsCount);
int32 date = 0;
int version = 0;
MTPDchannel::Flags flags = { 0 };
@@ -708,7 +716,7 @@ public:
if (!mgInfo || !(mgInfo->lastParticipantsStatus & MegagroupInfo::LastParticipantsCountOutdated)) {
return false;
}
if (mgInfo->lastParticipantsCount == count) {
if (mgInfo->lastParticipantsCount == membersCount()) {
mgInfo->lastParticipantsStatus &= ~MegagroupInfo::LastParticipantsCountOutdated;
return false;
}
@@ -748,9 +756,12 @@ public:
bool canWrite() const {
return amIn() && (canPublish() || !isBroadcast());
}
bool canViewParticipants() const {
bool canViewMembers() const {
return flagsFull & MTPDchannelFull::Flag::f_can_view_participants;
}
bool canViewAdmins() const {
return (isMegagroup() || amCreator() || amEditor() || amModerator());
}
bool addsSignature() const {
return flags & MTPDchannel::Flag::f_signatures;
}
@@ -758,7 +769,7 @@ public:
bool isVerified() const {
return flags & MTPDchannel::Flag::f_verified;
}
bool canAddParticipants() const {
bool canAddMembers() const {
return amCreator() || amEditor() || (flags & MTPDchannel::Flag::f_democracy);
}
bool canEditPhoto() const {
@@ -767,6 +778,9 @@ public:
bool canEditUsername() const {
return amCreator() && (flagsFull & MTPDchannelFull::Flag::f_can_set_username);
}
bool canDelete() const {
return amCreator() && (membersCount() <= 1000);
}
// ImagePtr photoFull;
@@ -824,6 +838,9 @@ private:
PtsWaiter _ptsWaiter;
uint64 _lastFullUpdate = 0;
int _membersCount = 1;
int _adminsCount = 1;
QString _restrictionReason;
QString _about;