2019-10-10 06:53:08 +00:00
|
|
|
import {
|
|
|
|
Component,
|
|
|
|
OnInit,
|
|
|
|
OnDestroy,
|
|
|
|
AfterViewChecked,
|
|
|
|
ViewChild,
|
|
|
|
ElementRef
|
|
|
|
} from '@angular/core';
|
2019-10-16 09:05:18 +00:00
|
|
|
import {
|
|
|
|
ucapAnimations,
|
|
|
|
SnackBarService,
|
|
|
|
ClipboardService,
|
2019-10-24 01:45:28 +00:00
|
|
|
DialogService,
|
|
|
|
ConfirmDialogComponent,
|
|
|
|
ConfirmDialogData,
|
|
|
|
ConfirmDialogResult
|
2019-10-16 09:05:18 +00:00
|
|
|
} from '@ucap-webmessenger/ui';
|
2019-10-08 04:31:33 +00:00
|
|
|
import { Store, select } from '@ngrx/store';
|
|
|
|
import { NGXLogger } from 'ngx-logger';
|
2019-10-08 08:57:57 +00:00
|
|
|
import { Observable, Subscription } from 'rxjs';
|
2019-10-16 07:33:19 +00:00
|
|
|
import {
|
|
|
|
Info,
|
|
|
|
EventType,
|
|
|
|
isRecalled,
|
|
|
|
isCopyable,
|
|
|
|
isRecallable
|
|
|
|
} from '@ucap-webmessenger/protocol-event';
|
2019-10-08 04:31:33 +00:00
|
|
|
|
|
|
|
import * as AppStore from '@app/store';
|
2019-10-08 05:34:37 +00:00
|
|
|
import * as EventStore from '@app/store/messenger/event';
|
2019-10-11 09:03:01 +00:00
|
|
|
import * as ChatStore from '@app/store/messenger/chat';
|
2019-10-11 06:55:27 +00:00
|
|
|
import * as RoomStore from '@app/store/messenger/room';
|
2019-10-08 04:31:33 +00:00
|
|
|
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
|
|
|
|
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
2019-10-24 08:04:58 +00:00
|
|
|
import {
|
|
|
|
EnvironmentsInfo,
|
|
|
|
KEY_ENVIRONMENTS_INFO,
|
|
|
|
UserSelectDialogType
|
|
|
|
} from '@app/types';
|
2019-10-22 00:30:23 +00:00
|
|
|
import { RoomInfo, UserInfo, RoomType } from '@ucap-webmessenger/protocol-room';
|
2019-10-16 09:05:18 +00:00
|
|
|
import { tap, take } from 'rxjs/operators';
|
2019-10-14 04:53:22 +00:00
|
|
|
import { FileInfo } from '@ucap-webmessenger/ui-chat';
|
2019-10-15 05:58:11 +00:00
|
|
|
import { KEY_VER_INFO } from '@app/types/ver-info.type';
|
|
|
|
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
|
2019-10-16 07:33:19 +00:00
|
|
|
import { MatMenuTrigger } from '@angular/material';
|
2019-10-16 09:05:18 +00:00
|
|
|
import { CommonApiService } from '@ucap-webmessenger/api-common';
|
2019-10-17 00:18:55 +00:00
|
|
|
import {
|
2019-10-24 08:04:58 +00:00
|
|
|
CreateChatDialogComponent,
|
|
|
|
CreateChatDialogData,
|
|
|
|
CreateChatDialogResult
|
|
|
|
} from '../dialogs/chat/create-chat.dialog.component';
|
2019-10-29 00:07:06 +00:00
|
|
|
import {
|
|
|
|
ImageViewerDialogComponent,
|
|
|
|
ImageViewerDialogData,
|
|
|
|
ImageViewerDialogResult
|
|
|
|
} from '@app/layouts/common/dialogs/image-viewer.dialog.component';
|
2019-10-28 09:03:27 +00:00
|
|
|
import { Maximum_Range } from '@ucap-webmessenger/core';
|
2019-10-29 02:39:34 +00:00
|
|
|
import { PerfectScrollbarComponent } from 'ngx-perfect-scrollbar';
|
2019-09-23 05:23:24 +00:00
|
|
|
|
|
|
|
@Component({
|
2019-09-26 02:11:22 +00:00
|
|
|
selector: 'app-layout-messenger-messages',
|
2019-09-23 05:23:24 +00:00
|
|
|
templateUrl: './messages.component.html',
|
|
|
|
styleUrls: ['./messages.component.scss'],
|
|
|
|
animations: ucapAnimations
|
|
|
|
})
|
2019-10-10 06:53:08 +00:00
|
|
|
export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked {
|
|
|
|
@ViewChild('messageBoxContainer', { static: true })
|
|
|
|
private messageBoxContainer: ElementRef;
|
|
|
|
|
2019-10-16 07:33:19 +00:00
|
|
|
@ViewChild('messageContextMenuTrigger', { static: true })
|
|
|
|
messageContextMenuTrigger: MatMenuTrigger;
|
|
|
|
messageContextMenuPosition = { x: '0px', y: '0px' };
|
|
|
|
|
2019-10-29 02:39:34 +00:00
|
|
|
@ViewChild('psChatContent', { static: true })
|
|
|
|
psChatContent: PerfectScrollbarComponent;
|
|
|
|
|
2019-10-16 09:05:18 +00:00
|
|
|
environmentsInfo: EnvironmentsInfo;
|
|
|
|
|
2019-10-08 05:59:22 +00:00
|
|
|
loginRes: LoginResponse;
|
|
|
|
loginResSubscription: Subscription;
|
2019-10-08 04:31:33 +00:00
|
|
|
eventList$: Observable<Info[]>;
|
2019-10-08 05:34:37 +00:00
|
|
|
roomInfo: RoomInfo;
|
|
|
|
roomInfoSubscription: Subscription;
|
2019-10-22 00:30:23 +00:00
|
|
|
userInfoList: UserInfo[];
|
|
|
|
userInfoListSubscription: Subscription;
|
2019-10-08 06:25:00 +00:00
|
|
|
eventListProcessing$: Observable<boolean>;
|
2019-10-16 09:05:18 +00:00
|
|
|
sessionVerInfo: VersionInfo2Response;
|
2019-10-08 04:31:33 +00:00
|
|
|
|
2019-10-16 07:33:19 +00:00
|
|
|
isRecalledMessage = isRecalled;
|
|
|
|
isCopyableMessage = isCopyable;
|
|
|
|
isRecallableMessage = isRecallable;
|
|
|
|
|
2019-10-21 04:36:58 +00:00
|
|
|
fileDragOver = false;
|
|
|
|
files: File[];
|
|
|
|
|
2019-10-08 04:31:33 +00:00
|
|
|
constructor(
|
|
|
|
private store: Store<any>,
|
|
|
|
private sessionStorageService: SessionStorageService,
|
2019-10-16 09:05:18 +00:00
|
|
|
private commonApiService: CommonApiService,
|
|
|
|
private clipboardService: ClipboardService,
|
|
|
|
private dialogService: DialogService,
|
|
|
|
private snackBarService: SnackBarService,
|
2019-10-08 04:31:33 +00:00
|
|
|
private logger: NGXLogger
|
2019-10-16 09:05:18 +00:00
|
|
|
) {
|
|
|
|
this.sessionVerInfo = this.sessionStorageService.get<VersionInfo2Response>(
|
|
|
|
KEY_VER_INFO
|
|
|
|
);
|
|
|
|
|
|
|
|
this.environmentsInfo = this.sessionStorageService.get<EnvironmentsInfo>(
|
|
|
|
KEY_ENVIRONMENTS_INFO
|
|
|
|
);
|
|
|
|
}
|
2019-10-08 04:31:33 +00:00
|
|
|
|
|
|
|
ngOnInit() {
|
2019-10-08 05:59:22 +00:00
|
|
|
this.loginResSubscription = this.store
|
|
|
|
.pipe(
|
|
|
|
select(AppStore.AccountSelector.AuthenticationSelector.loginRes),
|
|
|
|
tap(loginRes => {
|
|
|
|
this.loginRes = loginRes;
|
|
|
|
})
|
|
|
|
)
|
|
|
|
.subscribe();
|
2019-09-23 05:23:24 +00:00
|
|
|
|
2019-10-08 05:34:37 +00:00
|
|
|
this.roomInfoSubscription = this.store
|
|
|
|
.pipe(
|
|
|
|
select(AppStore.MessengerSelector.RoomSelector.roomInfo),
|
|
|
|
tap(roomInfo => {
|
|
|
|
this.roomInfo = roomInfo;
|
|
|
|
})
|
|
|
|
)
|
|
|
|
.subscribe();
|
|
|
|
|
2019-10-22 00:30:23 +00:00
|
|
|
this.userInfoListSubscription = this.store
|
|
|
|
.pipe(
|
|
|
|
select(AppStore.MessengerSelector.RoomSelector.userInfoList),
|
|
|
|
tap(userInfoList => {
|
|
|
|
this.userInfoList = userInfoList;
|
|
|
|
})
|
|
|
|
)
|
|
|
|
.subscribe();
|
2019-10-11 02:40:35 +00:00
|
|
|
|
2019-10-08 06:25:00 +00:00
|
|
|
this.eventListProcessing$ = this.store.pipe(
|
|
|
|
select(AppStore.MessengerSelector.EventSelector.infoListProcessing)
|
|
|
|
);
|
|
|
|
|
2019-10-08 04:31:33 +00:00
|
|
|
this.eventList$ = this.store.pipe(
|
2019-10-15 10:09:26 +00:00
|
|
|
select(AppStore.MessengerSelector.EventSelector.selectAllInfoList)
|
2019-10-08 04:31:33 +00:00
|
|
|
);
|
2019-10-10 06:53:08 +00:00
|
|
|
|
2019-10-29 02:39:34 +00:00
|
|
|
this.psChatContent.directiveRef.scrollToBottom(0, 0);
|
2019-10-08 04:31:33 +00:00
|
|
|
}
|
2019-09-23 05:23:24 +00:00
|
|
|
|
2019-10-08 05:34:37 +00:00
|
|
|
ngOnDestroy(): void {
|
2019-10-08 05:59:22 +00:00
|
|
|
if (!!this.loginResSubscription) {
|
|
|
|
this.loginResSubscription.unsubscribe();
|
|
|
|
}
|
2019-10-08 05:34:37 +00:00
|
|
|
if (!!this.roomInfoSubscription) {
|
|
|
|
this.roomInfoSubscription.unsubscribe();
|
|
|
|
}
|
2019-10-22 00:30:23 +00:00
|
|
|
if (!!this.userInfoListSubscription) {
|
|
|
|
this.userInfoListSubscription.unsubscribe();
|
|
|
|
}
|
2019-10-08 05:34:37 +00:00
|
|
|
}
|
|
|
|
|
2019-10-10 06:53:08 +00:00
|
|
|
ngAfterViewChecked(): void {
|
2019-10-29 02:39:34 +00:00
|
|
|
this.psChatContent.directiveRef.scrollToBottom(0, 0);
|
2019-10-10 06:53:08 +00:00
|
|
|
}
|
|
|
|
|
2019-10-22 00:30:23 +00:00
|
|
|
getRoomName() {
|
|
|
|
if (!this.roomInfo || !this.userInfoList) {
|
|
|
|
return '대화방명을 가져오고 있습니다..';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!!this.roomInfo.roomName && '' !== this.roomInfo.roomName.trim()) {
|
|
|
|
return this.roomInfo.roomName;
|
|
|
|
} else if (this.roomInfo.roomType === RoomType.Mytalk) {
|
|
|
|
return 'MyTalk';
|
|
|
|
} else {
|
|
|
|
return this.userInfoList
|
|
|
|
.filter(user => {
|
|
|
|
if (this.roomInfo.roomType === RoomType.Single) {
|
|
|
|
return user.seq !== this.loginRes.userSeq;
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0))
|
|
|
|
.map(user => user.name)
|
|
|
|
.join(',');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-23 05:23:24 +00:00
|
|
|
selectContact() {}
|
2019-10-08 05:34:37 +00:00
|
|
|
|
|
|
|
onSendMessage(message: string) {
|
2019-10-28 09:03:27 +00:00
|
|
|
if (message.trim().length > Maximum_Range.MassText) {
|
|
|
|
// MASS TEXT
|
|
|
|
this.store.dispatch(
|
|
|
|
EventStore.sendMass({
|
|
|
|
senderSeq: this.loginRes.userSeq,
|
|
|
|
req: {
|
|
|
|
roomSeq: this.roomInfo.roomSeq,
|
|
|
|
eventType: EventType.MassText,
|
|
|
|
// sentMessage: message.replace(/\n/gi, '\r\n')
|
|
|
|
sentMessage: message
|
|
|
|
}
|
|
|
|
})
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
this.store.dispatch(
|
|
|
|
EventStore.send({
|
|
|
|
senderSeq: this.loginRes.userSeq,
|
|
|
|
req: {
|
|
|
|
roomSeq: this.roomInfo.roomSeq,
|
|
|
|
eventType: EventType.Character,
|
|
|
|
sentMessage: message
|
|
|
|
}
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
2019-10-08 05:34:37 +00:00
|
|
|
}
|
2019-10-10 06:53:08 +00:00
|
|
|
|
2019-10-11 06:55:27 +00:00
|
|
|
onClickReceiveAlarm() {
|
|
|
|
this.store.dispatch(RoomStore.updateOnlyAlarm({ roomInfo: this.roomInfo }));
|
|
|
|
}
|
|
|
|
|
2019-10-11 09:03:01 +00:00
|
|
|
/** MassText Detail View */
|
|
|
|
onMassDetail(value: number) {
|
|
|
|
this.store.dispatch(
|
|
|
|
ChatStore.selectedMassDetail({
|
|
|
|
massEventSeq: value
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
2019-10-14 04:53:22 +00:00
|
|
|
|
2019-10-29 00:07:06 +00:00
|
|
|
async onImageViewer(value: FileInfo) {
|
2019-10-14 04:53:22 +00:00
|
|
|
this.logger.debug('imageViewer', value);
|
2019-10-29 00:07:06 +00:00
|
|
|
const result = await this.dialogService.open<
|
|
|
|
ImageViewerDialogComponent,
|
|
|
|
ImageViewerDialogData,
|
|
|
|
ImageViewerDialogResult
|
|
|
|
>(ImageViewerDialogComponent, {
|
|
|
|
position: {
|
|
|
|
top: '10px'
|
|
|
|
},
|
|
|
|
width: '100%',
|
|
|
|
height: '98%',
|
|
|
|
data: {}
|
|
|
|
});
|
2019-10-14 04:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** File Save, Save As */
|
|
|
|
onSave(value: { fileInfo: FileInfo; type: string }) {
|
|
|
|
this.logger.debug('fileSave', value);
|
|
|
|
}
|
2019-10-16 07:33:19 +00:00
|
|
|
|
2019-10-21 04:36:58 +00:00
|
|
|
onFileDragEnter() {
|
|
|
|
this.logger.debug('onFileDragEnter');
|
|
|
|
this.fileDragOver = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
onFileDragOver() {
|
|
|
|
this.logger.debug('onFileDragOver');
|
|
|
|
}
|
|
|
|
|
|
|
|
onFileDragLeave() {
|
|
|
|
this.logger.debug('onFileDragLeave');
|
|
|
|
this.fileDragOver = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
onFileSelected(files: File[]) {
|
|
|
|
this.logger.debug('onFileSelected', files);
|
|
|
|
if (!this.files) {
|
|
|
|
this.files = [];
|
|
|
|
}
|
|
|
|
this.files.push(...files);
|
|
|
|
|
|
|
|
this.fileDragOver = false;
|
|
|
|
}
|
|
|
|
|
2019-10-16 07:33:19 +00:00
|
|
|
onContextMenuMessage(params: { event: MouseEvent; message: Info }) {
|
|
|
|
params.event.preventDefault();
|
|
|
|
params.event.stopPropagation();
|
|
|
|
|
|
|
|
this.messageContextMenuPosition.x = params.event.clientX + 'px';
|
|
|
|
this.messageContextMenuPosition.y = params.event.clientY + 'px';
|
|
|
|
this.messageContextMenuTrigger.menu.focusFirstItem('mouse');
|
|
|
|
this.messageContextMenuTrigger.menuData = {
|
|
|
|
message: params.message,
|
|
|
|
loginRes: this.loginRes
|
|
|
|
};
|
|
|
|
this.messageContextMenuTrigger.openMenu();
|
|
|
|
}
|
|
|
|
|
2019-10-16 09:05:18 +00:00
|
|
|
async onClickMessageContextMenu(menuType: string, message: Info) {
|
2019-10-16 07:33:19 +00:00
|
|
|
switch (menuType) {
|
|
|
|
case 'COPY':
|
|
|
|
{
|
2019-10-16 09:05:18 +00:00
|
|
|
switch (message.type) {
|
|
|
|
case EventType.Character:
|
|
|
|
{
|
|
|
|
if (
|
|
|
|
this.clipboardService.copyFromContent(message.sentMessage)
|
|
|
|
) {
|
|
|
|
this.snackBarService.open('클립보드에 복사되었습니다.', '', {
|
|
|
|
duration: 3000,
|
|
|
|
verticalPosition: 'top',
|
|
|
|
horizontalPosition: 'center'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case EventType.MassText:
|
|
|
|
{
|
|
|
|
this.commonApiService
|
|
|
|
.massTalkDownload({
|
|
|
|
userSeq: this.loginRes.userSeq,
|
|
|
|
deviceType: this.environmentsInfo.deviceType,
|
|
|
|
token: this.loginRes.tokenString,
|
|
|
|
eventMassSeq: message.seq
|
|
|
|
})
|
|
|
|
.pipe(take(1))
|
|
|
|
.subscribe(res => {
|
|
|
|
if (this.clipboardService.copyFromContent(res.content)) {
|
|
|
|
this.snackBarService.open(
|
|
|
|
'클립보드에 복사되었습니다.',
|
|
|
|
'',
|
|
|
|
{
|
|
|
|
duration: 3000,
|
|
|
|
verticalPosition: 'top',
|
|
|
|
horizontalPosition: 'center'
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2019-10-16 07:33:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'REPLAY':
|
|
|
|
{
|
2019-10-16 09:05:18 +00:00
|
|
|
const result = await this.dialogService.open<
|
2019-10-24 08:04:58 +00:00
|
|
|
CreateChatDialogComponent,
|
|
|
|
CreateChatDialogData,
|
|
|
|
CreateChatDialogResult
|
|
|
|
>(CreateChatDialogComponent, {
|
|
|
|
width: '600px',
|
|
|
|
height: '500px',
|
2019-10-16 09:05:18 +00:00
|
|
|
data: {
|
2019-10-24 08:04:58 +00:00
|
|
|
type: UserSelectDialogType.MessageForward,
|
|
|
|
title: 'MessageForward',
|
|
|
|
ignoreRoom: [this.roomInfo]
|
2019-10-16 09:05:18 +00:00
|
|
|
}
|
|
|
|
});
|
2019-10-24 08:04:58 +00:00
|
|
|
|
|
|
|
if (!!result && !!result.choice && result.choice) {
|
|
|
|
const userSeqs: number[] = [];
|
|
|
|
let roomSeq = '';
|
|
|
|
if (
|
|
|
|
!!result.selectedUserList &&
|
|
|
|
result.selectedUserList.length > 0
|
|
|
|
) {
|
|
|
|
result.selectedUserList.map(user => userSeqs.push(user.seq));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!!result.selectedRoom) {
|
|
|
|
roomSeq = result.selectedRoom.roomSeq;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (userSeqs.length > 0 || roomSeq.trim().length > 0) {
|
|
|
|
this.store.dispatch(
|
|
|
|
EventStore.forward({
|
|
|
|
senderSeq: this.loginRes.userSeq,
|
|
|
|
req: {
|
|
|
|
roomSeq: '-999',
|
|
|
|
eventType: message.type,
|
|
|
|
sentMessage: message.sentMessage
|
|
|
|
},
|
|
|
|
trgtUserSeqs: userSeqs,
|
|
|
|
trgtRoomSeq: roomSeq
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2019-10-16 07:33:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'REPLAY_TO_ME':
|
|
|
|
{
|
2019-10-25 08:51:33 +00:00
|
|
|
if (this.loginRes.talkWithMeBotSeq > -1) {
|
|
|
|
this.store.dispatch(
|
|
|
|
EventStore.forward({
|
|
|
|
senderSeq: this.loginRes.userSeq,
|
|
|
|
req: {
|
|
|
|
roomSeq: '-999',
|
|
|
|
eventType: message.type,
|
|
|
|
sentMessage: message.sentMessage
|
|
|
|
},
|
|
|
|
trgtUserSeqs: [this.loginRes.talkWithMeBotSeq]
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
2019-10-16 07:33:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'DELETE':
|
|
|
|
{
|
2019-10-17 00:18:55 +00:00
|
|
|
const result = await this.dialogService.open<
|
2019-10-24 01:45:28 +00:00
|
|
|
ConfirmDialogComponent,
|
|
|
|
ConfirmDialogData,
|
|
|
|
ConfirmDialogResult
|
|
|
|
>(ConfirmDialogComponent, {
|
2019-10-17 00:18:55 +00:00
|
|
|
width: '220px',
|
|
|
|
data: {
|
2019-10-24 01:45:28 +00:00
|
|
|
title: 'Delete',
|
|
|
|
html: `선택한 메시지를 삭제하시겠습니까?<br/>삭제된 메시지는 내 대화방에서만 적용되며 상대방의 대화방에서는 삭제되지 않습니다.`
|
2019-10-17 00:18:55 +00:00
|
|
|
}
|
|
|
|
});
|
2019-10-24 01:45:28 +00:00
|
|
|
|
|
|
|
if (!!result && !!result.choice && result.choice) {
|
|
|
|
this.store.dispatch(
|
|
|
|
EventStore.del({
|
|
|
|
roomSeq: this.roomInfo.roomSeq,
|
|
|
|
eventSeq: message.seq
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
2019-10-16 07:33:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'RECALL':
|
|
|
|
{
|
2019-10-17 00:18:55 +00:00
|
|
|
const result = await this.dialogService.open<
|
2019-10-24 01:45:28 +00:00
|
|
|
ConfirmDialogComponent,
|
|
|
|
ConfirmDialogData,
|
|
|
|
ConfirmDialogResult
|
|
|
|
>(ConfirmDialogComponent, {
|
2019-10-17 00:18:55 +00:00
|
|
|
width: '220px',
|
|
|
|
data: {
|
2019-10-24 01:45:28 +00:00
|
|
|
title: 'ReCall',
|
|
|
|
html: `해당 대화를 회수하시겠습니까?<br/>상대방 대화창에서도 회수됩니다.`
|
2019-10-17 00:18:55 +00:00
|
|
|
}
|
|
|
|
});
|
2019-10-24 01:45:28 +00:00
|
|
|
|
|
|
|
if (!!result && !!result.choice && result.choice) {
|
|
|
|
this.store.dispatch(
|
|
|
|
EventStore.cancel({
|
|
|
|
roomSeq: this.roomInfo.roomSeq,
|
|
|
|
eventSeq: message.seq,
|
|
|
|
deviceType: this.environmentsInfo.deviceType
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
2019-10-16 07:33:19 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2019-10-24 07:53:21 +00:00
|
|
|
|
|
|
|
onClickContextMenu(menuType: string) {
|
|
|
|
switch (menuType) {
|
|
|
|
case 'CLOSE_ROOM':
|
|
|
|
{
|
|
|
|
this.store.dispatch(ChatStore.clearSelectedRoom());
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2019-09-23 05:23:24 +00:00
|
|
|
}
|