MCPcopy Index your code
hub / github.com/ether/etherpad / handleChatMessage

Function handleChatMessage

src/node/handler/PadMessageHandler.ts:688–695  ·  view source on GitHub ↗
(socket:any, message: ChatMessageMessage)

Source from the content-addressed store, hash-verified

686 * @param message the message from the client
687 */
688const handleChatMessage = async (socket:any, message: ChatMessageMessage) => {
689 const chatMessage = ChatMessage.fromObject(message.data.message);
690 const {padId, author: authorId} = sessioninfos[socket.id];
691 // Don't trust the user-supplied values.
692 chatMessage.time = Date.now();
693 chatMessage.authorId = authorId;
694 await exports.sendChatMessageToPadClients(chatMessage, padId);
695};
696
697/**
698 * Adds a new chat message to a pad and sends it to connected clients.

Callers 1

Calls 2

fromObjectMethod · 0.80
nowMethod · 0.80

Tested by

no test coverage detected