ep_comments_page 0.1.94 → 0.1.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -29,7 +29,10 @@ exports.padCopy = async (hookName, context) => {
|
|
|
29
29
|
]);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
exports.handleMessageSecurity = async (hookName,
|
|
32
|
+
exports.handleMessageSecurity = async (hookName, ctx) => {
|
|
33
|
+
// ctx.client was renamed to ctx.socket in newer versions of Etherpad. Fall back to ctx.client in
|
|
34
|
+
// case this plugin is installed on an older version of Etherpad.
|
|
35
|
+
const {message, socket = ctx.client} = ctx;
|
|
33
36
|
const {type: mtype, data: {type: dtype, apool, changeset} = {}} = message;
|
|
34
37
|
if (mtype !== 'COLLABROOM') return;
|
|
35
38
|
if (dtype !== 'USER_CHANGES') return;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "Adds comments on sidebar and link it to the text. For no-skin use ep_page_view.",
|
|
3
3
|
"name": "ep_comments_page",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.97",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Nicolas Lescop",
|
|
7
7
|
"email": "limplementeur@gmail.com"
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"underscore": "^1.13.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"eslint": "^8.
|
|
31
|
-
"eslint-config-etherpad": "^3.0.
|
|
30
|
+
"eslint": "^8.10.0",
|
|
31
|
+
"eslint-config-etherpad": "^3.0.4",
|
|
32
32
|
"socket.io-client": "^2.3.0",
|
|
33
33
|
"superagent": "^6.1.0",
|
|
34
34
|
"typescript": "^4.5.5"
|
|
@@ -124,7 +124,7 @@ describe(__filename, function () {
|
|
|
124
124
|
for (const {desc, opcode, attribs} of testCases) {
|
|
125
125
|
it(desc, async function () {
|
|
126
126
|
const head = pad.head;
|
|
127
|
-
await common.sendUserChanges(socket, makeUserChanges(opcode, attribs));
|
|
127
|
+
await assert.rejects(common.sendUserChanges(socket, makeUserChanges(opcode, attribs)));
|
|
128
128
|
// common.sendUserChanges() waits for message ack, so if the message was accepted then head
|
|
129
129
|
// should have already incremented by the time we get here.
|
|
130
130
|
assert.equal(pad.head, head);
|