diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts
index 7177bf8f..b0311a2e 100644
--- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts
+++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/messages.component.ts
@@ -467,6 +467,11 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
}
get _roomUserInfos() {
+ if (this.roomInfoSubject.value.roomType === RoomType.Single) {
+ return this.userInfoListSubject.value.filter(roomUserInfo => {
+ return this.loginResSubject.value.userSeq !== roomUserInfo.seq;
+ });
+ } else {
return this.userInfoListSubject.value
.filter(roomUserInfo => {
return (
@@ -475,6 +480,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
);
})
.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
+ }
}
getRoomNameByRoomUser(roomUserInfos: (UserInfo | UserInfoShort)[]) {
diff --git a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html
index 47ebce10..e67132ad 100644
--- a/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html
+++ b/projects/ucap-webmessenger-app/src/app/layouts/native/components/top-bar.component.html
@@ -361,7 +361,10 @@
onApplyStatusMessage(1, statusMessage1.value)
"
(edit)="$event.stopPropagation()"
- (cancel)="$event.stopPropagation()"
+ (cancel)="
+ $event.stopPropagation();
+ statusMessage1.value = loginRes?.statusMessage1
+ "
class="form-eidt"
>
{{ loginRes?.statusMessage1 }}
@@ -386,7 +389,10 @@
onApplyStatusMessage(2, statusMessage2.value)
"
(edit)="$event.stopPropagation()"
- (cancel)="$event.stopPropagation()"
+ (cancel)="
+ $event.stopPropagation();
+ statusMessage2.value = loginRes?.statusMessage2
+ "
class="form-eidt"
>
{{ loginRes?.statusMessage2 }}
@@ -411,7 +417,10 @@
onApplyStatusMessage(3, statusMessage3.value)
"
(edit)="$event.stopPropagation()"
- (cancel)="$event.stopPropagation()"
+ (cancel)="
+ $event.stopPropagation();
+ statusMessage3.value = loginRes?.statusMessage3
+ "
class="form-eidt"
>
{{ loginRes?.statusMessage3 }}
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 cabed623..06b4b4a4 100644
--- a/projects/ucap-webmessenger-app/src/app/services/notification.service.ts
+++ b/projects/ucap-webmessenger-app/src/app/services/notification.service.ts
@@ -11,7 +11,8 @@ import {
AuthenticationProtocolService,
LogoutResponse,
LogoutRemoteNotification,
- LogoutNotification
+ LogoutNotification,
+ LoginResponse
} from '@ucap-webmessenger/protocol-authentication';
import { NGXLogger } from 'ngx-logger';
@@ -446,7 +447,15 @@ export class AppNotificationService {
.subscribe();
this.roomProtocolService.notification$
.pipe(
- tap(notiOrRes => {
+ withLatestFrom(
+ this.store.pipe(
+ select(
+ (state: any) =>
+ state.account.authentication.loginRes as LoginResponse
+ )
+ )
+ ),
+ tap(([notiOrRes, loginResInfo]) => {
switch (notiOrRes.SSVC_TYPE) {
case SSVC_TYPE_ROOM_INVITE_RES:
{
@@ -506,11 +515,29 @@ export class AppNotificationService {
'Notification::roomProtocolService::ExitNotification',
noti
);
- this.store.dispatch(
- RoomStore.exitNotification({
- noti
- })
- );
+
+ if (noti.SENDER_SEQ === loginResInfo.userSeq) {
+ this.store.dispatch(
+ RoomStore.exitNotification({
+ noti
+ })
+ );
+ } else {
+ this.store.dispatch(
+ RoomStore.exitNotificationOthers({
+ noti
+ })
+ );
+
+ if (!!noti && !!noti.SENDER_SEQ) {
+ this.store.dispatch(
+ SyncStore.clearRoomUsers({
+ roomSeq: noti.roomSeq,
+ userSeqs: [noti.SENDER_SEQ]
+ })
+ );
+ }
+ }
}
break;
case SSVC_TYPE_ROOM_EXIT_FORCING_RES:
diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/room/actions.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/room/actions.ts
index 884db051..02427292 100644
--- a/projects/ucap-webmessenger-app/src/app/store/messenger/room/actions.ts
+++ b/projects/ucap-webmessenger-app/src/app/store/messenger/room/actions.ts
@@ -42,6 +42,11 @@ export const infoFailure = createAction(
props<{ error: any }>()
);
+export const clearRoomUser = createAction(
+ '[Messenger::Room] clear room users',
+ props<{ userSeqs: number[] }>()
+);
+
export const inviteNotification = createAction(
'[Messenger::Room] Invite Notification',
props<{ noti: InviteNotification }>()
@@ -51,6 +56,10 @@ export const exitNotification = createAction(
'[Messenger::Room] Exit Notification',
props<{ noti: ExitNotification }>()
);
+export const exitNotificationOthers = createAction(
+ '[Messenger::Room] Exit Notification By Others',
+ props<{ noti: ExitNotification }>()
+);
export const exitForcing = createAction(
'[Messenger::Room] Exit Forcing',
diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/room/effects.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/room/effects.ts
index 262522ac..966aa15a 100644
--- a/projects/ucap-webmessenger-app/src/app/store/messenger/room/effects.ts
+++ b/projects/ucap-webmessenger-app/src/app/store/messenger/room/effects.ts
@@ -67,7 +67,9 @@ import {
updateTimeRoomIntervalFailure,
exitForcing,
exitForcingFailure,
- exitForcingSuccess
+ exitForcingSuccess,
+ exitNotificationOthers,
+ clearRoomUser
} from './actions';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import { LoginInfo, KEY_LOGIN_INFO } from '@app/types';
@@ -340,6 +342,31 @@ export class Effects {
},
{ dispatch: false }
);
+ exitNotificationOthers$ = createEffect(
+ () => {
+ return this.actions$.pipe(
+ ofType(exitNotificationOthers),
+ withLatestFrom(
+ this.store.pipe(
+ select((state: any) => state.messenger.room.roomInfo as RoomInfo)
+ )
+ ),
+ tap(([action, roomInfo]) => {
+ if (
+ !!roomInfo &&
+ roomInfo.roomSeq === action.noti.roomSeq &&
+ !!action.noti &&
+ !!action.noti.SENDER_SEQ
+ ) {
+ this.store.dispatch(
+ clearRoomUser({ userSeqs: [action.noti.SENDER_SEQ] })
+ );
+ }
+ })
+ );
+ },
+ { dispatch: false }
+ );
updateFontNotification$ = createEffect(
() => {
diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/room/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/room/reducers.ts
index aa09416f..5969f577 100644
--- a/projects/ucap-webmessenger-app/src/app/store/messenger/room/reducers.ts
+++ b/projects/ucap-webmessenger-app/src/app/store/messenger/room/reducers.ts
@@ -4,7 +4,8 @@ import {
infoSuccess,
updateSuccess,
updateRoomUserLastReadSeq,
- updateTimeRoomIntervalSuccess
+ updateTimeRoomIntervalSuccess,
+ clearRoomUser
} from './actions';
import * as AuthenticationStore from '@app/store/account/authentication';
@@ -26,6 +27,18 @@ export const reducer = createReducer(
};
}),
+ on(clearRoomUser, (state, action) => {
+ return {
+ ...state,
+ userInfoList: adapterUserInfo.removeMany(action.userSeqs, {
+ ...state.userInfoList
+ }),
+ userInfoShortList: adapterUserInfoShort.removeMany(action.userSeqs, {
+ ...state.userInfoShortList
+ })
+ };
+ }),
+
on(updateSuccess, (state, action) => {
return {
...state,
diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/actions.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/actions.ts
index 340d503c..342f2a60 100644
--- a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/actions.ts
+++ b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/actions.ts
@@ -263,3 +263,9 @@ export const delGroupFailure = createAction(
'[Messenger::Sync] Group Del Failure',
props<{ error: any }>()
);
+
+/** 방 인원 클리어 */
+export const clearRoomUsers = createAction(
+ '[Messenger::Sync] Clear room users.',
+ props<{ roomSeq: string; userSeqs: number[] }>()
+);
diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts
index e253f0de..5b231591 100644
--- a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts
+++ b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts
@@ -17,7 +17,8 @@ import {
createGroupSuccess,
delBuddySuccess,
delGroupSuccess,
- updateBuddySuccess
+ updateBuddySuccess,
+ clearRoomUsers
} from './actions';
import {
RoomUserDetailData,
@@ -101,6 +102,52 @@ export const reducer = createReducer(
};
}),
+ on(clearRoomUsers, (state, action) => {
+ let roomUserList: RoomUserDetailData = {
+ ...state.roomUser.entities[action.roomSeq]
+ };
+ if (
+ !!roomUserList &&
+ !!roomUserList.userInfos &&
+ roomUserList.userInfos.length > 0
+ ) {
+ const userInfos = roomUserList.userInfos.filter(
+ userInfo => action.userSeqs.indexOf(userInfo.seq) < 0
+ );
+ roomUserList = {
+ ...roomUserList,
+ userInfos
+ };
+ }
+
+ let roomUserShortList: RoomUserData = {
+ ...state.roomUserShort.entities[action.roomSeq]
+ };
+ if (
+ !!roomUserShortList &&
+ !!roomUserShortList.userInfos &&
+ roomUserShortList.userInfos.length > 0
+ ) {
+ const userInfos = roomUserShortList.userInfos.filter(
+ userInfo => action.userSeqs.indexOf(userInfo.seq) < 0
+ );
+ roomUserShortList = {
+ ...roomUserShortList,
+ userInfos
+ };
+ }
+
+ return {
+ ...state,
+ roomUser: adapterRoomUser.upsertOne(roomUserList, {
+ ...state.roomUser
+ }),
+ roomUserShort: adapterRoomUserShort.upsertOne(roomUserShortList, {
+ ...state.roomUserShort
+ })
+ };
+ }),
+
on(updateRoomForNewEventMessage, (state, action) => {
const finalEventMessage:
| string
diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts
index 6c16307f..9e391fbe 100644
--- a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts
+++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts
@@ -141,6 +141,7 @@ export class MessagesComponent implements OnInit, OnDestroy {
moment = moment;
readToHereEvent: Info;
+ existReadToHereEvent = true;
swapped = false;
hidden = false;
@@ -168,27 +169,37 @@ export class MessagesComponent implements OnInit, OnDestroy {
this.initEventMore();
this.roomInfo = roomInfo;
+
+ /** [S] initializing by changed room */
+ // reset :: roomLastEventSeq
+ if (!!roomInfo && !!roomInfo.finalEventSeq) {
+ this.initRoomLastEventSeq = roomInfo.finalEventSeq;
+ }
+ // clear :: readToHearEvent object
+ this.readToHereEvent = undefined;
+ this.existReadToHereEvent = true;
+ /** [E] initializing by changed room */
});
this.eventListSubscription = this.eventList$.subscribe(eventList => {
- if (!!eventList && eventList.length > 0 && this.baseEventSeq === 0) {
- this.initRoomLastEventSeq = eventList[eventList.length - 1].seq;
- }
-
- if (
- !!eventList &&
- eventList.length > 0 &&
- this.baseEventSeq > 0 &&
- !!this.roomInfo &&
- !!this.roomInfo.lastReadEventSeq &&
- this.baseEventSeq <= this.roomInfo.lastReadEventSeq
- ) {
- // 기존 대화 내용이 있는 상태에서 추가로 조회된 내용중에 read here 가 있을 경우.
- this.firstCheckReadHere = false;
- }
-
this.eventList = eventList;
- this.readToHereEvent = this.getReadHere();
+ if (!!eventList && eventList.length > 0) {
+ if (!this.readToHereEvent && this.existReadToHereEvent) {
+ this.readToHereEvent = this.getReadHere();
+ }
+
+ if (
+ this.baseEventSeq > 0 &&
+ !!this.roomInfo &&
+ !!this.roomInfo.lastReadEventSeq &&
+ this.baseEventSeq <= this.roomInfo.lastReadEventSeq
+ ) {
+ // 기존 대화 내용이 있는 상태에서 추가로 조회된 내용중에 read here 가 있을 경우.
+ this.firstCheckReadHere = false;
+ }
+ } else {
+ this.readToHereEvent = undefined;
+ }
this.changeDetectorRef.detectChanges();
@@ -298,13 +309,9 @@ export class MessagesComponent implements OnInit, OnDestroy {
// if (!this.userInfos || 0 === this.userInfos.length) {
// return '';
// }
- const unreadCnt = this.userInfos.filter(user => {
- if (message.senderSeq === user.seq) {
- // 본인 글은 unreadCount 에 포함하지 않는다.
- return false;
- }
- return user.lastReadEventSeq < message.seq;
- }).length;
+ const unreadCnt = this.userInfos
+ .filter(user => user.isJoinRoom && user.seq !== message.senderSeq)
+ .filter(user => user.lastReadEventSeq < message.seq).length;
return unreadCnt === 0 ? '' : unreadCnt;
}
@@ -363,6 +370,8 @@ export class MessagesComponent implements OnInit, OnDestroy {
);
}
}
+ } else {
+ this.existReadToHereEvent = false;
}
return undefined;
}
diff --git a/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.html b/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.html
index 5effde68..b462077e 100644
--- a/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.html
+++ b/projects/ucap-webmessenger-ui-profile/src/lib/components/profile.component.html
@@ -73,7 +73,9 @@
$event.stopPropagation(); onApplyIntroMessage(introMessage.value)
"
(edit)="$event.stopPropagation()"
- (cancel)="$event.stopPropagation()"
+ (cancel)="
+ $event.stopPropagation(); introMessage.value = userInfo.intro
+ "
class="form-eidt"
>
{{ userInfo.intro }}
@@ -167,20 +169,6 @@
-
-
- {{ 'profile.fieldCompany' | translate }}
- {{ userInfo.companyName | ucapStringEmptycheck }}
diff --git a/projects/ucap-webmessenger-ui-room/src/lib/components/list-item.component.ts b/projects/ucap-webmessenger-ui-room/src/lib/components/list-item.component.ts
index b14ec23f..de72d7b2 100644
--- a/projects/ucap-webmessenger-ui-room/src/lib/components/list-item.component.ts
+++ b/projects/ucap-webmessenger-ui-room/src/lib/components/list-item.component.ts
@@ -94,13 +94,20 @@ export class ListItemComponent implements OnInit {
}
get _roomUserInfos() {
- return this.roomUserInfo
- .filter(roomUserInfo => {
- return (
- this.loginRes.userSeq !== roomUserInfo.seq && roomUserInfo.isJoinRoom
- );
- })
- .sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
+ if (this.roomInfo.roomType === RoomType.Single) {
+ return this.roomUserInfo.filter(roomUserInfo => {
+ return this.loginRes.userSeq !== roomUserInfo.seq;
+ });
+ } else {
+ return this.roomUserInfo
+ .filter(roomUserInfo => {
+ return (
+ this.loginRes.userSeq !== roomUserInfo.seq &&
+ roomUserInfo.isJoinRoom
+ );
+ })
+ .sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
+ }
}
getRoomNameByRoomUser(roomUserInfos: (RoomUserInfo | UserInfoShort)[]) {