대화방 > 그룹멤버로추가 :: 기능구현

This commit is contained in:
leejinho 2019-11-11 10:53:24 +09:00
parent 3fc5fa254a
commit b43d7dd5ff
2 changed files with 40 additions and 0 deletions

View File

@ -81,6 +81,9 @@
<button mat-menu-item (click)="onClickContextMenu('ADD_MEMBER')">
대화상대추가
</button>
<button mat-menu-item (click)="onClickContextMenu('ADD_GROUP')">
그룹멤버로추가
</button>
<button mat-menu-item (click)="onClickContextMenu('EDIT_ROOM')">
대화방설정
</button>

View File

@ -40,6 +40,7 @@ import * as AppStore from '@app/store';
import * as EventStore from '@app/store/messenger/event';
import * as ChatStore from '@app/store/messenger/chat';
import * as RoomStore from '@app/store/messenger/room';
import * as SyncStore from '@app/store/messenger/sync';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
import {
@ -84,6 +85,8 @@ import {
EditChatRoomDialogResult,
EditChatRoomDialogData
} from '../dialogs/chat/edit-chat-room.dialog.component';
import { SelectGroupDialogComponent, SelectGroupDialogResult, SelectGroupDialogData } from '../dialogs/group/select-group.dialog.component';
import { GroupDetailData } from '@ucap-webmessenger/protocol-sync';
@Component({
selector: 'app-layout-messenger-messages',
@ -838,6 +841,40 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
}
}
break;
case 'ADD_GROUP':
{
const result = await this.dialogService.open<
SelectGroupDialogComponent,
SelectGroupDialogData,
SelectGroupDialogResult
>(SelectGroupDialogComponent, {
width: '600px',
data: {
title: 'Group Select'
}
});
if (!!result && !!result.choice && result.choice) {
if (!!result.group) {
const oldGroup: GroupDetailData = result.group;
const trgtUserSeq: number[] = [];
result.group.userSeqs.map(seq => trgtUserSeq.push(seq));
this.userInfoList
.filter(v => result.group.userSeqs.indexOf(v.seq) < 0)
.forEach(user => {
trgtUserSeq.push(user.seq);
});
this.store.dispatch(
SyncStore.updateGroupMember({
oldGroup,
trgtUserSeq
})
);
}
}
}
break;
case 'EDIT_ROOM':
{
const result = await this.dialogService.open<