수정 :: 대화 > 리스트 :: finalEventMessage 의 처리 수정. JSON > text

This commit is contained in:
leejh 2019-10-16 10:22:05 +09:00
parent c437e846fb
commit c7a79425ef

View File

@ -8,11 +8,7 @@ import {
import { NGXLogger } from 'ngx-logger';
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
import { EventType } from '@ucap-webmessenger/protocol-event';
import {
FileInfo,
StickerInfo,
MassTextInfo
} from '@ucap-webmessenger/ui-chat';
import { FileInfo, StickerInfo } from '@ucap-webmessenger/ui-chat';
import { FileType } from '@ucap-webmessenger/protocol-file';
@Component({
@ -36,52 +32,8 @@ export class ListItemComponent implements OnInit {
if (this.roomInfo.isTimeRoom) {
this.finalEventMessage = '비밀 대화방입니다.';
} else {
try {
switch (this.roomInfo.finalEventType) {
case EventType.File:
{
let msg = 'Attach File';
const contentJson: FileInfo = JSON.parse(
this.roomInfo.finalEventMessage
);
if (contentJson.FileType === FileType.File) {
msg = '첨부파일';
} else if (contentJson.FileType === FileType.Image) {
msg = '이미지';
} else if (contentJson.FileType === FileType.Video) {
msg = '동영상';
}
this.finalEventMessage = msg;
}
break;
case EventType.Sticker:
{
let msg = '스티커';
const contentJson: StickerInfo = JSON.parse(
this.roomInfo.finalEventMessage
);
if (contentJson.chat) {
msg += ' ' + contentJson.chat;
}
this.finalEventMessage = msg;
}
break;
case EventType.MassText:
{
const contentJson: MassTextInfo = JSON.parse(
this.roomInfo.finalEventMessage
);
this.finalEventMessage = contentJson.Content;
}
break;
default:
this.finalEventMessage = this.roomInfo.finalEventMessage;
}
} catch (e) {
this.logger.error(e);
this.finalEventMessage = this.roomInfo.finalEventMessage;
}
}
}
getRoomName(roomInfo: RoomInfo): string {