Suppress comment notifications when viewing document (#4987)
* Updating views from collaboration server * refactor * Suppress comment notifications based on views * test
This commit is contained in:
@@ -6,6 +6,7 @@ import Koa from "koa";
|
||||
import WebSocket from "ws";
|
||||
import { DocumentValidation } from "@shared/validations";
|
||||
import { ConnectionLimitExtension } from "@server/collaboration/ConnectionLimitExtension";
|
||||
import { ViewsExtension } from "@server/collaboration/ViewsExtension";
|
||||
import Logger from "@server/logging/Logger";
|
||||
import ShutdownHelper, { ShutdownOrder } from "@server/utils/ShutdownHelper";
|
||||
import AuthenticationExtension from "../collaboration/AuthenticationExtension";
|
||||
@@ -32,6 +33,7 @@ export default function init(
|
||||
new ConnectionLimitExtension(),
|
||||
new AuthenticationExtension(),
|
||||
new PersistenceExtension(),
|
||||
new ViewsExtension(),
|
||||
new LoggerExtension(),
|
||||
new MetricsExtension(),
|
||||
],
|
||||
|
||||
@@ -276,9 +276,8 @@ async function authenticated(io: IO.Server, socket: SocketWithAuth) {
|
||||
const room = `document-${event.documentId}`;
|
||||
|
||||
if (event.documentId && socket.rooms.has(room)) {
|
||||
const view = await View.touch(event.documentId, user.id, event.isEditing);
|
||||
await View.touch(event.documentId, user.id, event.isEditing);
|
||||
|
||||
view.user = user;
|
||||
io.to(room).emit("user.presence", {
|
||||
userId: user.id,
|
||||
documentId: event.documentId,
|
||||
|
||||
Reference in New Issue
Block a user