Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 6b7fb03

Browse files
committed
Add share data to invitation message. Close #1153
1 parent fada3e7 commit 6b7fb03

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

core/src/plugins/action.share/res/react/model/ShareModel.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,23 @@
891891
s = MessageHash["share_center.42"];
892892
if(s) s = s.replace("%s", ApplicationTitle);
893893
link = this.getPublicLink(linkId);
894-
message = s + "\n\n " + "<a href='"+link+"'>"+link+"</a>";
894+
let additionalData = '';
895+
let password = this.hasHiddenPassword(linkId);
896+
if(password){
897+
additionalData += '\n - ' + MessageHash['share_center.170'] + '.';
898+
}
899+
let dlLimit = this.getExpirationFor(linkId, 'downloads');
900+
if(dlLimit){
901+
additionalData += '\n - ' + MessageHash['share_center.22'] + ': ' + dlLimit;
902+
}
903+
let expirationDate = this.getExpirationFor(linkId, 'days');
904+
if(expirationDate){
905+
let today = new Date();
906+
let expDate = new Date();
907+
expDate.setDate(today.getDate() + parseInt(expirationDate));
908+
additionalData += '\n - ' + MessageHash['share_center.21'] + ': ' + expDate.toLocaleDateString();
909+
}
910+
message = s + additionalData + "\n\n " + "<a href='"+link+"'>"+link+"</a>";
895911
}else{
896912
if(!this._data['repository_url']){
897913
throw new Error(MessageHash['share_center.230']);

0 commit comments

Comments
 (0)