Compare commits

...

2 Commits

Author SHA1 Message Date
bd4f6ea486 Update version to 0.6.1
- Fix: Error thrown in folder migration if new and old path are same
2022-04-19 13:01:00 -06:00
5ef0b6a11f Fix: Error thrown in folder migration if new and old path are same 2022-04-19 12:58:52 -06:00
2 changed files with 2 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "node-red-contrib-matrix-chat",
"version": "0.5.8",
"version": "0.6.1",
"description": "Matrix chat server client for Node-RED",
"dependencies": {
"fs-extra": "^10.0.1",

View File

@ -5,8 +5,6 @@ const { resolve } = require('path');
const { LocalStorage } = require('node-localstorage');
const { LocalStorageCryptoStore } = require('matrix-js-sdk/lib/crypto/store/localStorage-crypto-store');
const {RoomEvent, RoomMemberEvent, HttpApiEvent, ClientEvent} = require("matrix-js-sdk");
const {deriveKey} = require("matrix-js-sdk/lib/crypto/key_passphrase");
const {encryptAES} = require("matrix-js-sdk/lib/crypto/aes");
module.exports = function(RED) {
function MatrixFolderNameFromUserId(name) {
@ -466,7 +464,7 @@ module.exports = function(RED) {
fs.renameSync(oldStorageDir, oldStorageDir + "-backup");
}
if(RED.settings.userDir !== resolve('./')) {
if(RED.settings.userDir !== resolve('./') && resolve(oldStorageDir2) !== resolve(storageDir)) {
// user directory does not match running directory
// check if we stored stuff in wrong directory and move it
if(fs.pathExistsSync(oldStorageDir2)){