diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/event/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/event/effects.ts index 28a134f3..5d91b087 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/event/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/event/effects.ts @@ -101,6 +101,7 @@ import { InfoResponse as FileInfoResponse, FileType } from '@ucap-webmessenger/protocol-file'; +import { RoomUserData } from '@ucap-webmessenger/protocol-sync'; @Injectable() export class Effects { @@ -393,21 +394,41 @@ export class Effects { () => { return this.actions$.pipe( ofType(forward), - map(action => { + withLatestFrom( + this.store.pipe( + select( + (state: any) => + state.messenger.sync.roomUserShort.entities as Dictionary< + RoomUserData + > + ) + ) + ), + tap(([action, roomUserList]) => { if (!!action.trgtRoomSeq) { this.store.dispatch( - ChatStore.selectedRoom({ roomSeq: action.trgtRoomSeq }) - ); - this.store.dispatch( - send({ + forwardAfterRoomOpen({ senderSeq: action.senderSeq, - req: { - roomSeq: action.trgtRoomSeq, - eventType: action.req.eventType, - sentMessage: action.req.sentMessage - } + req: action.req, + trgtUserSeqs: roomUserList[action.trgtRoomSeq].userInfos.map( + user => user.seq + ) }) ); + + // this.store.dispatch( + // ChatStore.selectedRoom({ roomSeq: action.trgtRoomSeq }) + // ); + // this.store.dispatch( + // send({ + // senderSeq: action.senderSeq, + // req: { + // roomSeq: action.trgtRoomSeq, + // eventType: action.req.eventType, + // sentMessage: action.req.sentMessage + // } + // }) + // ); } else if (!!action.trgtUserSeqs && action.trgtUserSeqs.length > 0) { // 방오픈 후 대화전달. this.store.dispatch(forwardAfterRoomOpen(action));