# 이슈처리

[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; trgtRoomSeq?: string;
}>() }>()
); );
export const roomOpenAfterForward = createAction(
'[Messenger::Event] roomOpenAfterForward',
props<{
senderSeq: number;
req: SendRequest;
trgtUserSeqs?: number[];
trgtRoomSeq?: string;
}>()
);
export const sendMass = createAction( export const sendMass = createAction(
'[Messenger::Event] Send Mass', '[Messenger::Event] Send Mass',

View File

@ -74,7 +74,8 @@ import {
infoIntervalClear, infoIntervalClear,
fileInfo, fileInfo,
fileInfoSuccess, fileInfoSuccess,
fileInfoFailure fileInfoFailure,
roomOpenAfterForward
} from './actions'; } from './actions';
import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { import {
@ -394,41 +395,10 @@ export class Effects {
() => { () => {
return this.actions$.pipe( return this.actions$.pipe(
ofType(forward), ofType(forward),
withLatestFrom( tap(action => {
this.store.pipe(
select(
(state: any) =>
state.messenger.sync.roomUserShort.entities as Dictionary<
RoomUserData
>
)
)
),
tap(([action, roomUserList]) => {
if (!!action.trgtRoomSeq) { if (!!action.trgtRoomSeq) {
this.store.dispatch( // 대화전달 후 방오픈.
forwardAfterRoomOpen({ this.store.dispatch(roomOpenAfterForward(action));
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
// }
// })
// );
} else if (!!action.trgtUserSeqs && action.trgtUserSeqs.length > 0) { } else if (!!action.trgtUserSeqs && action.trgtUserSeqs.length > 0) {
// 방오픈 후 대화전달. // 방오픈 후 대화전달.
this.store.dispatch(forwardAfterRoomOpen(action)); 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( sendMass$ = createEffect(
() => { () => {
return this.actions$.pipe( return this.actions$.pipe(