Merge branch 'master' of https://git.loafle.net/ucap-web/next-ucap-messenger
This commit is contained in:
commit
1d0dcf3791
|
@ -968,32 +968,36 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
onExistNewMessage(info: Info<EventJson>) {
|
onExistNewMessage(info: Info<EventJson>) {
|
||||||
let message = '';
|
let message = '';
|
||||||
|
|
||||||
const senderUser = this.userInfoListSubject.value.filter(
|
const contents = StringUtil.convertFinalEventMessage(
|
||||||
user => user.seq === info.senderSeq
|
|
||||||
);
|
|
||||||
if (!!senderUser && senderUser.length > 0) {
|
|
||||||
message += `${senderUser[0].name} : `;
|
|
||||||
}
|
|
||||||
message += StringUtil.convertFinalEventMessage(
|
|
||||||
info.type,
|
info.type,
|
||||||
info.sentMessageJson || info.sentMessage
|
info.sentMessageJson || info.sentMessage
|
||||||
);
|
);
|
||||||
|
|
||||||
this.snackBarPreviewEvent = this.snackBarService.open(
|
if (!!contents) {
|
||||||
message,
|
const senderUser = this.userInfoListSubject.value.filter(
|
||||||
this.translateService.instant('common.messages.confirm'),
|
user => user.seq === info.senderSeq
|
||||||
{
|
);
|
||||||
// duration: 3000,
|
if (!!senderUser && senderUser.length > 0) {
|
||||||
verticalPosition: 'bottom',
|
message += `${senderUser[0].name} : `;
|
||||||
horizontalPosition: 'center',
|
|
||||||
panelClass: ['chat-snackbar-class']
|
|
||||||
}
|
}
|
||||||
);
|
message += contents;
|
||||||
this.snackBarPreviewEvent.onAction().subscribe(() => {
|
|
||||||
this.chatMessages.initEventMore();
|
this.snackBarPreviewEvent = this.snackBarService.open(
|
||||||
this.chatMessages.scrollToBottom();
|
message,
|
||||||
this.snackBarPreviewEvent.dismiss();
|
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(
|
saveFile(
|
||||||
|
|
|
@ -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,30 +249,35 @@ export class AppNotificationService {
|
||||||
);
|
);
|
||||||
audio.play();
|
audio.play();
|
||||||
} else {
|
} else {
|
||||||
const notiReq: NotificationRequest = {
|
const contents = StringUtil.convertFinalEventMessage(
|
||||||
type: NotificationType.Event,
|
noti.eventType,
|
||||||
seq: noti.roomSeq,
|
noti.info.sentMessageJson
|
||||||
title: this.translateService.instant(
|
);
|
||||||
'notification.titleChatEventArrived'
|
|
||||||
),
|
if (!!contents) {
|
||||||
contents: StringUtil.convertFinalEventMessage(
|
const notiReq: NotificationRequest = {
|
||||||
noti.eventType,
|
type: NotificationType.Event,
|
||||||
noti.info.sentMessageJson
|
seq: noti.roomSeq,
|
||||||
),
|
title: this.translateService.instant(
|
||||||
image: '',
|
'notification.titleChatEventArrived'
|
||||||
useSound: [
|
),
|
||||||
NotificationMethod.Sound,
|
contents,
|
||||||
NotificationMethod.SoundAndAlert
|
image: '',
|
||||||
].some(
|
useSound: [
|
||||||
n => n === appUserInfo.settings.notification.method
|
NotificationMethod.Sound,
|
||||||
)
|
NotificationMethod.SoundAndAlert
|
||||||
? true
|
].some(
|
||||||
: false,
|
n =>
|
||||||
displayTime:
|
n === appUserInfo.settings.notification.method
|
||||||
appUserInfo.settings.notification
|
)
|
||||||
.alertExposureTime * 1000
|
? true
|
||||||
};
|
: false,
|
||||||
this.nativeService.notify(notiReq);
|
displayTime:
|
||||||
|
appUserInfo.settings.notification
|
||||||
|
.alertExposureTime * 1000
|
||||||
|
};
|
||||||
|
this.nativeService.notify(notiReq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user