Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing: Fix fast share creation with enforced expiry and 10.2.0 #7249

Merged
merged 1 commit into from
Jun 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/gui/socketapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,11 @@ private slots:
auto shareName = SocketApi::tr("Context menu share");

// If shares will expire, create a new one every day.
QDate expireDate;
if (_account->capabilities().sharePublicLinkDefaultExpire()) {
shareName = SocketApi::tr("Context menu share %1").arg(QDate::currentDate().toString(Qt::ISODate));
expireDate = QDate::currentDate().addDays(
_account->capabilities().sharePublicLinkDefaultExpireDateDays());
}

// If there already is a context menu share, reuse it
Expand All @@ -540,7 +543,8 @@ private slots:

// otherwise create a new one
qCDebug(lcPublicLink) << "Creating new share";
_shareManager.createLinkShare(_localFile, shareName);
QString noPassword;
_shareManager.createLinkShare(_localFile, shareName, noPassword, expireDate);
}

void linkShareCreated(const QSharedPointer<LinkShare> &share)
Expand Down