Update atime when embedding a mediatag to a pad

pull/1/head
yflory 4 years ago
parent e34c78580f
commit 163c6556a0

@ -1150,6 +1150,7 @@ define([
APP.realtime.onSettle(function () { APP.realtime.onSettle(function () {
APP.getImageURL(name, function(url) { APP.getImageURL(name, function(url) {
debug("CRYPTPAD success add " + name); debug("CRYPTPAD success add " + name);
common.setPadAttribute('atime', +new Date(), null, data.href);
APP.AddImageSuccessCallback({ APP.AddImageSuccessCallback({
name: name, name: name,
url: url url: url

@ -538,6 +538,7 @@ define([
} }
if (!mediaTagEmbedder) { console.log('mediaTagEmbedder missing'); return; } if (!mediaTagEmbedder) { console.log('mediaTagEmbedder missing'); return; }
if (data.type !== 'file') { console.log('unhandled embed type ' + data.type); return; } if (data.type !== 'file') { console.log('unhandled embed type ' + data.type); return; }
common.setPadAttribute('atime', +new Date(), null, data.href);
var privateDat = cpNfInner.metadataMgr.getPrivateData(); var privateDat = cpNfInner.metadataMgr.getPrivateData();
var origin = privateDat.fileHost || privateDat.origin; var origin = privateDat.fileHost || privateDat.origin;
var src = data.src = data.src.slice(0,1) === '/' ? origin + data.src : data.src; var src = data.src = data.src.slice(0,1) === '/' ? origin + data.src : data.src;

@ -1205,6 +1205,7 @@ define([
}; };
common.openFilePicker(pickerCfg, function (data) { common.openFilePicker(pickerCfg, function (data) {
if (data.type === 'file' && APP.editor) { if (data.type === 'file' && APP.editor) {
common.setPadAttribute('atime', +new Date(), null, data.href);
var mt = '<media-tag src="' + data.src + '" data-crypto-key="cryptpad:' + data.key + '"></media-tag>'; var mt = '<media-tag src="' + data.src + '" data-crypto-key="cryptpad:' + data.key + '"></media-tag>';
APP.editor.replaceSelection(mt); APP.editor.replaceSelection(mt);
return; return;

@ -114,6 +114,7 @@ define([
var key = Hash.encodeBase64(secret.keys.cryptKey); var key = Hash.encodeBase64(secret.keys.cryptKey);
sframeChan.event("EV_SECURE_ACTION", { sframeChan.event("EV_SECURE_ACTION", {
type: parsed.type, type: parsed.type,
href: data.url,
src: src, src: src,
name: data.name, name: data.name,
key: key key: key

@ -144,15 +144,6 @@ define([
config.onFileUpload(sframeChan, data, cb); config.onFileUpload(sframeChan, data, cb);
}); });
sframeChan.on('Q_GET_FILES_LIST', function (types, cb) {
Cryptpad.getSecureFilesList(types, function (err, data) {
cb({
error: err,
data: data
});
});
});
sframeChan.on('EV_SECURE_IFRAME_CLOSE', function () { sframeChan.on('EV_SECURE_IFRAME_CLOSE', function () {
config.onClose(); config.onClose();
}); });

Loading…
Cancel
Save