Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/src/channel/create.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ajv, logger, userRoom } from "../util.js";
import { ajv, logger, userRoom, channelRoom } from "../util.js";

const validate = ajv.compile({
type: "object",
Expand Down Expand Up @@ -41,7 +41,7 @@ export function createChannel({ io, socket, db }) {
// broadcast to other tabs of the same user
socket.to(userRoom(socket.userId)).emit("channel:created", channel);

io.in(userRoom(socket.userId)).socketsJoin(`channel:${channel.id}`);
io.in(userRoom(socket.userId)).socketsJoin(channelRoom(channel.id));

callback({
status: "OK",
Expand Down
4 changes: 2 additions & 2 deletions server/src/channel/join.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ajv, logger, userRoom } from "../util.js";
import { ajv, logger, userRoom, channelRoom } from "../util.js";

const validate = ajv.compile({
type: "object",
Expand Down Expand Up @@ -37,7 +37,7 @@ export function joinChannel({ io, socket, db }) {
// broadcast to the other tabs of the same user
socket.to(userRoom(socket.userId)).emit("channel:joined", channel);

io.in(userRoom(socket.userId)).socketsJoin(`channel:${channel.id}`);
io.in(userRoom(socket.userId)).socketsJoin(channelRoom(channel.id));

callback({
status: "OK",
Expand Down
4 changes: 2 additions & 2 deletions server/src/user/reach.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ajv, logger, userRoom } from "../util.js";
import { ajv, logger, userRoom, channelRoom } from "../util.js";

const validate = ajv.compile({
type: "object",
Expand Down Expand Up @@ -46,7 +46,7 @@ export function reachUser({ io, socket, db }) {
// broadcast to other tabs of the same user
socket.to(userRoom(socket.userId)).emit("channel:created", channel);

io.in(userRoom(socket.userId)).socketsJoin(`channel:${channel.id}`);
io.in(userRoom(socket.userId)).socketsJoin(channelRoom(channel.id));

callback({
status: "OK",
Expand Down