Commit Graph

7617 Commits (745c78c5363af980d26d6882be263a5e3bb42c90)

Author SHA1 Message Date
Richard Hansen 51907015ed chat: Fix gritter duration 2021-11-01 01:54:29 -04:00
Richard Hansen 23f963c9fe chat: Improve name mention detection 2021-11-01 01:54:29 -04:00
Richard Hansen 26675c5019 chat: New `chatNewMessage` server-side hook 2021-11-01 01:54:29 -04:00
Richard Hansen 23a98e5946 tests: Refactor `waitForSocketEvent()` to improve readability 2021-11-01 01:54:29 -04:00
Richard Hansen 3132235f2c tests: Rename `getSocketEvent()` to `waitForSocketEvent()` 2021-11-01 01:54:29 -04:00
Richard Hansen 65bd597053 tests: Move socket.io connection helpers to `common.js` 2021-11-01 01:54:28 -04:00
Richard Hansen bea57ff249 tests: Use `logger` variable for consistency 2021-11-01 01:54:28 -04:00
Richard Hansen 9fbd2e5c3d chat: New `chatSendMessage` client-side hook 2021-11-01 01:54:28 -04:00
Richard Hansen 4c2f7f9a11 chat: Rename `userId` to `authorId`, `userName` to `displayName` 2021-11-01 01:54:28 -04:00
Richard Hansen 0f47ca9046 chat: Plumb message object end to end
This will make it possible for future commits to add hooks that allow
plugins to augment chat messages with arbitrary metadata.
2021-11-01 01:54:28 -04:00
Richard Hansen f1f4ed7c58 chat: Allow `chatNewMessage` hook to control rendering 2021-11-01 01:54:28 -04:00
Richard Hansen 2597b940f4 chat: Give `chatNewMessage` hook access to the raw message object 2021-11-01 01:54:28 -04:00
Richard Hansen fc5a3f553d chat: Test processing in `chatNewMessage` hook 2021-11-01 01:54:28 -04:00
Richard Hansen caac4bf711 chat: Promisify `addMessage()` 2021-11-01 01:54:28 -04:00
Richard Hansen 3f7f629eeb chat: Scroll down after the `chatNewMessage` hook finishes 2021-11-01 01:54:28 -04:00
Richard Hansen 195a6bd81b chat: Move click handler setup to `init()` 2021-11-01 01:54:28 -04:00
Richard Hansen c8dbf35fe4 docs: Improve `chatNewMessage` client-side hook documentation 2021-11-01 01:54:28 -04:00
Richard Hansen 23037280a8 Pad: Simplify `getChatMessages()` 2021-11-01 01:54:28 -04:00
Richard Hansen e471cb12e6 tests: Also spy on initially loaded chat messages 2021-11-01 01:54:28 -04:00
Richard Hansen 66a8c48fac tests: Save the CHAT_MESSAGE payload, not the wrapper 2021-11-01 01:54:28 -04:00
Richard Hansen c8e0916e1a tests: Spy on socket.io messages as early as possible 2021-11-01 01:54:28 -04:00
Richard Hansen e28c9ffc97 tests: Support injecting hook functions during pad load 2021-11-01 01:54:28 -04:00
Richard Hansen c8e544ec8d tests: Fix handling of nullish module definitions 2021-11-01 01:54:28 -04:00
Peter VandeHaar 9987834b15 Clarify instructions in PULL_REQUEST_TEMPLATE.md
This change
- removes instructions about commit headers that nobody follows,
- links to useful resources for first-time contributors,
- simplifies some text, and
- hides all text inside <!--  -->.
2021-10-31 02:40:03 -04:00
Richard Hansen 9aaf781548 PadMessageHandler: Modernize `userLeave` hook context properties 2021-10-30 03:07:44 -04:00
Richard Hansen a6d060d67b PadMessageHandler: Replace `clientReady` hook with new `userJoin` hook 2021-10-30 03:07:44 -04:00
Richard Hansen c98910e1c5 PadMessageHandler: Populate session info as early as possible 2021-10-30 03:07:44 -04:00
Richard Hansen b7de24c85f PadMessageHandler: Fix readability of duplicate user check 2021-10-30 03:07:44 -04:00
Richard Hansen 00e7b04518 PadMessageHandler: Improve readability of changeset loading 2021-10-30 03:07:44 -04:00
Richard Hansen 50b9e0df1f PadMessageHandler: Use values from session info object
This is more consistent with the rest of the code, and it provides a
single source of truth.
2021-10-30 03:07:40 -04:00
Richard Hansen 10e930408c PadMessageHandler: Delete unnecessary CLIENT_READY checks
The checks are already performed by the security manager.
2021-10-30 03:06:57 -04:00
Richard Hansen 0992f19570 PadMessageHandler: Improve readability of historical author fetch 2021-10-30 03:06:57 -04:00
Richard Hansen d36a37d666 PadMessageHandler: Delete unnecessary `protocolVersion`
We can assume that the client code is always in sync with what the
server expects.
2021-10-30 03:06:57 -04:00
Richard Hansen ce730b0493 PadMessageHandler: Inline `createSessionInfoAuth()`
This function is only used once so it doesn't need to be separate.
2021-10-30 03:06:57 -04:00
Richard Hansen fa54dc1053 PadMessageHandler: Run the `clientReady` hook asynchronously 2021-10-30 03:06:57 -04:00
Richard Hansen 5d30e0b1b2 PadMessageHandler: Run the `userLeave` hook asynchronously 2021-10-30 03:06:57 -04:00
Richard Hansen f2a118b311 PadMessageHandler: Inline unnecessary variables
Also delete some unneccessary comments.
2021-10-30 03:06:15 -04:00
Richard Hansen 7522d76c40 PadMessageHandler: Invert condition to improve readability 2021-10-30 03:03:19 -04:00
Richard Hansen a3b4d985ac lint: Fix awkward string formatting 2021-10-30 03:03:19 -04:00
Richard Hansen f4f3aa6aae docs: Improve `userLeave` and `clientReady` hook documentation 2021-10-30 03:03:19 -04:00
Richard Hansen 80e84636d7 pad: Promisify `handshake()` 2021-10-29 19:38:28 -04:00
Richard Hansen cd4f5ff281 pad: Defer message handling until handshake completes 2021-10-29 19:37:28 -04:00
Richard Hansen be0298290d pad: Move post-handshake code to `_afterHandshake()` 2021-10-29 19:27:33 -04:00
Richard Hansen 9fb754ce3a pad: Initialize pad cookie before starting the handshake 2021-10-29 19:27:33 -04:00
Richard Hansen f6c5ce606e pad: Move UI setup from `handshake()` to `init()` 2021-10-29 19:27:33 -04:00
Richard Hansen bd44a87388 pad: Unexport unnecessarily exported `handshake()` function 2021-10-29 19:27:33 -04:00
Richard Hansen 5cbbcbcee6 pad: Simplify reload after `.etherpad` import
The old "switch to pad" logic looked buggy, and it complicates pad
initialization. Forcing a refresh after importing an `.etherpad` file
isn't much of a UX downgrade.
2021-10-29 19:27:33 -04:00
Richard Hansen e974622561 pad: Use `window.` to avoid ESLint error 2021-10-29 19:27:33 -04:00
webzwo0i d8ca3a693d timeslider scrollTo: fixes wrong line number calculation in case there
are no attribute changes and no length changes
2021-10-29 02:38:29 -04:00
webzwo0i 9bad1d03d3 importHtml: do not add an useless identity changeset 2021-10-29 02:29:45 -04:00