From 64f2589e3295490db21646753b88ca195b791e42 Mon Sep 17 00:00:00 2001 From: leejinho Date: Thu, 2 Apr 2020 08:31:47 +0900 Subject: [PATCH] =?UTF-8?q?1:1=20=EB=8C=80=ED=99=94=EB=B0=A9=EC=9D=BC=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20=EB=8C=80=ED=99=94=EB=B0=A9=20=EC=A0=9C?= =?UTF-8?q?=EB=AA=A9=20=EC=98=A4=ED=94=84=EB=9D=BC=EC=9D=B8=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=ED=91=9C=EC=8B=9C=EC=97=90=20=EC=98=A4=ED=94=84?= =?UTF-8?q?=EB=9D=BC=EC=9D=B8/=EB=B6=80=EC=9E=AC=EC=A4=91=20=EB=B6=84?= =?UTF-8?q?=EA=B8=B0=ED=91=9C=ED=98=84=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main-contents/messages.component.ts | 27 ++++++++++++++----- .../src/assets/i18n/en.json | 1 + .../src/assets/i18n/ko.json | 3 ++- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/main-contents/messages.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/main-contents/messages.component.ts index cabab0a2..b48a0031 100644 --- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/main-contents/messages.component.ts +++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/main-contents/messages.component.ts @@ -162,6 +162,7 @@ import { } from '@ucap-webmessenger/api-message'; import moment from 'moment'; import { ElectronBrowserWindowChannel } from '@ucap-webmessenger/electron-core'; +import { StatusBulkInfo } from '@ucap-webmessenger/protocol-status'; @Component({ selector: 'app-layout-messenger-messages', @@ -209,7 +210,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { userInfoListSubject = new BehaviorSubject(undefined); userStatusListSubscription: Subscription; - offLineUsers: UserInfo[] = []; + offLineUsers: { userInfo: UserInfo; presence: StatusBulkInfo | null }[] = []; eventListSubscription: Subscription; eventListSubject = new BehaviorSubject[]>(undefined); @@ -408,7 +409,9 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { .forEach(userInfo => { const presence = presences[userInfo.seq]; const existIndex = !!this.offLineUsers - ? this.offLineUsers.findIndex(e => e.seq === userInfo.seq) + ? this.offLineUsers.findIndex( + e => e.userInfo.seq === userInfo.seq + ) : -1; if ( @@ -422,7 +425,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { } } else { if (existIndex === -1) { - this.offLineUsers.push(userInfo); + this.offLineUsers.push({ userInfo, presence }); } } }); @@ -699,14 +702,24 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit { !!this.roomInfoSubject.value && this.roomInfoSubject.value.roomType === RoomType.Single ) { + const trgtUser = this.offLineUsers[0]; const name = new UiTranslatePipe( this.uiTranslateService, this.changeDetectorRef - ).transform(this.offLineUsers[0], 'name'); + ).transform(trgtUser.userInfo, 'name'); - offlineStr = this.translateService.instant('chat.existOfflineUser', { - offlineUser: name - }); + if ( + !!trgtUser.presence && + trgtUser.presence.pcStatus === PresenceStatusCode.Away + ) { + offlineStr = this.translateService.instant('chat.existAwayUser', { + offlineUser: name + }); + } else { + offlineStr = this.translateService.instant('chat.existOfflineUser', { + offlineUser: name + }); + } } else if ( !!this.roomInfoSubject.value && this.roomInfoSubject.value.roomType === RoomType.Multi diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/en.json b/projects/ucap-webmessenger-app/src/assets/i18n/en.json index 44e9ad61..b6f52757 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/en.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/en.json @@ -244,6 +244,7 @@ "btnSticker": "Sticker", "btnTranslate": "Translate", "noRoomUser": "No chat users", + "existAwayUser": "{{offlineUser}} may not respond because it is [away].", "existOfflineUser": "{{offlineUser}} may not respond because it is [offline].", "existOfflineUsers": "Some chat partners may not respond because they are not online.", "event": { diff --git a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json index e98116b4..751a48f1 100644 --- a/projects/ucap-webmessenger-app/src/assets/i18n/ko.json +++ b/projects/ucap-webmessenger-app/src/assets/i18n/ko.json @@ -82,7 +82,7 @@ "searchFormPlaceholder": "이름, 부서, 직위, 전화번호, 이메일", "fold": "접어두기", "unfold": "펼쳐보기", - "clear":"검색 초기화", + "clear": "검색 초기화", "clearAndColse": "검색 초기화 & 닫기", "andOthers": "외 {{count}}건", "fieldProfile": "프로필", @@ -244,6 +244,7 @@ "btnSticker": "스티커", "btnTranslate": "번역", "noRoomUser": "대화상대 없음", + "existAwayUser": "{{offlineUser}}님이 [부재중]이므로 응답하지 않을 수도 있습니다.", "existOfflineUser": "{{offlineUser}}님이 [오프라인]이므로 응답하지 않을 수도 있습니다.", "existOfflineUsers": "일부 대화상대는 온라인 상태가 아니어서 응답하지 않을 수도 있습니다.", "event": {