diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts index 5b231591..38d7ce31 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts @@ -167,7 +167,9 @@ export const reducer = createReducer( } else { const roomInfo = { ...state.room.entities[action.roomSeq], + finalEventType: action.info.type, finalEventDate: action.info.sendDate, + finalEventSeq: action.info.seq, finalEventMessage }; diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/en.json b/projects/ucap-webmessenger-app/src/assets/i18n/en.json index 5010441f..cd41ab2a 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/en.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/en.json @@ -235,6 +235,7 @@ "ejectedFromRoomWith": "{{requester}} has eject {{ejected}}.", "renamedRoomWith": "{{requester}} has changed their chat room name to '{{roomName}}'.", "setTimerWith": "{{requester}} set a timer ({{timer}})", + "iosCapture": "{{requester}} captured a conversation", "showMassTranslationOfOriginal": "Show original", "showMassTranslationOfTranslated": "Show translated", "showMassDetail": "Show detail", diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json index b590fbca..f7cd0a56 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json @@ -235,6 +235,7 @@ "ejectedFromRoomWith": "{{requester}}님이 {{ejected}}님을 퇴장 시키셨습니다.", "renamedRoomWith": "{{requester}}님이 대화방명을 '{{roomName}}'으로 변경하셨습니다.", "setTimerWith": "{{requester}}님이 타이머를 설정하였습니다. ({{timer}})", + "iosCapture": "{{requester}}님이 대화내용을 캡쳐하였습니다.", "showMassTranslationOfOriginal": "원본 보기", "showMassTranslationOfTranslated": "번역 보기", "showMassDetail": "전체 보기", diff --git a/projects/ucap-webmessenger-protocol-event/src/lib/protocols/event-json/codec.ts b/projects/ucap-webmessenger-protocol-event/src/lib/protocols/event-json/codec.ts index 5e6bd7e0..a129fadc 100644 --- a/projects/ucap-webmessenger-protocol-event/src/lib/protocols/event-json/codec.ts +++ b/projects/ucap-webmessenger-protocol-event/src/lib/protocols/event-json/codec.ts @@ -47,6 +47,10 @@ import { decodeNotificationForTimerRoomEventJson } from './notification-for-timer-room.event-json'; import { decodeAllimEventJson, AllimEventJson } from './allim.event-json'; +import { + NotificationForIOSCaptureEventJson, + decodeNotificationForIOSCaptureEventJson +} from './notification-for-ios-capture.event-json'; export type EventJson = | string @@ -62,6 +66,7 @@ export type EventJson = | PlanEventJson | VideoConferenceEventJson | RenameRoomEventJson + | NotificationForIOSCaptureEventJson | NotificationForTimerRoomEventJson | TranslationEventJson | MassTranslationEventJson @@ -103,7 +108,7 @@ export const decodeEventJson = ( case EventType.GuideForRoomTimerChanged: return decodeGuideForRoomTimerChangedEventJson(message); case EventType.NotificationForiOSCapture: - return message; + return decodeNotificationForIOSCaptureEventJson(message); case EventType.NotificationForTimerRoom: return decodeNotificationForTimerRoomEventJson(message); case EventType.Before2MonthsAgo: diff --git a/projects/ucap-webmessenger-protocol-event/src/lib/protocols/event-json/notification-for-ios-capture.event-json.ts b/projects/ucap-webmessenger-protocol-event/src/lib/protocols/event-json/notification-for-ios-capture.event-json.ts new file mode 100644 index 00000000..84032118 --- /dev/null +++ b/projects/ucap-webmessenger-protocol-event/src/lib/protocols/event-json/notification-for-ios-capture.event-json.ts @@ -0,0 +1,9 @@ +import { EventJsonDecoder } from './event-json'; + +export type NotificationForIOSCaptureEventJson = string; + +export const decodeNotificationForIOSCaptureEventJson: EventJsonDecoder = ( + message: string +) => { + return message as NotificationForIOSCaptureEventJson; +}; diff --git a/projects/ucap-webmessenger-protocol-event/src/lib/protocols/event-json/notification-for-timer-room.event-json.ts b/projects/ucap-webmessenger-protocol-event/src/lib/protocols/event-json/notification-for-timer-room.event-json.ts index 928fb3a8..ef080997 100644 --- a/projects/ucap-webmessenger-protocol-event/src/lib/protocols/event-json/notification-for-timer-room.event-json.ts +++ b/projects/ucap-webmessenger-protocol-event/src/lib/protocols/event-json/notification-for-timer-room.event-json.ts @@ -2,8 +2,8 @@ import { EventJsonDecoder } from './event-json'; export type NotificationForTimerRoomEventJson = string; -export const decodeNotificationForTimerRoomEventJson: EventJsonDecoder< - NotificationForTimerRoomEventJson -> = (message: string) => { +export const decodeNotificationForTimerRoomEventJson: EventJsonDecoder = ( + message: string +) => { return message as NotificationForTimerRoomEventJson; }; diff --git a/projects/ucap-webmessenger-protocol-event/src/public-api.ts b/projects/ucap-webmessenger-protocol-event/src/public-api.ts index c6c8eb44..22a3039f 100644 --- a/projects/ucap-webmessenger-protocol-event/src/public-api.ts +++ b/projects/ucap-webmessenger-protocol-event/src/public-api.ts @@ -22,6 +22,7 @@ export * from './lib/protocols/event-json/join.event-json'; export * from './lib/protocols/event-json/link.event-json'; export * from './lib/protocols/event-json/mass-text.event-json'; export * from './lib/protocols/event-json/mass-translation.event-json'; +export * from './lib/protocols/event-json/notification-for-ios-capture.event-json'; export * from './lib/protocols/event-json/notification-for-timer-room.event-json'; export * from './lib/protocols/event-json/plan.event-json'; export * from './lib/protocols/event-json/recalled-message.event-json'; diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box.component.html b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box.component.html index 68b7a62a..fc61065c 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box.component.html +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box.component.html @@ -61,6 +61,13 @@ class="information-msg" > + + diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box.component.ts index 789b7d32..03232b9a 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box.component.ts @@ -133,6 +133,7 @@ export class MessageBoxComponent implements OnInit, AfterViewInit { info.type === EventType.Exit || info.type === EventType.ForcedExit || info.type === EventType.RenameRoom || + info.type === EventType.NotificationForiOSCapture || info.type === EventType.NotificationForTimerRoom || info.type === EventType.GuideForRoomTimerChanged ) { diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/information.component.html b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/information.component.html index 0fa9cd4f..0f0b1c0c 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/information.component.html +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/information.component.html @@ -49,5 +49,14 @@ } }} + + {{ + 'chat.event.iosCapture' + | translate + : { + requester: message.sentMessage + } + }} + diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/information.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/information.component.ts index bd0e3e4c..931e85ce 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/information.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box/information.component.ts @@ -1,14 +1,6 @@ import { Component, OnInit, Input } from '@angular/core'; import { NGXLogger } from 'ngx-logger'; -import { - Info, - EventType, - EventJson, - JoinEventJson, - RenameRoomEventJson, - NotificationForTimerRoomEventJson, - GuideForRoomTimerChangedEventJson -} from '@ucap-webmessenger/protocol-event'; +import { Info, EventType, EventJson } from '@ucap-webmessenger/protocol-event'; import { TranslateService } from '@ngx-translate/core'; @Component({ 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 de72d7b2..3b4a72a4 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 @@ -17,8 +17,12 @@ import { NGXLogger } from 'ngx-logger'; import { VersionInfo2Response } from '@ucap-webmessenger/api-public'; import { LoginResponse } from '@ucap-webmessenger/protocol-authentication'; import { TranslatePipe } from 'projects/ucap-webmessenger-ui/src/lib/pipes/translate.pipe'; -import { TranslateService as uiTranslateService } from '@ucap-webmessenger/ui'; +import { + TranslateService as uiTranslateService, + StringUtil +} from '@ucap-webmessenger/ui'; import { TranslateService } from '@ngx-translate/core'; +import { EventType } from '@ucap-webmessenger/protocol-event'; @Component({ selector: 'ucap-room-list-item', @@ -62,6 +66,15 @@ export class ListItemComponent implements OnInit { ngOnInit() { if (this.roomInfo.isTimeRoom) { this.finalEventMessage = '비밀 대화방입니다.'; + } else if ( + this.roomInfo.finalEventType === EventType.NotificationForiOSCapture + ) { + this.finalEventMessage = this.translateService.instant( + 'chat.event.iosCapture', + { + requester: this.roomInfo.finalEventMessage + } + ); } else { this.finalEventMessage = this.roomInfo.finalEventMessage; } diff --git a/projects/ucap-webmessenger-ui/src/lib/utils/string.util.ts b/projects/ucap-webmessenger-ui/src/lib/utils/string.util.ts index 7d7dcbbd..9447cd4d 100644 --- a/projects/ucap-webmessenger-ui/src/lib/utils/string.util.ts +++ b/projects/ucap-webmessenger-ui/src/lib/utils/string.util.ts @@ -174,7 +174,9 @@ export class StringUtil { } break; case EventType.Sticker: - eventMessage = '스티커'; + { + eventMessage = '스티커'; + } break; case EventType.File: { @@ -188,7 +190,9 @@ export class StringUtil { } break; case EventType.VideoConference: - eventMessage = '화상회의'; + { + eventMessage = '화상회의'; + } break; case EventType.MassText: { @@ -209,20 +213,29 @@ export class StringUtil { } break; case EventType.Plan: - const m = finalEventMessage as PlanEventJson; - switch (m.contents) { - case PlanContentType.New: - eventMessage = '새로운 일정이 등록되었습니다.'; - break; - case PlanContentType.Update: - eventMessage = '일정이 수정되었습니다.'; - break; - case PlanContentType.Delete: - eventMessage = '일정이 취소되었습니다.'; - break; - default: - eventMessage = '일정이 업데이트 되었습니다.'; - break; + { + const m = finalEventMessage as PlanEventJson; + switch (m.contents) { + case PlanContentType.New: + eventMessage = '새로운 일정이 등록되었습니다.'; + break; + case PlanContentType.Update: + eventMessage = '일정이 수정되었습니다.'; + break; + case PlanContentType.Delete: + eventMessage = '일정이 취소되었습니다.'; + break; + default: + eventMessage = '일정이 업데이트 되었습니다.'; + break; + } + } + break; + case EventType.NotificationForiOSCapture: + { + const m = finalEventMessage as string; + eventMessage = `${m}님이 대화내용을 캡쳐하였습니다.`; + break; } break;