대화방멸 알림 설정에 따른 노티 출력 여부, 현재 방일 경우에 대한 노티 출력여부 처리.
This commit is contained in:
parent
1eda1df54f
commit
97e65426f3
|
@ -41,7 +41,8 @@ import {
|
||||||
SSVC_TYPE_ROOM_EXIT_FORCING_RES,
|
SSVC_TYPE_ROOM_EXIT_FORCING_RES,
|
||||||
SSVC_TYPE_ROOM_EXIT_RES,
|
SSVC_TYPE_ROOM_EXIT_RES,
|
||||||
SSVC_TYPE_ROOM_INVITE_RES,
|
SSVC_TYPE_ROOM_INVITE_RES,
|
||||||
ExitForcingResponse
|
ExitForcingResponse,
|
||||||
|
RoomInfo
|
||||||
} from '@ucap-webmessenger/protocol-room';
|
} from '@ucap-webmessenger/protocol-room';
|
||||||
import {
|
import {
|
||||||
StatusProtocolService,
|
StatusProtocolService,
|
||||||
|
@ -100,6 +101,7 @@ import { AppUserInfo, KEY_APP_USER_INFO } from '@app/types/app-user-info.type';
|
||||||
|
|
||||||
import { environment } from '../../environments/environment';
|
import { environment } from '../../environments/environment';
|
||||||
import { NotificationMethod } from '@ucap-webmessenger/core';
|
import { NotificationMethod } from '@ucap-webmessenger/core';
|
||||||
|
import { Dictionary } from '@ngrx/entity';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class AppNotificationService {
|
export class AppNotificationService {
|
||||||
|
@ -151,7 +153,18 @@ export class AppNotificationService {
|
||||||
|
|
||||||
this.eventProtocolService.notification$
|
this.eventProtocolService.notification$
|
||||||
.pipe(
|
.pipe(
|
||||||
tap(notiOrRes => {
|
withLatestFrom(
|
||||||
|
this.store.pipe(
|
||||||
|
select((state: any) => state.messenger.room.roomInfo as RoomInfo)
|
||||||
|
),
|
||||||
|
this.store.pipe(
|
||||||
|
select(
|
||||||
|
(state: any) =>
|
||||||
|
state.messenger.sync.room.entities as Dictionary<RoomInfo>
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
tap(([notiOrRes, curRoomInfo, roomList]) => {
|
||||||
switch (notiOrRes.SSVC_TYPE) {
|
switch (notiOrRes.SSVC_TYPE) {
|
||||||
case SSVC_TYPE_EVENT_SEND_RES:
|
case SSVC_TYPE_EVENT_SEND_RES:
|
||||||
case SSVC_TYPE_EVENT_SEND_NOTI:
|
case SSVC_TYPE_EVENT_SEND_NOTI:
|
||||||
|
@ -170,6 +183,26 @@ export class AppNotificationService {
|
||||||
|
|
||||||
// notification..
|
// notification..
|
||||||
if (notiOrRes.SSVC_TYPE === SSVC_TYPE_EVENT_SEND_NOTI) {
|
if (notiOrRes.SSVC_TYPE === SSVC_TYPE_EVENT_SEND_NOTI) {
|
||||||
|
let doNoti = true;
|
||||||
|
|
||||||
|
// 방별 알림이 꺼져 있으면 노티 안함.
|
||||||
|
if (
|
||||||
|
!!roomList[noti.roomSeq] &&
|
||||||
|
!roomList[noti.roomSeq].receiveAlarm
|
||||||
|
) {
|
||||||
|
doNoti = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 현재 열려 있는 방일경우 노티 안함.
|
||||||
|
if (
|
||||||
|
!!curRoomInfo &&
|
||||||
|
!!curRoomInfo.roomSeq &&
|
||||||
|
curRoomInfo.roomSeq === noti.roomSeq
|
||||||
|
) {
|
||||||
|
doNoti = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doNoti) {
|
||||||
const appUserInfo = this.localStorageService.encGet<
|
const appUserInfo = this.localStorageService.encGet<
|
||||||
AppUserInfo
|
AppUserInfo
|
||||||
>(KEY_APP_USER_INFO, environment.customConfig.appKey);
|
>(KEY_APP_USER_INFO, environment.customConfig.appKey);
|
||||||
|
@ -200,6 +233,7 @@ export class AppNotificationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case SSVC_TYPE_EVENT_READ_RES:
|
case SSVC_TYPE_EVENT_READ_RES:
|
||||||
case SSVC_TYPE_EVENT_READ_NOTI:
|
case SSVC_TYPE_EVENT_READ_NOTI:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user