diff --git a/projects/ucap-webmessenger-ui-room/src/lib/components/list-item.component.ts b/projects/ucap-webmessenger-ui-room/src/lib/components/list-item.component.ts index c98acf73..8f14e451 100644 --- a/projects/ucap-webmessenger-ui-room/src/lib/components/list-item.component.ts +++ b/projects/ucap-webmessenger-ui-room/src/lib/components/list-item.component.ts @@ -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,51 +32,7 @@ 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; - } + this.finalEventMessage = this.roomInfo.finalEventMessage; } }