1. 다른디바이스와의 Sync 처리. ::: EVENT_RES, EVENT_READ_RES

2. 대화리스트의 finalEventMessage 갱신되지 않는 문제 수정 :: virture scroll 처리 제거.
This commit is contained in:
leejh 2019-10-29 10:10:08 +09:00
parent 266f690ea3
commit eb0f86578d
7 changed files with 61 additions and 15 deletions

View File

@ -1,6 +1,10 @@
import { JsonObject } from 'type-fest';
export class JsonAnalization {
/**
* Raw string Analization for JSON string.
* @description Editing with string.util.ts
*/
public static receiveAnalization(jsonStr: string): JsonObject {
const startJson = jsonStr.indexOf('{');
const endJson = jsonStr.lastIndexOf('}');

View File

@ -21,7 +21,17 @@
</mat-form-field>
</div>
<div class="app-layout-chat-left-sidenav-chat-list" perfectScrollbar>
<cdk-virtual-scroll-viewport
<ucap-room-list-item
*ngFor="let room of getRoomList()"
[loginRes]="loginRes"
[roomInfo]="room"
[roomUserInfo]="getRoomUserList(room)"
[sessionVerinfo]="sessionVerinfo"
(click)="onSelectedRoom(room)"
(contextmenu)="onContextMenuChat($event, room)"
>
</ucap-room-list-item>
<!-- <cdk-virtual-scroll-viewport
itemSize="20"
class="app-layout-chat-left-sidenav-chat-list-viewport"
>
@ -35,7 +45,7 @@
(contextmenu)="onContextMenuChat($event, room)"
>
</ucap-room-list-item>
</cdk-virtual-scroll-viewport>
</cdk-virtual-scroll-viewport> -->
</div>
<div

View File

@ -20,7 +20,9 @@ import {
SSVC_TYPE_EVENT_READ_NOTI,
SSVC_TYPE_EVENT_CANCEL_NOTI,
SSVC_TYPE_EVENT_DEL_RES,
Info
Info,
SSVC_TYPE_EVENT_SEND_RES,
SSVC_TYPE_EVENT_READ_RES
} from '@ucap-webmessenger/protocol-event';
import {
InfoProtocolService,
@ -104,6 +106,7 @@ export class AppNotificationService {
.pipe(
tap(notiOrRes => {
switch (notiOrRes.SSVC_TYPE) {
case SSVC_TYPE_EVENT_SEND_RES:
case SSVC_TYPE_EVENT_SEND_NOTI:
{
const noti = notiOrRes as SendNotification;
@ -119,6 +122,7 @@ export class AppNotificationService {
);
}
break;
case SSVC_TYPE_EVENT_READ_RES:
case SSVC_TYPE_EVENT_READ_NOTI:
{
// 대화방 unread count 처리.

View File

@ -39,6 +39,8 @@ export const newInfo = createAction(
props<{
roomSeq: string;
info: Info;
SVC_TYPE?: number;
SSVC_TYPE?: number;
}>()
);

View File

@ -25,6 +25,7 @@ import {
Info,
InfoResponse,
EventProtocolService,
SVC_TYPE_EVENT,
SSVC_TYPE_EVENT_INFO_DATA,
SSVC_TYPE_EVENT_INFO_RES,
SendResponse,
@ -207,7 +208,12 @@ export class Effects {
};
this.store.dispatch(
newInfo({ roomSeq: res.roomSeq, info: appendInfo })
newInfo({
roomSeq: res.roomSeq,
info: appendInfo,
SVC_TYPE: res.SVC_TYPE,
SSVC_TYPE: res.SSVC_TYPE
})
);
})
);
@ -231,7 +237,12 @@ export class Effects {
};
this.store.dispatch(
newInfo({ roomSeq: noti.roomSeq, info: appendInfo })
newInfo({
roomSeq: noti.roomSeq,
info: appendInfo,
SVC_TYPE: noti.SVC_TYPE,
SSVC_TYPE: noti.SSVC_TYPE
})
);
})
);
@ -368,15 +379,25 @@ export class Effects {
}
// not opened room :: unread count increased
if (!roomInfo || roomInfo.roomSeq !== action.roomSeq) {
if (!!trgtRoomInfos && !!trgtRoomInfos[action.roomSeq]) {
const noReadCnt = trgtRoomInfos[action.roomSeq].noReadCnt;
this.store.dispatch(
SyncStore.updateUnreadCount({
roomSeq: action.roomSeq,
noReadCnt: noReadCnt + 1
})
);
if (
action.SVC_TYPE === SVC_TYPE_EVENT &&
action.SSVC_TYPE === SSVC_TYPE_EVENT_INFO_RES
) {
/**
* RES noti .
* unread count .
*/
} else {
if (!roomInfo || roomInfo.roomSeq !== action.roomSeq) {
if (!!trgtRoomInfos && !!trgtRoomInfos[action.roomSeq]) {
const noReadCnt = trgtRoomInfos[action.roomSeq].noReadCnt;
this.store.dispatch(
SyncStore.updateUnreadCount({
roomSeq: action.roomSeq,
noReadCnt: noReadCnt + 1
})
);
}
}
}

View File

@ -34,7 +34,9 @@ import {
SSVC_TYPE_EVENT_CANCEL_NOTI,
SSVC_TYPE_EVENT_SEND_NOTI,
SSVC_TYPE_EVENT_READ_NOTI,
SSVC_TYPE_EVENT_DEL_RES
SSVC_TYPE_EVENT_DEL_RES,
SSVC_TYPE_EVENT_SEND_RES,
SSVC_TYPE_EVENT_READ_RES
} from '../types/service';
import {
SendRequest,
@ -92,11 +94,13 @@ export class EventProtocolService {
filter(message => message.serviceType === SVC_TYPE_EVENT),
tap(message => {
switch (message.subServiceType) {
case SSVC_TYPE_EVENT_SEND_RES:
case SSVC_TYPE_EVENT_SEND_NOTI:
{
this.notificationSubject.next(decodeSendNotification(message));
}
break;
case SSVC_TYPE_EVENT_READ_RES:
case SSVC_TYPE_EVENT_READ_NOTI:
{
this.notificationSubject.next(decodeReadNotification(message));

View File

@ -37,6 +37,7 @@ export class StringUtil {
/**
* Json String Analization.
* @description Editing with json.util.ts
*/
public static receiveAnalization(jsonStr: string): JsonObject {
const startJson = jsonStr.indexOf('{');