diff --git a/README.md b/README.md
index 16813cb..3f78be3 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,9 @@
## ๐ฅ ์ฐธ๊ฐํ ์ฌ๋๋ค
+
+![Project Logo](images/catheeyong.jpg)
+
์ด๋ฆ | diff --git a/src/chats/chats.gateway.ts b/src/chats/chats.gateway.ts index 7dc49e2..20c3b3f 100644 --- a/src/chats/chats.gateway.ts +++ b/src/chats/chats.gateway.ts @@ -107,13 +107,15 @@ export class ChatsGateway ); // MongoDB์ socketModel์ ์ฌ์ฉ์ ์ ๋ณด ์ ์ฅ - await this.socketModel.create({ + const userInfo = await this.socketModel.create({ socketId: socket.id, nickname: payload.nickname, roomId: payload.roomId, profileImg: payload.profileImg, userId: payload.userId, }); + // sockets db์ ์ ์ฅ๋ ์ ์ ์ ๋ณด๋ฅผ userList๋ฐฐ์ด์ ์ถ๊ฐ + this.userList.push(userInfo); // ์ด์ ์ฑํ ๋ด์ฉ์ ๋ถ๋ฌ์ต๋๋ค. const chatHistory = await this.getChatHistory(payload.roomId); @@ -127,6 +129,7 @@ export class ChatsGateway // ์ด์ ์ฑํ ๋ด์ฉ๊ณผ ํจ๊ป ์ฌ์ฉ์ ์ ๋ณด๋ฅผ ํด๋ผ์ด์ธํธ์๊ฒ ์ ์กํฉ๋๋ค. socket.emit('chat_history', chatHistory); + // this.server.to(String(payload.roomId)).emit('chat_history', chatHistory); // ๋ฐฉ์ ์๋ ๋ชจ๋ ์ฌ์ฉ์์๊ฒ userList ์ ์ก this.server.to(String(payload.roomId)).emit('user_connected', payload); // console.log('์ ์ ๋ฆฌ์คํธ ์ฝ์', this.userList); @@ -174,7 +177,6 @@ export class ChatsGateway nickname: messageData.nickname, profileImg: messageData.profileImg, roomId: messageData.roomId, - time: messageData.time, chat: messageData.message, // ์์ : messageData.message๋ฅผ ์ฌ์ฉํ์ฌ ์ฑํ ์ ์ฅ });
---|