Merge branch 'master' of https://git.loafle.net/ucap-web/next-ucap-messenger
This commit is contained in:
commit
1d0dcf3791
|
@ -968,16 +968,19 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
onExistNewMessage(info: Info<EventJson>) {
|
onExistNewMessage(info: Info<EventJson>) {
|
||||||
let message = '';
|
let message = '';
|
||||||
|
|
||||||
|
const contents = StringUtil.convertFinalEventMessage(
|
||||||
|
info.type,
|
||||||
|
info.sentMessageJson || info.sentMessage
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!!contents) {
|
||||||
const senderUser = this.userInfoListSubject.value.filter(
|
const senderUser = this.userInfoListSubject.value.filter(
|
||||||
user => user.seq === info.senderSeq
|
user => user.seq === info.senderSeq
|
||||||
);
|
);
|
||||||
if (!!senderUser && senderUser.length > 0) {
|
if (!!senderUser && senderUser.length > 0) {
|
||||||
message += `${senderUser[0].name} : `;
|
message += `${senderUser[0].name} : `;
|
||||||
}
|
}
|
||||||
message += StringUtil.convertFinalEventMessage(
|
message += contents;
|
||||||
info.type,
|
|
||||||
info.sentMessageJson || info.sentMessage
|
|
||||||
);
|
|
||||||
|
|
||||||
this.snackBarPreviewEvent = this.snackBarService.open(
|
this.snackBarPreviewEvent = this.snackBarService.open(
|
||||||
message,
|
message,
|
||||||
|
@ -995,6 +998,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
this.snackBarPreviewEvent.dismiss();
|
this.snackBarPreviewEvent.dismiss();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
saveFile(
|
saveFile(
|
||||||
value: {
|
value: {
|
||||||
|
|
|
@ -24,7 +24,8 @@ import {
|
||||||
SSVC_TYPE_EVENT_CANCEL_NOTI,
|
SSVC_TYPE_EVENT_CANCEL_NOTI,
|
||||||
SSVC_TYPE_EVENT_DEL_RES,
|
SSVC_TYPE_EVENT_DEL_RES,
|
||||||
SSVC_TYPE_EVENT_SEND_RES,
|
SSVC_TYPE_EVENT_SEND_RES,
|
||||||
SSVC_TYPE_EVENT_READ_RES
|
SSVC_TYPE_EVENT_READ_RES,
|
||||||
|
EventType
|
||||||
} from '@ucap-webmessenger/protocol-event';
|
} from '@ucap-webmessenger/protocol-event';
|
||||||
import {
|
import {
|
||||||
InfoProtocolService,
|
InfoProtocolService,
|
||||||
|
@ -248,22 +249,26 @@ export class AppNotificationService {
|
||||||
);
|
);
|
||||||
audio.play();
|
audio.play();
|
||||||
} else {
|
} else {
|
||||||
|
const contents = StringUtil.convertFinalEventMessage(
|
||||||
|
noti.eventType,
|
||||||
|
noti.info.sentMessageJson
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!!contents) {
|
||||||
const notiReq: NotificationRequest = {
|
const notiReq: NotificationRequest = {
|
||||||
type: NotificationType.Event,
|
type: NotificationType.Event,
|
||||||
seq: noti.roomSeq,
|
seq: noti.roomSeq,
|
||||||
title: this.translateService.instant(
|
title: this.translateService.instant(
|
||||||
'notification.titleChatEventArrived'
|
'notification.titleChatEventArrived'
|
||||||
),
|
),
|
||||||
contents: StringUtil.convertFinalEventMessage(
|
contents,
|
||||||
noti.eventType,
|
|
||||||
noti.info.sentMessageJson
|
|
||||||
),
|
|
||||||
image: '',
|
image: '',
|
||||||
useSound: [
|
useSound: [
|
||||||
NotificationMethod.Sound,
|
NotificationMethod.Sound,
|
||||||
NotificationMethod.SoundAndAlert
|
NotificationMethod.SoundAndAlert
|
||||||
].some(
|
].some(
|
||||||
n => n === appUserInfo.settings.notification.method
|
n =>
|
||||||
|
n === appUserInfo.settings.notification.method
|
||||||
)
|
)
|
||||||
? true
|
? true
|
||||||
: false,
|
: false,
|
||||||
|
@ -277,6 +282,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