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

Unify legacy and megagroups information edit.

This commit is contained in:
John Preston
2019-01-08 17:57:22 +04:00
parent ff728e2fc1
commit 18c6be0d3b
28 changed files with 273 additions and 759 deletions

View File

@@ -55,15 +55,6 @@ void ChannelData::setName(const QString &newName, const QString &newUsername) {
updateNameDelayed(newName.isEmpty() ? name : newName, QString(), newUsername);
}
bool ChannelData::setAbout(const QString &newAbout) {
if (_about == newAbout) {
return false;
}
_about = newAbout;
Notify::peerUpdatedDelayed(this, UpdateFlag::AboutChanged);
return true;
}
void ChannelData::setInviteLink(const QString &newInviteLink) {
if (newInviteLink != _inviteLink) {
_inviteLink = newInviteLink;
@@ -365,7 +356,9 @@ bool ChannelData::canEditSignatures() const {
}
bool ChannelData::canEditPreHistoryHidden() const {
return canEditInformation();
return canEditInformation()
&& isMegagroup()
&& (!isPublic() || canEditUsername());
}
bool ChannelData::canEditUsername() const {