mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2025-07-09 04:01:11 -06:00
Compare commits
2 Commits
97f27e61c6
...
bd4f6ea486
Author | SHA1 | Date | |
---|---|---|---|
bd4f6ea486 | |||
5ef0b6a11f |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-contrib-matrix-chat",
|
"name": "node-red-contrib-matrix-chat",
|
||||||
"version": "0.5.8",
|
"version": "0.6.1",
|
||||||
"description": "Matrix chat server client for Node-RED",
|
"description": "Matrix chat server client for Node-RED",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fs-extra": "^10.0.1",
|
"fs-extra": "^10.0.1",
|
||||||
|
@ -5,8 +5,6 @@ const { resolve } = require('path');
|
|||||||
const { LocalStorage } = require('node-localstorage');
|
const { LocalStorage } = require('node-localstorage');
|
||||||
const { LocalStorageCryptoStore } = require('matrix-js-sdk/lib/crypto/store/localStorage-crypto-store');
|
const { LocalStorageCryptoStore } = require('matrix-js-sdk/lib/crypto/store/localStorage-crypto-store');
|
||||||
const {RoomEvent, RoomMemberEvent, HttpApiEvent, ClientEvent} = require("matrix-js-sdk");
|
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) {
|
module.exports = function(RED) {
|
||||||
function MatrixFolderNameFromUserId(name) {
|
function MatrixFolderNameFromUserId(name) {
|
||||||
@ -466,7 +464,7 @@ module.exports = function(RED) {
|
|||||||
fs.renameSync(oldStorageDir, oldStorageDir + "-backup");
|
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
|
// user directory does not match running directory
|
||||||
// check if we stored stuff in wrong directory and move it
|
// check if we stored stuff in wrong directory and move it
|
||||||
if(fs.pathExistsSync(oldStorageDir2)){
|
if(fs.pathExistsSync(oldStorageDir2)){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user