1:1 대화방일 경우 대화방 제목 오프라인 정보 표시에 오프라인/부재중 분기표현하도록 수정.

This commit is contained in:
leejinho 2020-04-02 08:31:47 +09:00
parent de9cca2a5b
commit 64f2589e32
3 changed files with 23 additions and 8 deletions

View File

@ -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<UserInfo[]>(undefined);
userStatusListSubscription: Subscription;
offLineUsers: UserInfo[] = [];
offLineUsers: { userInfo: UserInfo; presence: StatusBulkInfo | null }[] = [];
eventListSubscription: Subscription;
eventListSubject = new BehaviorSubject<Info<EventJson>[]>(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

View File

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

View File

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