대화타입에 따라 노티, snackbar 출력하지 않도록 수정.
case EventType.Join: case EventType.Exit: case EventType.ForcedExit: case EventType.RenameRoom: case EventType.NotificationForTimerRoom: case EventType.GuideForRoomTimerChanged:
This commit is contained in:
parent
9bb14a3fac
commit
3f61451be6
|
@ -968,32 +968,36 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
onExistNewMessage(info: Info<EventJson>) {
|
||||
let message = '';
|
||||
|
||||
const senderUser = this.userInfoListSubject.value.filter(
|
||||
user => user.seq === info.senderSeq
|
||||
);
|
||||
if (!!senderUser && senderUser.length > 0) {
|
||||
message += `${senderUser[0].name} : `;
|
||||
}
|
||||
message += StringUtil.convertFinalEventMessage(
|
||||
const contents = StringUtil.convertFinalEventMessage(
|
||||
info.type,
|
||||
info.sentMessageJson || info.sentMessage
|
||||
);
|
||||
|
||||
this.snackBarPreviewEvent = this.snackBarService.open(
|
||||
message,
|
||||
this.translateService.instant('common.messages.confirm'),
|
||||
{
|
||||
// duration: 3000,
|
||||
verticalPosition: 'bottom',
|
||||
horizontalPosition: 'center',
|
||||
panelClass: ['chat-snackbar-class']
|
||||
if (!!contents) {
|
||||
const senderUser = this.userInfoListSubject.value.filter(
|
||||
user => user.seq === info.senderSeq
|
||||
);
|
||||
if (!!senderUser && senderUser.length > 0) {
|
||||
message += `${senderUser[0].name} : `;
|
||||
}
|
||||
);
|
||||
this.snackBarPreviewEvent.onAction().subscribe(() => {
|
||||
this.chatMessages.initEventMore();
|
||||
this.chatMessages.scrollToBottom();
|
||||
this.snackBarPreviewEvent.dismiss();
|
||||
});
|
||||
message += contents;
|
||||
|
||||
this.snackBarPreviewEvent = this.snackBarService.open(
|
||||
message,
|
||||
this.translateService.instant('common.messages.confirm'),
|
||||
{
|
||||
// duration: 3000,
|
||||
verticalPosition: 'bottom',
|
||||
horizontalPosition: 'center',
|
||||
panelClass: ['chat-snackbar-class']
|
||||
}
|
||||
);
|
||||
this.snackBarPreviewEvent.onAction().subscribe(() => {
|
||||
this.chatMessages.initEventMore();
|
||||
this.chatMessages.scrollToBottom();
|
||||
this.snackBarPreviewEvent.dismiss();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
saveFile(
|
||||
|
|
|
@ -24,7 +24,8 @@ import {
|
|||
SSVC_TYPE_EVENT_CANCEL_NOTI,
|
||||
SSVC_TYPE_EVENT_DEL_RES,
|
||||
SSVC_TYPE_EVENT_SEND_RES,
|
||||
SSVC_TYPE_EVENT_READ_RES
|
||||
SSVC_TYPE_EVENT_READ_RES,
|
||||
EventType
|
||||
} from '@ucap-webmessenger/protocol-event';
|
||||
import {
|
||||
InfoProtocolService,
|
||||
|
@ -248,30 +249,35 @@ export class AppNotificationService {
|
|||
);
|
||||
audio.play();
|
||||
} else {
|
||||
const notiReq: NotificationRequest = {
|
||||
type: NotificationType.Event,
|
||||
seq: noti.roomSeq,
|
||||
title: this.translateService.instant(
|
||||
'notification.titleChatEventArrived'
|
||||
),
|
||||
contents: StringUtil.convertFinalEventMessage(
|
||||
noti.eventType,
|
||||
noti.info.sentMessageJson
|
||||
),
|
||||
image: '',
|
||||
useSound: [
|
||||
NotificationMethod.Sound,
|
||||
NotificationMethod.SoundAndAlert
|
||||
].some(
|
||||
n => n === appUserInfo.settings.notification.method
|
||||
)
|
||||
? true
|
||||
: false,
|
||||
displayTime:
|
||||
appUserInfo.settings.notification
|
||||
.alertExposureTime * 1000
|
||||
};
|
||||
this.nativeService.notify(notiReq);
|
||||
const contents = StringUtil.convertFinalEventMessage(
|
||||
noti.eventType,
|
||||
noti.info.sentMessageJson
|
||||
);
|
||||
|
||||
if (!!contents) {
|
||||
const notiReq: NotificationRequest = {
|
||||
type: NotificationType.Event,
|
||||
seq: noti.roomSeq,
|
||||
title: this.translateService.instant(
|
||||
'notification.titleChatEventArrived'
|
||||
),
|
||||
contents,
|
||||
image: '',
|
||||
useSound: [
|
||||
NotificationMethod.Sound,
|
||||
NotificationMethod.SoundAndAlert
|
||||
].some(
|
||||
n =>
|
||||
n === appUserInfo.settings.notification.method
|
||||
)
|
||||
? true
|
||||
: false,
|
||||
displayTime:
|
||||
appUserInfo.settings.notification
|
||||
.alertExposureTime * 1000
|
||||
};
|
||||
this.nativeService.notify(notiReq);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user