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

Support invite link label editing.

This commit is contained in:
John Preston
2021-10-28 16:18:49 +04:00
parent eb82664452
commit aaae5b0553
8 changed files with 63 additions and 4 deletions

View File

@@ -1180,6 +1180,7 @@ void EditLink(
peer->session().api().inviteLinks().create(
peer,
finish,
result.label,
result.expireDate,
result.usageLimit,
result.requestApproval);
@@ -1188,6 +1189,7 @@ void EditLink(
peer,
data.admin,
result.link,
result.label,
result.expireDate,
result.usageLimit,
result.requestApproval,
@@ -1202,6 +1204,7 @@ void EditLink(
Ui::EditInviteLinkBox,
Fields{
.link = data.link,
.label = data.label,
.expireDate = data.expireDate,
.usageLimit = data.usageLimit,
.requestApproval = data.requestApproval,

View File

@@ -275,6 +275,7 @@ void Row::update(const InviteLinkData &data, TimeId now) {
_progressTillExpire = ComputeProgress(data, now);
_color = ComputeColor(data, _progressTillExpire);
setCustomStatus(ComputeStatus(data, now));
refreshName(st::inviteLinkList.item);
_delegate->rowUpdateRow(this);
}
@@ -309,6 +310,9 @@ crl::time Row::updateExpireIn() const {
}
QString Row::generateName() {
if (!_data.label.isEmpty()) {
return _data.label;
}
auto result = _data.link;
return result.replace(
qstr("https://"),