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.getImageURL(name, function(url) {
debug("CRYPTPAD success add " + name);
common.setPadAttribute('atime', +new Date(), null, data.href);
APP.AddImageSuccessCallback({
name: name,
url: url

@ -538,6 +538,7 @@ define([
}
if (!mediaTagEmbedder) { console.log('mediaTagEmbedder missing'); 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 origin = privateDat.fileHost || privateDat.origin;
var src = data.src = data.src.slice(0,1) === '/' ? origin + data.src : data.src;

@ -1205,6 +1205,7 @@ define([
};
common.openFilePicker(pickerCfg, function (data) {
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>';
APP.editor.replaceSelection(mt);
return;

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

@ -144,15 +144,6 @@ define([
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 () {
config.onClose();
});

Loading…
Cancel
Save