Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 89c4ee229a | |||
| 990b081b3d |
2
dist/build.js
vendored
2
dist/build.js
vendored
File diff suppressed because one or more lines are too long
14
index.js
14
index.js
@@ -360,7 +360,7 @@
|
|||||||
* Updates and writes an existing archive document
|
* Updates and writes an existing archive document
|
||||||
*/
|
*/
|
||||||
_updateDocument: function(archive, messages) {
|
_updateDocument: function(archive, messages) {
|
||||||
RemoteStorage.log('[chat-messages] Updating archive document', archive);
|
console.debug('[chat-messages] Updating archive document', archive);
|
||||||
|
|
||||||
if (Array.isArray(messages)) {
|
if (Array.isArray(messages)) {
|
||||||
messages.forEach(function(message) {
|
messages.forEach(function(message) {
|
||||||
@@ -379,7 +379,7 @@
|
|||||||
* Creates and writes a new archive document
|
* Creates and writes a new archive document
|
||||||
*/
|
*/
|
||||||
_createDocument: function(messages) {
|
_createDocument: function(messages) {
|
||||||
RemoteStorage.log('[chat-messages] Creating new archive document');
|
console.debug('[chat-messages] Creating new archive document');
|
||||||
let archive = this._buildArchiveObject();
|
let archive = this._buildArchiveObject();
|
||||||
|
|
||||||
if (Array.isArray(messages)) {
|
if (Array.isArray(messages)) {
|
||||||
@@ -454,11 +454,11 @@
|
|||||||
let path = this.path.substring(0, this.path.length-this.dateId.length)+archive.today['@id'];
|
let path = this.path.substring(0, this.path.length-this.dateId.length)+archive.today['@id'];
|
||||||
|
|
||||||
return this.client.storeObject('daily-archive', path, archive).then(() => {
|
return this.client.storeObject('daily-archive', path, archive).then(() => {
|
||||||
RemoteStorage.log('[chat-messages] Previous archive written to remote storage', path, archive);
|
console.debug('[chat-messages] Previous archive written to remote storage', path, archive);
|
||||||
return archive;
|
return archive;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
RemoteStorage.log('[chat-messages] Previous archive not found');
|
console.debug('[chat-messages] Previous archive not found');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -534,13 +534,13 @@
|
|||||||
* Write archive document
|
* Write archive document
|
||||||
*/
|
*/
|
||||||
_sync: function(obj) {
|
_sync: function(obj) {
|
||||||
RemoteStorage.log('[chat-messages] Writing archive object', obj);
|
console.debug('[chat-messages] Writing archive object', obj);
|
||||||
|
|
||||||
return this.client.storeObject('daily-archive', this.path, obj).then(function(){
|
return this.client.storeObject('daily-archive', this.path, obj).then(function(){
|
||||||
RemoteStorage.log('[chat-messages] Archive written to remote storage');
|
console.debug('[chat-messages] Archive written to remote storage');
|
||||||
return true;
|
return true;
|
||||||
},function(error){
|
},function(error){
|
||||||
console.log('[chat-messages] Error trying to store object', error);
|
console.warn('[chat-messages] Error trying to store object', error);
|
||||||
return error;
|
return error;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "remotestorage-module-chat-messages",
|
"name": "remotestorage-module-chat-messages",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "Stores chat messages in daily archive files",
|
"description": "Stores chat messages in daily archive files",
|
||||||
"main": "./dist/build.js",
|
"main": "./dist/build.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user