From bc9d5764c82b2dffba7495ac0544ada2fb312847 Mon Sep 17 00:00:00 2001 From: leejinho Date: Wed, 5 Feb 2020 17:49:53 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B0=95=ED=87=B4=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=EC=84=B8=EC=8A=A4=20=EA=B0=9C=EC=84=A0.=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=20=ED=99=94=EB=A9=B4=20=EA=B0=B1=EC=8B=A0=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/app/services/notification.service.ts | 31 +++++++------ .../src/app/store/messenger/sync/effects.ts | 46 +++++++++++++------ 2 files changed, 49 insertions(+), 28 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts index 24d23d61..bd44be2a 100644 --- a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts @@ -574,26 +574,29 @@ export class AppNotificationService { ); if (noti.userSeqs.indexOf(loginResInfo.userSeq) >= 0) { + // 강퇴 대상이 본인이면 열려 있는 대화방을 닫고, 대화리스트에서 삭제. this.store.dispatch( RoomStore.exitForcingNotification({ noti }) ); + } else { + // ROOM::열려 있는 대화방에서 강퇴 인원의 isJoinRoom = false 로 변경. + this.store.dispatch( + RoomStore.exitNotificationOthers({ + roomSeq: noti.roomSeq, + trgtUser: noti.userSeqs + }) + ); + + // SYNC::대화리스트의 대화자정보에서 강퇴 인원의 isJoinRoom = false 로 변경. + this.store.dispatch( + SyncStore.clearRoomUsers({ + roomSeq: noti.roomSeq, + userSeqs: noti.userSeqs + }) + ); } - - this.store.dispatch( - RoomStore.exitNotificationOthers({ - roomSeq: noti.roomSeq, - trgtUser: noti.userSeqs - }) - ); - - this.store.dispatch( - SyncStore.clearRoomUsers({ - roomSeq: noti.roomSeq, - userSeqs: noti.userSeqs - }) - ); } break; case SSVC_TYPE_ROOM_FONT_UPD_NOTI: diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts index b52dc94c..fc15f990 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/effects.ts @@ -53,7 +53,8 @@ import { delBuddyAndClear, moveGroupMember, moveGroupFromFailure, - moveGroupToFailure + moveGroupToFailure, + clearRoomUsers } from './actions'; import { SessionStorageService } from '@ucap-webmessenger/web-storage'; import { LoginInfo, KEY_LOGIN_INFO } from '@app/types'; @@ -598,22 +599,37 @@ export class Effects { ) ), tap(([action, roomInfo, roomSyncDate]) => { - if (!!roomInfo && roomInfo.roomSeq === action.res.roomSeq) { - this.store.dispatch( - ChatStore.selectedRoom({ roomSeq: action.res.roomSeq }) - ); - } - - const loginInfo = this.sessionStorageService.get( - KEY_LOGIN_INFO - ); - + // ROOM::열려 있는 대화방에서 강퇴 인원의 isJoinRoom = false 로 변경. this.store.dispatch( - room({ - syncDate: roomSyncDate, - localeCode: loginInfo.localeCode + RoomStore.exitNotificationOthers({ + roomSeq: action.res.roomSeq, + trgtUser: action.res.userSeqs }) ); + + // SYNC::대화리스트의 대화자정보에서 강퇴 인원의 isJoinRoom = false 로 변경. + this.store.dispatch( + clearRoomUsers({ + roomSeq: action.res.roomSeq, + userSeqs: action.res.userSeqs + }) + ); + // if (!!roomInfo && roomInfo.roomSeq === action.res.roomSeq) { + // this.store.dispatch( + // ChatStore.selectedRoom({ roomSeq: action.res.roomSeq }) + // ); + // } + + // const loginInfo = this.sessionStorageService.get( + // KEY_LOGIN_INFO + // ); + + // this.store.dispatch( + // room({ + // syncDate: roomSyncDate, + // localeCode: loginInfo.localeCode + // }) + // ); }) ); }, @@ -631,9 +647,11 @@ export class Effects { ), tap(([action, roomInfo]) => { if (!!roomInfo && roomInfo.roomSeq === action.noti.roomSeq) { + // 열려 있는 대화방을 닫음. this.store.dispatch(ChatStore.clearSelectedRoom()); } + // sync.roomList 에서 방 삭제. this.store.dispatch( RoomStore.exitSuccess({ res: {