merged
This commit is contained in:
commit
230e824003
|
@ -39,7 +39,11 @@ export class ChatComponent implements OnInit, OnDestroy {
|
||||||
private store: Store<any>,
|
private store: Store<any>,
|
||||||
private logger: NGXLogger,
|
private logger: NGXLogger,
|
||||||
private sessionStorageService: SessionStorageService
|
private sessionStorageService: SessionStorageService
|
||||||
) {}
|
) {
|
||||||
|
this.sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
|
||||||
|
KEY_VER_INFO
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.roomSubscription = combineLatest([
|
this.roomSubscription = combineLatest([
|
||||||
|
|
|
@ -61,7 +61,9 @@ export class GroupComponent implements OnInit, OnDestroy {
|
||||||
loginRes: LoginResponse;
|
loginRes: LoginResponse;
|
||||||
loginResSubscription: Subscription;
|
loginResSubscription: Subscription;
|
||||||
|
|
||||||
sessionVerinfo: VersionInfo2Response;
|
sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
|
||||||
|
KEY_VER_INFO
|
||||||
|
);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private store: Store<any>,
|
private store: Store<any>,
|
||||||
|
@ -72,9 +74,6 @@ export class GroupComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
const loginInfo = this.sessionStorageService.get<LoginInfo>(KEY_LOGIN_INFO);
|
const loginInfo = this.sessionStorageService.get<LoginInfo>(KEY_LOGIN_INFO);
|
||||||
this.sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
|
|
||||||
KEY_VER_INFO
|
|
||||||
);
|
|
||||||
this.companyCode = loginInfo.companyCode;
|
this.companyCode = loginInfo.companyCode;
|
||||||
|
|
||||||
this.loginResSubscription = this.store
|
this.loginResSubscription = this.store
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<ucap-profile-user-list-item *ngFor="let userInfo of selectedDepartmentUserInfoList$ | async"
|
<ucap-profile-user-list-item *ngFor="let userInfo of selectedDepartmentUserInfoList$ | async"
|
||||||
[userInfo]="userInfo" [checkable]="true">
|
[userInfo]="userInfo" [checkable]="true" [sessionVerinfo]="sessionVerinfo">
|
||||||
</ucap-profile-user-list-item>
|
</ucap-profile-user-list-item>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -16,6 +16,8 @@ import * as QueryStore from '@app/store/messenger/query';
|
||||||
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
||||||
import { LoginInfo, KEY_LOGIN_INFO } from '@app/types';
|
import { LoginInfo, KEY_LOGIN_INFO } from '@app/types';
|
||||||
import { take, map, switchMap } from 'rxjs/operators';
|
import { take, map, switchMap } from 'rxjs/operators';
|
||||||
|
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
|
||||||
|
import { KEY_VER_INFO } from '@app/types/ver-info.type';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-layout-chat-left-sidenav-organization',
|
selector: 'app-layout-chat-left-sidenav-organization',
|
||||||
|
@ -29,6 +31,9 @@ export class OrganizationComponent implements OnInit {
|
||||||
selectedDepartmentStatus$: Observable<DeptUserResponse>;
|
selectedDepartmentStatus$: Observable<DeptUserResponse>;
|
||||||
|
|
||||||
loginInfo = this.sessionStorageService.get<LoginInfo>(KEY_LOGIN_INFO);
|
loginInfo = this.sessionStorageService.get<LoginInfo>(KEY_LOGIN_INFO);
|
||||||
|
sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
|
||||||
|
KEY_VER_INFO
|
||||||
|
);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private store: Store<any>,
|
private store: Store<any>,
|
||||||
|
|
|
@ -42,7 +42,9 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked {
|
||||||
roomInfoSubscription: Subscription;
|
roomInfoSubscription: Subscription;
|
||||||
userInfoList$: Observable<UserInfo[]>;
|
userInfoList$: Observable<UserInfo[]>;
|
||||||
eventListProcessing$: Observable<boolean>;
|
eventListProcessing$: Observable<boolean>;
|
||||||
sessionVerInfo: VersionInfo2Response;
|
sessionVerInfo = this.sessionStorageService.get<VersionInfo2Response>(
|
||||||
|
KEY_VER_INFO
|
||||||
|
);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private store: Store<any>,
|
private store: Store<any>,
|
||||||
|
@ -52,9 +54,6 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked {
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
const loginInfo = this.sessionStorageService.get<LoginInfo>(KEY_LOGIN_INFO);
|
const loginInfo = this.sessionStorageService.get<LoginInfo>(KEY_LOGIN_INFO);
|
||||||
this.sessionVerInfo = this.sessionStorageService.get<VersionInfo2Response>(
|
|
||||||
KEY_VER_INFO
|
|
||||||
);
|
|
||||||
|
|
||||||
this.loginResSubscription = this.store
|
this.loginResSubscription = this.store
|
||||||
.pipe(
|
.pipe(
|
||||||
|
|
|
@ -8,7 +8,8 @@ import {
|
||||||
SendNotification,
|
SendNotification,
|
||||||
ReadNotification,
|
ReadNotification,
|
||||||
CancelNotification,
|
CancelNotification,
|
||||||
DelNotification
|
DelNotification,
|
||||||
|
ReadRequest
|
||||||
} from '@ucap-webmessenger/protocol-event';
|
} from '@ucap-webmessenger/protocol-event';
|
||||||
|
|
||||||
export const info = createAction(
|
export const info = createAction(
|
||||||
|
@ -69,6 +70,24 @@ export const sendFailure = createAction(
|
||||||
props<{ error: any }>()
|
props<{ error: any }>()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const read = createAction(
|
||||||
|
'[Messenger::Event] read',
|
||||||
|
props<ReadRequest>()
|
||||||
|
);
|
||||||
|
|
||||||
|
export const readSuccess = createAction(
|
||||||
|
'[Messenger::Event] read Success',
|
||||||
|
props<{
|
||||||
|
infoList: Info[];
|
||||||
|
res: InfoResponse;
|
||||||
|
}>()
|
||||||
|
);
|
||||||
|
|
||||||
|
export const readFailure = createAction(
|
||||||
|
'[Messenger::Event] read Failure',
|
||||||
|
props<{ error: any }>()
|
||||||
|
);
|
||||||
|
|
||||||
export const sendNotification = createAction(
|
export const sendNotification = createAction(
|
||||||
'[Messenger::Event] Send Notification',
|
'[Messenger::Event] Send Notification',
|
||||||
props<{ noti: SendNotification }>()
|
props<{ noti: SendNotification }>()
|
||||||
|
|
|
@ -22,10 +22,12 @@ import {
|
||||||
EventProtocolService,
|
EventProtocolService,
|
||||||
SSVC_TYPE_EVENT_INFO_DATA,
|
SSVC_TYPE_EVENT_INFO_DATA,
|
||||||
SSVC_TYPE_EVENT_INFO_RES,
|
SSVC_TYPE_EVENT_INFO_RES,
|
||||||
SendResponse
|
SendResponse,
|
||||||
|
ReadResponse
|
||||||
} from '@ucap-webmessenger/protocol-event';
|
} from '@ucap-webmessenger/protocol-event';
|
||||||
|
|
||||||
import * as ChatStore from '@app/store/messenger/chat';
|
import * as ChatStore from '@app/store/messenger/chat';
|
||||||
|
import * as SyncStore from '@app/store/messenger/sync';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
info,
|
info,
|
||||||
|
@ -40,10 +42,15 @@ import {
|
||||||
readNotification,
|
readNotification,
|
||||||
cancelNotification,
|
cancelNotification,
|
||||||
delNotification,
|
delNotification,
|
||||||
recallInfoList
|
recallInfoList,
|
||||||
|
read,
|
||||||
|
readFailure
|
||||||
} from './actions';
|
} from './actions';
|
||||||
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
||||||
import { RoomInfo } from '@ucap-webmessenger/protocol-room';
|
import { RoomInfo } from '@ucap-webmessenger/protocol-room';
|
||||||
|
import { refreshRoom } from '../sync';
|
||||||
|
import { LoginInfo, KEY_LOGIN_INFO } from '@app/types';
|
||||||
|
import { Dictionary } from '@ngrx/entity';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Effects {
|
export class Effects {
|
||||||
|
@ -77,12 +84,28 @@ export class Effects {
|
||||||
infoList.push(...(res as InfoData).infoList);
|
infoList.push(...(res as InfoData).infoList);
|
||||||
break;
|
break;
|
||||||
case SSVC_TYPE_EVENT_INFO_RES:
|
case SSVC_TYPE_EVENT_INFO_RES:
|
||||||
this.store.dispatch(
|
{
|
||||||
infoSuccess({
|
this.store.dispatch(
|
||||||
infoList,
|
infoSuccess({
|
||||||
res: res as InfoResponse
|
infoList,
|
||||||
})
|
res: res as InfoResponse
|
||||||
);
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
if (req.baseSeq === 0) {
|
||||||
|
// 최초 이벤트 목록 조회시 SSVC_TYPE_EVENT_READ_REQ 수행.
|
||||||
|
const maxSeq = Math.max.apply(
|
||||||
|
Math,
|
||||||
|
infoList.map(v => v.seq)
|
||||||
|
);
|
||||||
|
this.store.dispatch(
|
||||||
|
read({
|
||||||
|
roomSeq: req.roomSeq,
|
||||||
|
lastReadSeq: Number(maxSeq)
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
@ -94,6 +117,28 @@ export class Effects {
|
||||||
{ dispatch: false }
|
{ dispatch: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
read$ = createEffect(
|
||||||
|
() => {
|
||||||
|
return this.actions$.pipe(
|
||||||
|
ofType(read),
|
||||||
|
switchMap(req => {
|
||||||
|
return this.eventProtocolService.read(req).pipe(
|
||||||
|
map((res: ReadResponse) => {
|
||||||
|
this.store.dispatch(
|
||||||
|
SyncStore.updateUnreadCount({
|
||||||
|
roomSeq: res.roomSeq,
|
||||||
|
noReadCnt: 0
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
catchError(error => of(readFailure({ error })))
|
||||||
|
);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
},
|
||||||
|
{ dispatch: false }
|
||||||
|
);
|
||||||
|
|
||||||
send$ = createEffect(() =>
|
send$ = createEffect(() =>
|
||||||
this.actions$.pipe(
|
this.actions$.pipe(
|
||||||
ofType(send),
|
ofType(send),
|
||||||
|
@ -166,13 +211,32 @@ export class Effects {
|
||||||
withLatestFrom(
|
withLatestFrom(
|
||||||
this.store.pipe(
|
this.store.pipe(
|
||||||
select((state: any) => state.messenger.room.roomInfo as RoomInfo)
|
select((state: any) => state.messenger.room.roomInfo as RoomInfo)
|
||||||
|
),
|
||||||
|
this.store.pipe(
|
||||||
|
select(
|
||||||
|
(state: any) =>
|
||||||
|
state.messenger.sync.room.entities as Dictionary<RoomInfo>
|
||||||
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
tap(([action, roomInfo]) => {
|
tap(([action, roomInfo, trgtRoomInfos]) => {
|
||||||
|
// opened room :: event add
|
||||||
if (!!roomInfo && roomInfo.roomSeq === action.roomSeq) {
|
if (!!roomInfo && roomInfo.roomSeq === action.roomSeq) {
|
||||||
this.store.dispatch(appendInfoList({ info: action.info }));
|
this.store.dispatch(appendInfoList({ info: action.info }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// not opened room :: unread count increased
|
||||||
|
if (!roomInfo || roomInfo.roomSeq !== action.roomSeq) {
|
||||||
|
const noReadCnt = trgtRoomInfos[action.roomSeq].noReadCnt;
|
||||||
|
this.store.dispatch(
|
||||||
|
SyncStore.updateUnreadCount({
|
||||||
|
roomSeq: action.roomSeq,
|
||||||
|
noReadCnt: noReadCnt + 1
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 대화 > 리스트 :: finalEventMessage refresh
|
||||||
this.store.dispatch(ChatStore.newEventMessage(action));
|
this.store.dispatch(ChatStore.newEventMessage(action));
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -201,13 +265,24 @@ export class Effects {
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
tap(([action, roomInfo]) => {
|
tap(([action, roomInfo]) => {
|
||||||
|
// 현재 방이 오픈되어 있으면 방내용 갱신
|
||||||
if (!!roomInfo && roomInfo.roomSeq === action.noti.roomSeq) {
|
if (!!roomInfo && roomInfo.roomSeq === action.noti.roomSeq) {
|
||||||
this.logger.debug('cancelNotification$', action, roomInfo);
|
this.logger.debug('cancelNotification$', action, roomInfo);
|
||||||
this.store.dispatch(
|
this.store.dispatch(
|
||||||
recallInfoList({ eventSeq: action.noti.eventSeq })
|
recallInfoList({ eventSeq: action.noti.eventSeq })
|
||||||
);
|
);
|
||||||
// this.store.dispatch(ChatStore.newEventMessage(action));
|
|
||||||
}
|
}
|
||||||
|
// 대화 > 리스트의 항목 갱신
|
||||||
|
const loginInfo = this.sessionStorageService.get<LoginInfo>(
|
||||||
|
KEY_LOGIN_INFO
|
||||||
|
);
|
||||||
|
this.store.dispatch(
|
||||||
|
SyncStore.refreshRoom({
|
||||||
|
roomSeq: action.noti.roomSeq,
|
||||||
|
isDetail: true,
|
||||||
|
localeCode: loginInfo.localeCode
|
||||||
|
})
|
||||||
|
);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,7 +10,8 @@ import {
|
||||||
import {
|
import {
|
||||||
RoomInfo,
|
RoomInfo,
|
||||||
UserInfoShort,
|
UserInfoShort,
|
||||||
UserInfo as RoomUserInfo
|
UserInfo as RoomUserInfo,
|
||||||
|
InfoRequest
|
||||||
} from '@ucap-webmessenger/protocol-room';
|
} from '@ucap-webmessenger/protocol-room';
|
||||||
import { Info } from '@ucap-webmessenger/protocol-event';
|
import { Info } from '@ucap-webmessenger/protocol-event';
|
||||||
|
|
||||||
|
@ -75,3 +76,28 @@ export const updateRoomForNewEventMessage = createAction(
|
||||||
info: Info;
|
info: Info;
|
||||||
}>()
|
}>()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const refreshRoom = createAction(
|
||||||
|
'[Messenger::Sync] refresh room in sync',
|
||||||
|
props<InfoRequest>()
|
||||||
|
);
|
||||||
|
export const refreshRoomSuccess = createAction(
|
||||||
|
'[Messenger::Sync] refresh room in sync Success',
|
||||||
|
props<{
|
||||||
|
roomInfo: RoomInfo;
|
||||||
|
userInfoShortList: UserInfoShort[];
|
||||||
|
userInfoList: RoomUserInfo[];
|
||||||
|
}>()
|
||||||
|
);
|
||||||
|
export const refreshRoomFailure = createAction(
|
||||||
|
'[Messenger::Sync] refresh room in sync Failure',
|
||||||
|
props<{ error: any }>()
|
||||||
|
);
|
||||||
|
|
||||||
|
export const updateUnreadCount = createAction(
|
||||||
|
'[Messenger::Sync] Update unread count',
|
||||||
|
props<{
|
||||||
|
roomSeq: string;
|
||||||
|
noReadCnt?: number;
|
||||||
|
}>()
|
||||||
|
);
|
||||||
|
|
|
@ -26,7 +26,10 @@ import {
|
||||||
room,
|
room,
|
||||||
roomFailure,
|
roomFailure,
|
||||||
roomSuccess,
|
roomSuccess,
|
||||||
updateRoomForNewEventMessage
|
updateRoomForNewEventMessage,
|
||||||
|
refreshRoom,
|
||||||
|
refreshRoomFailure,
|
||||||
|
refreshRoomSuccess
|
||||||
} from './actions';
|
} from './actions';
|
||||||
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
||||||
|
|
||||||
|
@ -54,7 +57,15 @@ import { regViewSuccess } from '@app/store/messenger/option';
|
||||||
import {
|
import {
|
||||||
RoomInfo,
|
RoomInfo,
|
||||||
UserInfoShort,
|
UserInfoShort,
|
||||||
UserInfo as RoomUserInfo
|
UserInfo as RoomUserInfo,
|
||||||
|
RoomProtocolService,
|
||||||
|
SSVC_TYPE_ROOM_INFO_ROOM,
|
||||||
|
SSVC_TYPE_ROOM_INFO_USER,
|
||||||
|
SSVC_TYPE_ROOM_INFO_USER2,
|
||||||
|
InfoData,
|
||||||
|
UserShortData,
|
||||||
|
UserData,
|
||||||
|
SSVC_TYPE_ROOM_INFO_RES
|
||||||
} from '@ucap-webmessenger/protocol-room';
|
} from '@ucap-webmessenger/protocol-room';
|
||||||
import { LoginInfo, KEY_LOGIN_INFO } from '@app/types';
|
import { LoginInfo, KEY_LOGIN_INFO } from '@app/types';
|
||||||
|
|
||||||
|
@ -328,10 +339,56 @@ export class Effects {
|
||||||
{ dispatch: false }
|
{ dispatch: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
refreshRoom$ = createEffect(
|
||||||
|
() => {
|
||||||
|
let roomInfo: RoomInfo;
|
||||||
|
let userInfoShortList: UserInfoShort[];
|
||||||
|
let userInfoList: RoomUserInfo[];
|
||||||
|
|
||||||
|
return this.actions$.pipe(
|
||||||
|
ofType(refreshRoom),
|
||||||
|
tap(() => {
|
||||||
|
roomInfo = null;
|
||||||
|
userInfoShortList = [];
|
||||||
|
userInfoList = [];
|
||||||
|
}),
|
||||||
|
switchMap(req => {
|
||||||
|
return this.roomProtocolService.info(req).pipe(
|
||||||
|
map(res => {
|
||||||
|
switch (res.SSVC_TYPE) {
|
||||||
|
case SSVC_TYPE_ROOM_INFO_ROOM:
|
||||||
|
roomInfo = (res as InfoData).roomInfo;
|
||||||
|
break;
|
||||||
|
case SSVC_TYPE_ROOM_INFO_USER:
|
||||||
|
userInfoShortList.push(...(res as UserShortData).userInfos);
|
||||||
|
break;
|
||||||
|
case SSVC_TYPE_ROOM_INFO_USER2:
|
||||||
|
userInfoList.push(...(res as UserData).userInfos);
|
||||||
|
break;
|
||||||
|
case SSVC_TYPE_ROOM_INFO_RES:
|
||||||
|
this.store.dispatch(
|
||||||
|
refreshRoomSuccess({
|
||||||
|
roomInfo,
|
||||||
|
userInfoShortList,
|
||||||
|
userInfoList
|
||||||
|
})
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
catchError(error => of(refreshRoomFailure({ error })))
|
||||||
|
);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
},
|
||||||
|
{ dispatch: false }
|
||||||
|
);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private actions$: Actions,
|
private actions$: Actions,
|
||||||
private store: Store<any>,
|
private store: Store<any>,
|
||||||
private syncProtocolService: SyncProtocolService,
|
private syncProtocolService: SyncProtocolService,
|
||||||
|
private roomProtocolService: RoomProtocolService,
|
||||||
private sessionStorageService: SessionStorageService,
|
private sessionStorageService: SessionStorageService,
|
||||||
private logger: NGXLogger
|
private logger: NGXLogger
|
||||||
) {}
|
) {}
|
||||||
|
|
|
@ -11,7 +11,9 @@ import {
|
||||||
buddy2Success,
|
buddy2Success,
|
||||||
group2Success,
|
group2Success,
|
||||||
roomSuccess,
|
roomSuccess,
|
||||||
updateRoomForNewEventMessage
|
updateRoomForNewEventMessage,
|
||||||
|
refreshRoomSuccess,
|
||||||
|
updateUnreadCount
|
||||||
} from './actions';
|
} from './actions';
|
||||||
import {
|
import {
|
||||||
RoomUserDetailData,
|
RoomUserDetailData,
|
||||||
|
@ -113,6 +115,52 @@ export const reducer = createReducer(
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
on(refreshRoomSuccess, (state, action) => {
|
||||||
|
const roomUserList: RoomUserDetailData[] = [];
|
||||||
|
const roomUserShortList: RoomUserData[] = [];
|
||||||
|
|
||||||
|
if (action.userInfoList) {
|
||||||
|
roomUserList.push({
|
||||||
|
roomSeq: action.roomInfo.roomSeq,
|
||||||
|
userInfos: action.userInfoList
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (action.userInfoShortList) {
|
||||||
|
roomUserShortList.push({
|
||||||
|
roomSeq: action.roomInfo.roomSeq,
|
||||||
|
userInfos: action.userInfoShortList
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
room: adapterRoom.upsertOne(action.roomInfo, {
|
||||||
|
...state.room
|
||||||
|
}),
|
||||||
|
roomUser: adapterRoomUser.upsertMany(roomUserList, {
|
||||||
|
...state.roomUser
|
||||||
|
}),
|
||||||
|
roomUserShort: adapterRoomUserShort.upsertMany(roomUserShortList, {
|
||||||
|
...state.roomUserShort
|
||||||
|
})
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
|
||||||
|
on(updateUnreadCount, (state, action) => {
|
||||||
|
const roomInfo: RoomInfo = {
|
||||||
|
...state.room.entities[action.roomSeq],
|
||||||
|
noReadCnt: action.noReadCnt
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
room: adapterRoom.updateOne(
|
||||||
|
{ id: action.roomSeq, changes: roomInfo },
|
||||||
|
{ ...state.room }
|
||||||
|
)
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
|
||||||
on(AuthenticationStore.logout, (state, action) => {
|
on(AuthenticationStore.logout, (state, action) => {
|
||||||
return {
|
return {
|
||||||
...initialState
|
...initialState
|
||||||
|
|
|
@ -8,11 +8,7 @@ import {
|
||||||
import { NGXLogger } from 'ngx-logger';
|
import { NGXLogger } from 'ngx-logger';
|
||||||
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
|
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
|
||||||
import { EventType } from '@ucap-webmessenger/protocol-event';
|
import { EventType } from '@ucap-webmessenger/protocol-event';
|
||||||
import {
|
import { FileInfo, StickerInfo } from '@ucap-webmessenger/ui-chat';
|
||||||
FileInfo,
|
|
||||||
StickerInfo,
|
|
||||||
MassTextInfo
|
|
||||||
} from '@ucap-webmessenger/ui-chat';
|
|
||||||
import { FileType } from '@ucap-webmessenger/protocol-file';
|
import { FileType } from '@ucap-webmessenger/protocol-file';
|
||||||
import {
|
import {
|
||||||
LoginResponse,
|
LoginResponse,
|
||||||
|
@ -43,51 +39,7 @@ export class ListItemComponent implements OnInit {
|
||||||
if (this.roomInfo.isTimeRoom) {
|
if (this.roomInfo.isTimeRoom) {
|
||||||
this.finalEventMessage = '비밀 대화방입니다.';
|
this.finalEventMessage = '비밀 대화방입니다.';
|
||||||
} else {
|
} else {
|
||||||
try {
|
this.finalEventMessage = this.roomInfo.finalEventMessage;
|
||||||
switch (this.roomInfo.finalEventType) {
|
|
||||||
case EventType.File:
|
|
||||||
{
|
|
||||||
let msg = 'Attach File';
|
|
||||||
const contentJson: FileInfo = JSON.parse(
|
|
||||||
this.roomInfo.finalEventMessage
|
|
||||||
);
|
|
||||||
if (contentJson.FileType === FileType.File) {
|
|
||||||
msg = '첨부파일';
|
|
||||||
} else if (contentJson.FileType === FileType.Image) {
|
|
||||||
msg = '이미지';
|
|
||||||
} else if (contentJson.FileType === FileType.Video) {
|
|
||||||
msg = '동영상';
|
|
||||||
}
|
|
||||||
this.finalEventMessage = msg;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EventType.Sticker:
|
|
||||||
{
|
|
||||||
let msg = '스티커';
|
|
||||||
const contentJson: StickerInfo = JSON.parse(
|
|
||||||
this.roomInfo.finalEventMessage
|
|
||||||
);
|
|
||||||
if (contentJson.chat) {
|
|
||||||
msg += ' ' + contentJson.chat;
|
|
||||||
}
|
|
||||||
this.finalEventMessage = msg;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EventType.MassText:
|
|
||||||
{
|
|
||||||
const contentJson: MassTextInfo = JSON.parse(
|
|
||||||
this.roomInfo.finalEventMessage
|
|
||||||
);
|
|
||||||
this.finalEventMessage = contentJson.Content;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
this.finalEventMessage = this.roomInfo.finalEventMessage;
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
this.logger.error(e);
|
|
||||||
this.finalEventMessage = this.roomInfo.finalEventMessage;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user