2019-10-18 00:48:38 +00:00
|
|
|
import { UserSelectDialogType } from './../../../types/userselect.dialog.type';
|
2019-11-15 04:20:01 +00:00
|
|
|
import {
|
|
|
|
Component,
|
|
|
|
OnInit,
|
|
|
|
Output,
|
|
|
|
EventEmitter,
|
|
|
|
ViewChildren,
|
|
|
|
QueryList,
|
2019-11-21 01:29:19 +00:00
|
|
|
ElementRef,
|
2019-12-12 06:11:49 +00:00
|
|
|
OnDestroy,
|
|
|
|
ViewChild
|
2019-11-15 04:20:01 +00:00
|
|
|
} from '@angular/core';
|
2019-10-16 08:46:53 +00:00
|
|
|
import { NGXLogger } from 'ngx-logger';
|
|
|
|
import { ucapAnimations, DialogService } from '@ucap-webmessenger/ui';
|
|
|
|
import {
|
|
|
|
CreateChatDialogComponent,
|
|
|
|
CreateChatDialogData,
|
|
|
|
CreateChatDialogResult
|
2019-10-17 00:18:55 +00:00
|
|
|
} from '@app/layouts/messenger/dialogs/chat/create-chat.dialog.component';
|
2019-11-29 09:32:30 +00:00
|
|
|
import { Subscription, of } from 'rxjs';
|
2019-10-17 06:06:38 +00:00
|
|
|
import { Store, select } from '@ngrx/store';
|
|
|
|
|
|
|
|
import * as AppStore from '@app/store';
|
2019-10-17 09:05:44 +00:00
|
|
|
import * as ChatStore from '@app/store/messenger/chat';
|
2019-11-04 08:52:47 +00:00
|
|
|
import * as SyncStore from '@app/store/messenger/sync';
|
2019-10-22 08:49:18 +00:00
|
|
|
import { UserInfo } from '@ucap-webmessenger/protocol-sync';
|
|
|
|
import {
|
|
|
|
UserInfoSS,
|
|
|
|
UserInfoF,
|
|
|
|
UserInfoDN
|
|
|
|
} from '@ucap-webmessenger/protocol-query';
|
2019-11-29 09:32:30 +00:00
|
|
|
import { MatTabChangeEvent } from '@angular/material';
|
2019-11-25 00:56:59 +00:00
|
|
|
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
|
|
|
|
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
|
|
|
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
|
2019-12-12 06:11:49 +00:00
|
|
|
import { MessageApiService, MessageType } from '@ucap-webmessenger/api-message';
|
2019-11-26 08:54:37 +00:00
|
|
|
import { DeviceType } from '@ucap-webmessenger/core';
|
|
|
|
import { UnreadCountRequest } from 'projects/ucap-webmessenger-api-message/src/lib/apis/unread-count';
|
2019-11-29 09:32:30 +00:00
|
|
|
import { map, catchError, tap } from 'rxjs/operators';
|
2019-11-26 08:54:37 +00:00
|
|
|
import { MessageStatusCode } from '@ucap-webmessenger/api';
|
2019-12-02 06:31:32 +00:00
|
|
|
import {
|
2019-12-03 09:59:11 +00:00
|
|
|
MessageWriteDialogComponent,
|
|
|
|
MessageWriteDialogResult,
|
|
|
|
MessageWriteDialogData
|
|
|
|
} from '../dialogs/message/message-write.dialog.component';
|
2019-12-13 05:38:42 +00:00
|
|
|
import {
|
|
|
|
EnvironmentsInfo,
|
|
|
|
KEY_ENVIRONMENTS_INFO,
|
|
|
|
KEY_VER_INFO,
|
|
|
|
KEY_LOGIN_RES_INFO
|
|
|
|
} from '@app/types';
|
2019-12-12 06:11:49 +00:00
|
|
|
import { MessageBoxComponent } from './left-sidenav/message.component';
|
2019-12-19 06:29:18 +00:00
|
|
|
import { environment } from '../../../../environments/environment';
|
2019-11-04 08:52:47 +00:00
|
|
|
|
|
|
|
export enum MainMenu {
|
|
|
|
Group = 'GROUP',
|
|
|
|
Chat = 'CAHT',
|
|
|
|
Organization = 'ORGANIZATION',
|
2019-11-22 08:25:51 +00:00
|
|
|
Message = 'MESSAGE',
|
2019-11-04 08:52:47 +00:00
|
|
|
Call = 'CALL',
|
|
|
|
Conversation = 'CONVERSATION'
|
|
|
|
}
|
2019-09-23 05:23:24 +00:00
|
|
|
|
|
|
|
@Component({
|
2019-09-26 02:11:22 +00:00
|
|
|
selector: 'app-layout-messenger-left-side',
|
|
|
|
templateUrl: './left-side.component.html',
|
|
|
|
styleUrls: ['./left-side.component.scss'],
|
2019-09-23 05:23:24 +00:00
|
|
|
animations: ucapAnimations
|
|
|
|
})
|
2019-11-21 01:29:19 +00:00
|
|
|
export class LeftSideComponent implements OnInit, OnDestroy {
|
2019-11-08 04:35:39 +00:00
|
|
|
@Output()
|
|
|
|
openProfile = new EventEmitter<
|
|
|
|
UserInfo | UserInfoSS | UserInfoF | UserInfoDN
|
|
|
|
>();
|
2019-12-16 08:42:49 +00:00
|
|
|
@Output()
|
|
|
|
sendCall = new EventEmitter<string>();
|
2019-12-18 00:56:00 +00:00
|
|
|
@Output()
|
|
|
|
sendSms = new EventEmitter<string>();
|
2019-11-08 04:35:39 +00:00
|
|
|
|
2019-11-15 04:20:01 +00:00
|
|
|
@ViewChildren('tabs') tabs: QueryList<ElementRef<HTMLDivElement>>;
|
2019-11-22 07:15:11 +00:00
|
|
|
currentTabLable: string;
|
2019-11-15 04:20:01 +00:00
|
|
|
|
2019-12-12 06:11:49 +00:00
|
|
|
@ViewChild('messageBoxComponent', { static: false })
|
|
|
|
messageBoxComponent: MessageBoxComponent;
|
|
|
|
|
2019-11-21 01:29:19 +00:00
|
|
|
badgeChatUnReadCount: number;
|
|
|
|
badgeChatUnReadCountSubscription: Subscription;
|
2019-11-26 08:54:37 +00:00
|
|
|
badgeMessageUnReadCount: number;
|
|
|
|
badgeMessageUnReadCountSubscription: Subscription;
|
|
|
|
badgeMessageInterval: any;
|
2019-10-17 06:06:38 +00:00
|
|
|
|
2019-10-22 08:49:18 +00:00
|
|
|
/** 조직도에서 부서원 선택 */
|
|
|
|
selectedUserList: (UserInfo | UserInfoSS | UserInfoF | UserInfoDN)[] = [];
|
|
|
|
|
2019-10-30 09:18:35 +00:00
|
|
|
/** FAB */
|
2019-11-04 08:52:47 +00:00
|
|
|
fabButtonShow = true;
|
2019-10-31 01:26:47 +00:00
|
|
|
fabButtons: { icon: string; tooltip?: string; divisionType?: string }[];
|
2019-10-30 09:18:35 +00:00
|
|
|
|
2019-11-04 08:52:47 +00:00
|
|
|
MainMenu = MainMenu;
|
|
|
|
|
2019-11-25 00:56:59 +00:00
|
|
|
sessionVerinfo: VersionInfo2Response;
|
2019-12-04 08:58:59 +00:00
|
|
|
environmentsInfo: EnvironmentsInfo;
|
2019-11-25 00:56:59 +00:00
|
|
|
loginRes: LoginResponse;
|
2019-11-29 09:32:30 +00:00
|
|
|
loginResSubscription: Subscription;
|
2019-11-25 00:56:59 +00:00
|
|
|
|
2019-10-16 08:46:53 +00:00
|
|
|
constructor(
|
2019-10-17 06:06:38 +00:00
|
|
|
private store: Store<any>,
|
2019-10-16 08:46:53 +00:00
|
|
|
private dialogService: DialogService,
|
2019-11-25 00:56:59 +00:00
|
|
|
private sessionStorageService: SessionStorageService,
|
2019-11-26 08:54:37 +00:00
|
|
|
private messageApiService: MessageApiService,
|
2019-10-16 08:46:53 +00:00
|
|
|
private logger: NGXLogger
|
2019-11-25 00:56:59 +00:00
|
|
|
) {
|
|
|
|
this.sessionVerinfo = this.sessionStorageService.get<VersionInfo2Response>(
|
|
|
|
KEY_VER_INFO
|
|
|
|
);
|
2019-12-04 08:58:59 +00:00
|
|
|
|
|
|
|
this.environmentsInfo = this.sessionStorageService.get<EnvironmentsInfo>(
|
|
|
|
KEY_ENVIRONMENTS_INFO
|
|
|
|
);
|
2019-11-25 00:56:59 +00:00
|
|
|
}
|
2019-09-23 05:23:24 +00:00
|
|
|
|
2019-10-17 06:06:38 +00:00
|
|
|
ngOnInit() {
|
2019-11-21 01:29:19 +00:00
|
|
|
this.badgeChatUnReadCountSubscription = this.store
|
|
|
|
.pipe(
|
|
|
|
select(AppStore.MessengerSelector.SyncSelector.selectChatUnreadCount)
|
|
|
|
)
|
|
|
|
.subscribe(count => {
|
|
|
|
this.badgeChatUnReadCount = count;
|
|
|
|
});
|
2019-11-04 08:52:47 +00:00
|
|
|
|
2019-11-29 09:32:30 +00:00
|
|
|
this.loginResSubscription = this.store
|
|
|
|
.pipe(
|
|
|
|
select(AppStore.AccountSelector.AuthenticationSelector.loginRes),
|
|
|
|
tap(loginRes => {
|
|
|
|
this.loginRes = loginRes;
|
|
|
|
})
|
|
|
|
)
|
|
|
|
.subscribe();
|
|
|
|
|
2019-11-26 08:54:37 +00:00
|
|
|
this.getMessageUnreadCount();
|
|
|
|
this.badgeMessageInterval = setInterval(
|
|
|
|
() => this.getMessageUnreadCount(),
|
|
|
|
5 * 60 * 1000
|
|
|
|
);
|
|
|
|
|
2019-11-04 08:52:47 +00:00
|
|
|
this.setFabInitial(MainMenu.Group);
|
2019-11-22 07:15:11 +00:00
|
|
|
this.currentTabLable = MainMenu.Group;
|
2019-10-17 06:06:38 +00:00
|
|
|
}
|
2019-10-16 08:46:53 +00:00
|
|
|
|
2019-11-21 01:29:19 +00:00
|
|
|
ngOnDestroy(): void {
|
|
|
|
if (!!this.badgeChatUnReadCountSubscription) {
|
|
|
|
this.badgeChatUnReadCountSubscription.unsubscribe();
|
|
|
|
}
|
2019-11-26 08:54:37 +00:00
|
|
|
if (!!this.badgeMessageUnReadCountSubscription) {
|
|
|
|
this.badgeMessageUnReadCountSubscription.unsubscribe();
|
|
|
|
}
|
2019-11-29 09:32:30 +00:00
|
|
|
if (!!this.loginResSubscription) {
|
|
|
|
this.loginResSubscription.unsubscribe();
|
|
|
|
}
|
2019-11-26 08:54:37 +00:00
|
|
|
|
|
|
|
if (!!this.badgeMessageInterval) {
|
|
|
|
clearInterval(this.badgeMessageInterval);
|
|
|
|
}
|
2019-11-21 01:29:19 +00:00
|
|
|
|
|
|
|
this.logger.debug('-----------------------LeftSideComponent ngOnDestroy');
|
|
|
|
}
|
|
|
|
|
2019-10-31 06:05:59 +00:00
|
|
|
async onClickNewChat(type: string = 'NORMAL') {
|
2019-10-16 08:46:53 +00:00
|
|
|
const result = await this.dialogService.open<
|
|
|
|
CreateChatDialogComponent,
|
|
|
|
CreateChatDialogData,
|
|
|
|
CreateChatDialogResult
|
|
|
|
>(CreateChatDialogComponent, {
|
2019-10-18 00:48:38 +00:00
|
|
|
width: '600px',
|
2019-10-16 08:46:53 +00:00
|
|
|
data: {
|
2019-10-18 00:48:38 +00:00
|
|
|
type: UserSelectDialogType.NewChat,
|
2019-10-31 06:05:59 +00:00
|
|
|
title: type === 'TIMER' ? 'New Timer Chat' : 'New Chat'
|
2019-10-16 08:46:53 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2019-10-17 09:05:44 +00:00
|
|
|
if (!!result && !!result.choice && result.choice) {
|
|
|
|
if (!!result.selectedUserList && result.selectedUserList.length > 0) {
|
|
|
|
const userSeqs: number[] = [];
|
|
|
|
result.selectedUserList.map(user => userSeqs.push(user.seq));
|
2019-10-16 08:46:53 +00:00
|
|
|
|
2019-10-31 06:05:59 +00:00
|
|
|
if (type === 'NORMAL') {
|
|
|
|
this.store.dispatch(ChatStore.openRoom({ userSeqList: userSeqs }));
|
|
|
|
} else if (type === 'TIMER') {
|
|
|
|
this.store.dispatch(
|
|
|
|
ChatStore.openRoom({ userSeqList: userSeqs, isTimeRoom: true })
|
|
|
|
);
|
|
|
|
}
|
2019-10-17 09:05:44 +00:00
|
|
|
}
|
|
|
|
}
|
2019-10-16 08:46:53 +00:00
|
|
|
}
|
2019-10-22 08:49:18 +00:00
|
|
|
|
2019-11-04 08:52:47 +00:00
|
|
|
async onClickNewGroupAndMember() {
|
|
|
|
const result = await this.dialogService.open<
|
|
|
|
CreateChatDialogComponent,
|
|
|
|
CreateChatDialogData,
|
|
|
|
CreateChatDialogResult
|
|
|
|
>(CreateChatDialogComponent, {
|
|
|
|
width: '600px',
|
|
|
|
data: {
|
|
|
|
type: UserSelectDialogType.NewGroup,
|
|
|
|
title: 'New Group'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
if (!!result && !!result.choice && result.choice) {
|
|
|
|
if (
|
|
|
|
!!result.selectedUserList &&
|
2019-11-21 07:14:51 +00:00
|
|
|
// result.selectedUserList.length > 0 &&
|
2019-11-04 08:52:47 +00:00
|
|
|
result.groupName.trim().length > 0
|
|
|
|
) {
|
|
|
|
const userSeqs: number[] = [];
|
|
|
|
result.selectedUserList.map(user => userSeqs.push(user.seq));
|
|
|
|
|
|
|
|
this.store.dispatch(
|
|
|
|
SyncStore.createGroupAndBuddy({
|
|
|
|
groupName: result.groupName,
|
|
|
|
trgtUserSeq: userSeqs
|
|
|
|
})
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-02 06:31:32 +00:00
|
|
|
async onClickNewMessage() {
|
|
|
|
const result = await this.dialogService.open<
|
2019-12-03 09:59:11 +00:00
|
|
|
MessageWriteDialogComponent,
|
|
|
|
MessageWriteDialogData,
|
|
|
|
MessageWriteDialogResult
|
|
|
|
>(MessageWriteDialogComponent, {
|
2019-12-02 06:31:32 +00:00
|
|
|
width: '600px',
|
2019-12-03 09:59:11 +00:00
|
|
|
height: '600px',
|
2019-12-06 08:53:19 +00:00
|
|
|
disableClose: true,
|
|
|
|
hasBackdrop: false,
|
2019-12-02 06:31:32 +00:00
|
|
|
data: {
|
2019-12-04 08:58:59 +00:00
|
|
|
loginRes: this.loginRes,
|
|
|
|
environmentsInfo: this.environmentsInfo
|
2019-12-02 06:31:32 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2019-12-12 06:11:49 +00:00
|
|
|
if (!!result && !!result.sendFlag && result.sendFlag) {
|
|
|
|
if (
|
|
|
|
this.currentTabLable === MainMenu.Message &&
|
|
|
|
!!this.messageBoxComponent
|
|
|
|
) {
|
|
|
|
const type = result.sendType || MessageType.Send;
|
|
|
|
switch (type) {
|
|
|
|
case MessageType.Send:
|
|
|
|
this.messageBoxComponent.onSelectedIndexChange(1);
|
|
|
|
this.messageBoxComponent.onSelectedIndexTab(1);
|
|
|
|
break;
|
|
|
|
case MessageType.Reservation:
|
|
|
|
this.messageBoxComponent.onSelectedIndexChange(2);
|
|
|
|
this.messageBoxComponent.onSelectedIndexTab(2);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-12-02 06:31:32 +00:00
|
|
|
}
|
|
|
|
|
2019-11-08 04:35:39 +00:00
|
|
|
onClickOpenProfile(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
|
|
|
|
this.openProfile.emit(userInfo);
|
|
|
|
}
|
2019-12-16 08:42:49 +00:00
|
|
|
onClickSendClickToCall(calleeNumber: string) {
|
|
|
|
this.sendCall.emit(calleeNumber);
|
|
|
|
}
|
2019-12-18 00:56:00 +00:00
|
|
|
onClickSendSms(calleeNumber: string) {
|
|
|
|
this.sendSms.emit(calleeNumber);
|
|
|
|
}
|
2019-11-08 04:35:39 +00:00
|
|
|
|
2019-11-04 08:52:47 +00:00
|
|
|
onSelectedTabChange(event: MatTabChangeEvent) {
|
|
|
|
this.setFabInitial(event.tab.ariaLabel);
|
2019-11-22 07:15:11 +00:00
|
|
|
this.currentTabLable = event.tab.ariaLabel;
|
2019-11-15 04:20:01 +00:00
|
|
|
|
|
|
|
this.tabs.forEach(tab => {
|
|
|
|
if (`tabs-${event.index}` === tab.nativeElement.id) {
|
|
|
|
tab.nativeElement.style.display = 'block';
|
|
|
|
} else {
|
|
|
|
tab.nativeElement.style.display = 'none';
|
|
|
|
}
|
|
|
|
});
|
2019-11-04 08:52:47 +00:00
|
|
|
}
|
|
|
|
setFabInitial(type: string) {
|
|
|
|
switch (type) {
|
|
|
|
case MainMenu.Group:
|
|
|
|
{
|
|
|
|
this.fabButtonShow = true;
|
|
|
|
this.fabButtons = [
|
|
|
|
{
|
|
|
|
icon: 'add',
|
|
|
|
tooltip: 'New Group Add',
|
|
|
|
divisionType: 'GROUP_NEW_ADD'
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MainMenu.Chat:
|
|
|
|
{
|
|
|
|
this.fabButtonShow = true;
|
|
|
|
this.fabButtons = [
|
|
|
|
{
|
|
|
|
icon: 'chat',
|
|
|
|
tooltip: 'New Chat',
|
|
|
|
divisionType: 'CAHT_NEW_ADD'
|
|
|
|
}
|
|
|
|
];
|
2019-12-19 06:29:18 +00:00
|
|
|
|
|
|
|
if (environment.productConfig.CommonSetting.useTimerRoom) {
|
|
|
|
this.fabButtons.push({
|
|
|
|
icon: 'timer',
|
|
|
|
tooltip: 'New Timer Chat',
|
|
|
|
divisionType: 'CHAT_NEW_TIMER_ADD'
|
|
|
|
});
|
|
|
|
}
|
2019-11-04 08:52:47 +00:00
|
|
|
}
|
|
|
|
break;
|
2019-12-02 06:31:32 +00:00
|
|
|
case MainMenu.Organization:
|
|
|
|
{
|
|
|
|
this.fabButtonShow = false;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MainMenu.Message:
|
|
|
|
{
|
|
|
|
this.fabButtonShow = true;
|
|
|
|
this.fabButtons = [
|
|
|
|
{
|
|
|
|
icon: 'add',
|
|
|
|
tooltip: 'New Message',
|
|
|
|
divisionType: 'MESSAGE_NEW'
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MainMenu.Call:
|
|
|
|
{
|
|
|
|
this.fabButtonShow = false;
|
|
|
|
}
|
|
|
|
break;
|
2019-11-04 08:52:47 +00:00
|
|
|
|
|
|
|
default: {
|
|
|
|
this.fabButtonShow = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-29 08:07:45 +00:00
|
|
|
onCheckAllUser(params: {
|
|
|
|
isChecked: boolean;
|
|
|
|
userInfos: (UserInfo | UserInfoSS | UserInfoF | UserInfoDN)[];
|
|
|
|
}) {
|
|
|
|
params.userInfos.forEach(userInfo => {
|
|
|
|
if (params.isChecked) {
|
|
|
|
if (
|
|
|
|
this.selectedUserList.filter(user => user.seq === userInfo.seq)
|
|
|
|
.length === 0
|
|
|
|
) {
|
|
|
|
this.selectedUserList = [...this.selectedUserList, userInfo];
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.selectedUserList = this.selectedUserList.filter(
|
|
|
|
user => user.seq !== userInfo.seq
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-10-22 08:49:18 +00:00
|
|
|
/** 조직도>부서원 :: 리스트의 checkbox 의 이벤트를 받아 선택된 유저리스트를 수집. */
|
|
|
|
onCheckUser(params: {
|
|
|
|
isChecked: boolean;
|
|
|
|
userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN;
|
|
|
|
}) {
|
|
|
|
if (params.isChecked) {
|
|
|
|
if (
|
2019-10-29 08:07:45 +00:00
|
|
|
params.userInfo &&
|
2019-10-22 08:49:18 +00:00
|
|
|
this.selectedUserList.filter(user => user.seq === params.userInfo.seq)
|
2019-10-29 08:07:45 +00:00
|
|
|
.length === 0
|
2019-10-22 08:49:18 +00:00
|
|
|
) {
|
|
|
|
this.selectedUserList = [...this.selectedUserList, params.userInfo];
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.selectedUserList = this.selectedUserList.filter(
|
2019-10-29 08:07:45 +00:00
|
|
|
user => user.seq !== params.userInfo.seq
|
2019-10-22 08:49:18 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2019-11-19 04:14:38 +00:00
|
|
|
onToggleUser(userInfo: UserInfo | UserInfoSS | UserInfoF | UserInfoDN) {
|
|
|
|
if (
|
|
|
|
this.selectedUserList.filter(user => user.seq === userInfo.seq).length ===
|
|
|
|
0
|
|
|
|
) {
|
|
|
|
this.selectedUserList = [...this.selectedUserList, userInfo];
|
|
|
|
} else {
|
|
|
|
this.selectedUserList = this.selectedUserList.filter(
|
|
|
|
item => item.seq !== userInfo.seq
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2019-10-30 09:18:35 +00:00
|
|
|
|
|
|
|
/** FAB */
|
2019-10-31 01:26:47 +00:00
|
|
|
onClickFab(params: { btn: any }) {
|
|
|
|
const btn = params.btn as {
|
|
|
|
icon: string;
|
|
|
|
tooltip?: string;
|
|
|
|
divisionType?: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
switch (btn.divisionType) {
|
2019-11-04 08:52:47 +00:00
|
|
|
case 'GROUP_NEW_ADD':
|
|
|
|
{
|
|
|
|
this.onClickNewGroupAndMember();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'CAHT_NEW_ADD':
|
2019-10-31 01:26:47 +00:00
|
|
|
{
|
2019-10-31 06:05:59 +00:00
|
|
|
this.onClickNewChat('NORMAL');
|
2019-10-31 01:26:47 +00:00
|
|
|
}
|
|
|
|
break;
|
2019-11-04 08:52:47 +00:00
|
|
|
case 'CHAT_NEW_TIMER_ADD':
|
2019-10-31 01:26:47 +00:00
|
|
|
{
|
2019-12-19 06:29:18 +00:00
|
|
|
if (environment.productConfig.CommonSetting.useTimerRoom) {
|
|
|
|
this.onClickNewChat('TIMER');
|
|
|
|
}
|
2019-10-31 01:26:47 +00:00
|
|
|
}
|
|
|
|
break;
|
2019-12-02 06:31:32 +00:00
|
|
|
|
|
|
|
case 'MESSAGE_NEW':
|
|
|
|
{
|
|
|
|
this.onClickNewMessage();
|
|
|
|
}
|
|
|
|
break;
|
2019-10-31 01:26:47 +00:00
|
|
|
}
|
2019-10-30 09:18:35 +00:00
|
|
|
}
|
2019-11-26 08:54:37 +00:00
|
|
|
|
|
|
|
getMessageUnreadCount(): void {
|
|
|
|
this.badgeMessageUnReadCountSubscription = this.messageApiService
|
|
|
|
.retrieveUnreadCount({
|
|
|
|
userSeq: this.loginRes.userSeq,
|
|
|
|
deviceType: DeviceType.PC,
|
|
|
|
tokenKey: this.loginRes.tokenString
|
|
|
|
} as UnreadCountRequest)
|
|
|
|
.pipe(
|
|
|
|
map(res => {
|
|
|
|
if (res.responseCode === MessageStatusCode.Success) {
|
|
|
|
this.badgeMessageUnReadCount = res.unreadCount;
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
catchError(error => of(this.logger.error(error)))
|
|
|
|
)
|
|
|
|
.subscribe();
|
|
|
|
}
|
2019-12-16 00:58:01 +00:00
|
|
|
|
|
|
|
getMyProfileImageWidget(): string {
|
|
|
|
if (!!this.loginRes) {
|
|
|
|
return this.loginRes.userInfo.profileImageFile;
|
|
|
|
} else {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
}
|
2019-09-23 05:23:24 +00:00
|
|
|
}
|