Compare commits
5 Commits
1821d3cb64
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
929188bc2b
|
||
| f4388bb202 | |||
|
|
dafccf23e4
|
||
|
|
185d9c71df
|
||
|
|
8744307ee7
|
124
dist/build.js
vendored
124
dist/build.js
vendored
File diff suppressed because one or more lines are too long
2
dist/build.js.map
vendored
2
dist/build.js.map
vendored
File diff suppressed because one or more lines are too long
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "remotestorage-module-chat-messages",
|
"name": "remotestorage-module-chat-messages",
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "remotestorage-module-chat-messages",
|
"name": "remotestorage-module-chat-messages",
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.18.10",
|
"@babel/core": "^7.18.10",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "remotestorage-module-chat-messages",
|
"name": "remotestorage-module-chat-messages",
|
||||||
"version": "2.1.0",
|
"version": "2.1.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": {
|
||||||
|
|||||||
@@ -616,7 +616,7 @@ const ChatMessages = function (privateClient, publicClient) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only update document if current date is newer than known "last"
|
// Only update document if current date is newer than known "last"
|
||||||
if (Date.parse(meta.last.replace(/\//g,'-')) > Date.parse(this.date)) {
|
if (Date.parse(meta.last.replace(/\//g,'-')) < Date.parse(this.date)) {
|
||||||
console.debug('[chat-messages]', 'Updating meta document for channel');
|
console.debug('[chat-messages]', 'Updating meta document for channel');
|
||||||
meta.last = this.dateId;
|
meta.last = this.dateId;
|
||||||
await this.client.storeObject('daily-archive-meta', this.metaPath, meta);
|
await this.client.storeObject('daily-archive-meta', this.metaPath, meta);
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ const rsClient = {
|
|||||||
remove: function() {}
|
remove: function() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
describe('ChatMessages', function () {
|
describe('ChatMessages', function () {
|
||||||
|
|
||||||
describe('constructor', function () {
|
describe('constructor', function () {
|
||||||
@@ -89,7 +88,7 @@ describe('ChatMessages', function () {
|
|||||||
before(function() {
|
before(function() {
|
||||||
sandbox.stub(archive.client, 'getObject').withArgs(archive.metaPath)
|
sandbox.stub(archive.client, 'getObject').withArgs(archive.metaPath)
|
||||||
.returns({
|
.returns({
|
||||||
'@id': `chat-messages/irc.libera.chat/channels/kosmos/meta`,
|
'@id': archive.metaPath,
|
||||||
'@type': 'ChatChannelMeta',
|
'@type': 'ChatChannelMeta',
|
||||||
first: '2021/01/01', last: '2022/08/10'
|
first: '2021/01/01', last: '2022/08/10'
|
||||||
})
|
})
|
||||||
@@ -98,7 +97,13 @@ describe('ChatMessages', function () {
|
|||||||
|
|
||||||
it('stores a new archive', async function () {
|
it('stores a new archive', async function () {
|
||||||
await archive._updateArchiveMetaDocument();
|
await archive._updateArchiveMetaDocument();
|
||||||
sandbox.assert.calledOnce(archive.client.storeObject);
|
sandbox.assert.calledWithMatch(
|
||||||
|
archive.client.storeObject,
|
||||||
|
'daily-archive-meta', archive.metaPath, {
|
||||||
|
'@id': archive.metaPath, '@type': 'ChatChannelMeta',
|
||||||
|
first: '2021/01/01', last: '2022/08/11'
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
after(function() { sandbox.restore() });
|
after(function() { sandbox.restore() });
|
||||||
|
|||||||
Reference in New Issue
Block a user