# 이슈처리

[66 비밀대화방으로 전달 시 일반대화방으로 전달됨] :: 대화방 전달시 대화방 인원 수집후 기존 로직을 태우던 것을 대화방에 일단 전송 후 대화방을 여는 로직으로 수정.
This commit is contained in:
leejinho 2019-12-09 09:58:43 +09:00
parent 2a6623f7b0
commit 6a3ca4da7b
2 changed files with 42 additions and 35 deletions

View File

@ -131,6 +131,15 @@ export const forwardAfterRoomOpen = createAction(
trgtRoomSeq?: string;
}>()
);
export const roomOpenAfterForward = createAction(
'[Messenger::Event] roomOpenAfterForward',
props<{
senderSeq: number;
req: SendRequest;
trgtUserSeqs?: number[];
trgtRoomSeq?: string;
}>()
);
export const sendMass = createAction(
'[Messenger::Event] Send Mass',

View File

@ -74,7 +74,8 @@ import {
infoIntervalClear,
fileInfo,
fileInfoSuccess,
fileInfoFailure
fileInfoFailure,
roomOpenAfterForward
} from './actions';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import {
@ -394,41 +395,10 @@ export class Effects {
() => {
return this.actions$.pipe(
ofType(forward),
withLatestFrom(
this.store.pipe(
select(
(state: any) =>
state.messenger.sync.roomUserShort.entities as Dictionary<
RoomUserData
>
)
)
),
tap(([action, roomUserList]) => {
tap(action => {
if (!!action.trgtRoomSeq) {
this.store.dispatch(
forwardAfterRoomOpen({
senderSeq: action.senderSeq,
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
// }
// })
// );
// 대화전달 후 방오픈.
this.store.dispatch(roomOpenAfterForward(action));
} else if (!!action.trgtUserSeqs && action.trgtUserSeqs.length > 0) {
// 방오픈 후 대화전달.
this.store.dispatch(forwardAfterRoomOpen(action));
@ -471,6 +441,34 @@ export class Effects {
)
);
roomOpenAfterForward$ = createEffect(() =>
this.actions$.pipe(
ofType(roomOpenAfterForward),
concatMap(action => {
return this.eventProtocolService
.send({
roomSeq: action.trgtRoomSeq,
eventType: action.req.eventType,
sentMessage: action.req.sentMessage
})
.pipe(
map((res: SendResponse) => {
this.store.dispatch(
newInfo({
roomSeq: res.roomSeq,
info: res.info,
SVC_TYPE: res.SVC_TYPE,
SSVC_TYPE: res.SSVC_TYPE
})
);
return ChatStore.selectedRoom({ roomSeq: action.trgtRoomSeq });
}),
catchError(error => of(sendFailure({ error })))
);
})
)
);
sendMass$ = createEffect(
() => {
return this.actions$.pipe(