From 060265b3198f73ad7d5b6ff485cfd87f9e9da8a2 Mon Sep 17 00:00:00 2001 From: Guillaume Viguier Date: Fri, 18 Aug 2017 15:44:40 +0200 Subject: [PATCH 01/12] Fixes #15 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 242b587..915aee6 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [Nextcloud](https://nextcloud.com) is the premiere and safest, Enterprise-ready, Open Source File Sync and Share solution -["Nextcloud for Filelink"](https://github.com/nextcloud/nextcloud-filelink) is a Thunderbird extension which makes it easy to send large attachments with Thunderbird by uploading them first to a Nextcloud server and by then inserting the link into the body of your email. +["Nextcloud for Filelink"](https://addons.mozilla.org/thunderbird/addon/nextcloud-filelink/) is a Thunderbird extension which makes it easy to send large attachments with Thunderbird by uploading them first to a Nextcloud server and by then inserting the link into the body of your email. It is currently possible to upload files as large as 1GB. From cf53fb8913fa2829e37b6957862b0201a4764bc8 Mon Sep 17 00:00:00 2001 From: Guillaume Viguier Date: Fri, 29 Sep 2017 14:21:15 +0200 Subject: [PATCH 02/12] #40 - fixed compatibility settings --- src/install.rdf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/install.rdf b/src/install.rdf index c118885..785c678 100644 --- a/src/install.rdf +++ b/src/install.rdf @@ -6,7 +6,7 @@ owncloud@viguierjust.com Nextcloud for Filelink - 1.6 + 1.7 2 Olivier Paroz Philipp Kewisch @@ -21,7 +21,7 @@ {3550f703-e582-4d05-9a08-453d09bdfdc6} 17.0 - 45.* + 57.* From 3387ed0b291d3ae4836e3a2041acc49d52d13a78 Mon Sep 17 00:00:00 2001 From: Uli Heller Date: Wed, 8 Aug 2018 08:21:21 +0200 Subject: [PATCH 03/12] Compatibility with thunderbird-60, fixes #55 --- src/components/nsNextcloud.js | 19 +++++++------------ src/install.rdf | 4 ++-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/components/nsNextcloud.js b/src/components/nsNextcloud.js index 69af4fa..e5bc7e3 100644 --- a/src/components/nsNextcloud.js +++ b/src/components/nsNextcloud.js @@ -35,6 +35,7 @@ Cu.import("resource:///modules/oauth.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource:///modules/gloda/log4moz.js"); Cu.import("resource:///modules/cloudFileAccounts.js"); +Cu.importGlobalProperties(["XMLHttpRequest"]); const kRestBase = "/ocs/v1.php"; const kAuthPath = kRestBase + "/cloud/user"; @@ -435,8 +436,7 @@ Nextcloud.prototype = { this.log.info("Sending login information..."); let args = "?format=json"; - let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"] - .createInstance(Ci.nsIXMLHttpRequest); + let req = new XMLHttpRequest(Ci.nsIXMLHttpRequest); req.open("GET", this._fullUrl + kAuthPath + args, true); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); @@ -575,8 +575,7 @@ Nextcloud.prototype = { '' + ''; - let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance( - Ci.nsIXMLHttpRequest); + let req = new XMLHttpRequest(Ci.nsIXMLHttpRequest); req.open("PROPFIND", this._fullUrl + kWebDavPath, true, this._userName, this._password); @@ -638,8 +637,7 @@ Nextcloud.prototype = { '' + ''; - let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"] - .createInstance(Ci.nsIXMLHttpRequest); + let req = new XMLHttpRequest(Ci.nsIXMLHttpRequest); req.open("PROPFIND", this._fullUrl + kWebDavPath + ("/" + this._storageFolder + "/").replace(/\/+/g, '/'), true, this._userName, @@ -674,8 +672,7 @@ Nextcloud.prototype = { */ _createFolder: function createFolder(callback) { if (this._storageFolder !== '/') { - let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"] - .createInstance(Ci.nsIXMLHttpRequest); + let req = new XMLHttpRequest(Ci.nsIXMLHttpRequest); req.open("MKCOL", this._fullUrl + kWebDavPath + ("/" + this._storageFolder + "/").replace(/\/+/g, '/'), true, this._userName, @@ -778,8 +775,7 @@ NextcloudFileUploader.prototype = { bufStream = bufStream.QueryInterface(Ci.nsIInputStream); let contentLength = fstream.available(); - let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance( - Ci.nsIXMLHttpRequest); + let req = new XMLHttpRequest(Ci.nsIXMLHttpRequest); req.open("PUT", url, true, this._userName, this._password); @@ -835,8 +831,7 @@ NextcloudFileUploader.prototype = { this.file = aFile; let shareType = 3; let args = "?format=json"; - let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"] - .createInstance(Ci.nsIXMLHttpRequest); + let req = new XMLHttpRequest(Ci.nsIXMLHttpRequest); let path = wwwFormUrlEncode( ("/" + this.nextcloud._storageFolder + "/").replace(/\/+/g, '/') + this._fileUploadTS[this.file.path] + "_" + this.file.leafName); diff --git a/src/install.rdf b/src/install.rdf index 785c678..f12a70c 100644 --- a/src/install.rdf +++ b/src/install.rdf @@ -6,7 +6,7 @@ owncloud@viguierjust.com Nextcloud for Filelink - 1.7 + 1.7.1 2 Olivier Paroz Philipp Kewisch @@ -21,7 +21,7 @@ {3550f703-e582-4d05-9a08-453d09bdfdc6} 17.0 - 57.* + 60.* From 219cc1f444489a83f5ef0cb882fbf91a0f239105 Mon Sep 17 00:00:00 2001 From: Guillaume Viguier Date: Wed, 19 Sep 2018 17:25:19 +0200 Subject: [PATCH 04/12] Update to version 1.8 --- src/install.rdf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/install.rdf b/src/install.rdf index 785c678..cef9e81 100644 --- a/src/install.rdf +++ b/src/install.rdf @@ -6,7 +6,7 @@ owncloud@viguierjust.com Nextcloud for Filelink - 1.7 + 1.8 2 Olivier Paroz Philipp Kewisch @@ -21,7 +21,7 @@ {3550f703-e582-4d05-9a08-453d09bdfdc6} 17.0 - 57.* + 60.* From 0dd153b3de8bd543e52ed5f6551f5a00c99f4685 Mon Sep 17 00:00:00 2001 From: Guillaume Viguier Date: Thu, 20 Sep 2018 11:15:46 +0200 Subject: [PATCH 05/12] Fixed issues for TB 60 --- src/components/nsNextcloud.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/nsNextcloud.js b/src/components/nsNextcloud.js index e5bc7e3..dc89515 100644 --- a/src/components/nsNextcloud.js +++ b/src/components/nsNextcloud.js @@ -361,7 +361,7 @@ Nextcloud.prototype = { this.log.info("Suppressing password prompt"); } - let passwordURI = this._fullUrl; + let passwordURI = this._serverUrl; let logins = Services.logins.findLogins({}, passwordURI, null, passwordURI); for (let loginInfo of logins) { if (loginInfo.username == aUsername) { @@ -378,10 +378,9 @@ Nextcloud.prototype = { let authPrompter = Services.ww.getNewAuthPrompter(win); let password = {value: ""}; // Use the service name in the prompt text - let userPos = this._fullUrl.indexOf("//") + 2; - let userNamePart = encodeURIComponent(this._userName) + '@'; - let serverUrl = - this._fullUrl.substr(0, userPos) + userNamePart + this._fullUrl.substr(userPos); + let userPos = this._fullUrl.indexOf("//") + 2; + let userNamePart = encodeURIComponent(this._userName) + '@'; + let serverUrl = this._fullUrl.substr(0, userPos) + userNamePart + this._fullUrl.substr(userPos); let messengerBundle = Services.strings.createBundle( "chrome://messenger/locale/messenger.properties"); let promptString = messengerBundle.formatStringFromName("passwordPrompt", @@ -445,7 +444,7 @@ Nextcloud.prototype = { "Basic " + btoa(this._userName + ':' + this._password)); req.onerror = function () { - this.log.info("logon failure"); + this.log.error("logon failure"); failureCallback(); }.bind(this); @@ -580,7 +579,7 @@ Nextcloud.prototype = { req.open("PROPFIND", this._fullUrl + kWebDavPath, true, this._userName, this._password); req.onerror = function () { - this.log.info("logon failure"); + this.log.error("logon failure"); failureCallback(); }.bind(this); @@ -780,7 +779,7 @@ NextcloudFileUploader.prototype = { req.open("PUT", url, true, this._userName, this._password); req.onerror = function () { - this.log.info("Could not upload file"); + this.log.error("Could not upload file"); if (this.callback) { this.callback(this.requestObserver, Ci.nsIMsgCloudFileProvider.uploadErr); @@ -799,7 +798,7 @@ NextcloudFileUploader.prototype = { }.bind(this); req.setRequestHeader("Content-Length", contentLength); - req.send(bufStream); + req.sendInputStream(bufStream); }, /** From 278431675ebd0228816c66afa0c0ce6f2e0c9285 Mon Sep 17 00:00:00 2001 From: Guillaume Viguier Date: Thu, 20 Sep 2018 12:10:03 +0200 Subject: [PATCH 06/12] Fixed space display issues --- src/chrome/content/management.js | 4 ++-- src/chrome/content/management.xhtml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/chrome/content/management.js b/src/chrome/content/management.js index f3b6c6c..73aa235 100644 --- a/src/chrome/content/management.js +++ b/src/chrome/content/management.js @@ -23,8 +23,8 @@ */ function onLoadProvider (provider) { - let messenger = Components.classes["@mozilla.org/messenger;1"] - .createInstance(Components.interfaces.nsIMessenger); + let messenger = Cc["@mozilla.org/messenger;1"] + .createInstance(Ci.nsIMessenger); let fileSpaceUsed = document.getElementById("file-space-used"); let fileSpaceUsedSwatch = document.getElementById("file-space-used-swatch"); diff --git a/src/chrome/content/management.xhtml b/src/chrome/content/management.xhtml index 00f8d6c..4373044 100644 --- a/src/chrome/content/management.xhtml +++ b/src/chrome/content/management.xhtml @@ -31,9 +31,9 @@ ]> -