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": {