fix in db and collaborate
This commit is contained in:
+12
-1
@@ -97,6 +97,8 @@ class RoomSocket {
|
||||
guest_id: this.guestId || null,
|
||||
color: this.color || null,
|
||||
diagnostics: this.clientDiagnostics(),
|
||||
client_id: this.clientId || null,
|
||||
known_revision_id: this.getKnownRevision?.() ?? null,
|
||||
});
|
||||
this.emitDiagnostics();
|
||||
});
|
||||
@@ -130,6 +132,7 @@ class RoomSocket {
|
||||
return;
|
||||
}
|
||||
if (message.type === "document") this.onDocument?.(message);
|
||||
if (message.type === "resync") this.onResync?.(message);
|
||||
if (message.type === "presence") this.onPresence?.(message.users || []);
|
||||
if (message.type === "chat") this.onChat?.(message);
|
||||
if (message.type === "pong") {
|
||||
@@ -302,7 +305,15 @@ class RoomSocket {
|
||||
return true;
|
||||
}
|
||||
|
||||
update(content, ownerMap = "[]") { this.send({ type: "update", content, owner_map: ownerMap }); }
|
||||
update(baseRevisionId, updateId, operation, ownerReplacements = []) {
|
||||
return this.send({
|
||||
type: "update",
|
||||
base_revision_id: baseRevisionId,
|
||||
update_id: updateId,
|
||||
operation,
|
||||
owner_replacements: ownerReplacements,
|
||||
});
|
||||
}
|
||||
chat(text) { this.send({ type: "chat", text }); }
|
||||
setColor(color) { this.color = color || null; this.send({ type: "set_color", color: this.color }); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user