# 이슈처리
87 자동완성목록 사용자 여러 번 보여줌 :: 중복 제거. 137 번역 대화 검색되지 않음 :: 번역 대화 검색되도록 수정.
This commit is contained in:
parent
b1fd5a457f
commit
ec7fbdbecc
|
@ -26,11 +26,8 @@ import {
|
||||||
import * as AppStore from '@app/store';
|
import * as AppStore from '@app/store';
|
||||||
import * as ChatStore from '@app/store/messenger/chat';
|
import * as ChatStore from '@app/store/messenger/chat';
|
||||||
import * as RoomStore from '@app/store/messenger/room';
|
import * as RoomStore from '@app/store/messenger/room';
|
||||||
import { tap, debounceTime, delay, take } from 'rxjs/operators';
|
import { tap, debounceTime } from 'rxjs/operators';
|
||||||
import {
|
import { RoomUserData } from '@ucap-webmessenger/protocol-sync';
|
||||||
RoomUserDetailData,
|
|
||||||
RoomUserData
|
|
||||||
} from '@ucap-webmessenger/protocol-sync';
|
|
||||||
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
|
import { VersionInfo2Response } from '@ucap-webmessenger/api-public';
|
||||||
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
import { SessionStorageService } from '@ucap-webmessenger/web-storage';
|
||||||
import { KEY_VER_INFO } from '@app/types';
|
import { KEY_VER_INFO } from '@app/types';
|
||||||
|
@ -62,7 +59,6 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked {
|
||||||
chatContextMenuPosition = { x: '0px', y: '0px' };
|
chatContextMenuPosition = { x: '0px', y: '0px' };
|
||||||
|
|
||||||
roomList: RoomInfo[];
|
roomList: RoomInfo[];
|
||||||
roomUserList: RoomUserDetailData[];
|
|
||||||
roomUserShortList: RoomUserData[];
|
roomUserShortList: RoomUserData[];
|
||||||
sessionVerinfo: VersionInfo2Response;
|
sessionVerinfo: VersionInfo2Response;
|
||||||
|
|
||||||
|
@ -118,17 +114,17 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked {
|
||||||
this.store.pipe(
|
this.store.pipe(
|
||||||
select(AppStore.MessengerSelector.SyncSelector.selectAllRoom)
|
select(AppStore.MessengerSelector.SyncSelector.selectAllRoom)
|
||||||
),
|
),
|
||||||
this.store.pipe(
|
|
||||||
select(AppStore.MessengerSelector.SyncSelector.selectAllRoomUser)
|
|
||||||
),
|
|
||||||
this.store.pipe(
|
this.store.pipe(
|
||||||
select(AppStore.MessengerSelector.SyncSelector.selectAllRoomUserShort)
|
select(AppStore.MessengerSelector.SyncSelector.selectAllRoomUserShort)
|
||||||
)
|
)
|
||||||
])
|
])
|
||||||
.pipe(
|
.pipe(
|
||||||
tap(([room, roomUser, roomUserShort]) => {
|
tap(([room, roomUserShort]) => {
|
||||||
|
if (!room || !roomUserShort || roomUserShort.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.roomList = room;
|
this.roomList = room;
|
||||||
this.roomUserList = roomUser;
|
|
||||||
this.roomUserShortList = roomUserShort;
|
this.roomUserShortList = roomUserShort;
|
||||||
|
|
||||||
const recommendedWordList = [];
|
const recommendedWordList = [];
|
||||||
|
@ -137,15 +133,6 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked {
|
||||||
recommendedWordList.push(r.roomName);
|
recommendedWordList.push(r.roomName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const ru of roomUser) {
|
|
||||||
for (const u of ru.userInfos) {
|
|
||||||
if (u.seq !== this.loginRes.userSeq) {
|
|
||||||
if (!!u.name && '' !== u.name.trim()) {
|
|
||||||
recommendedWordList.push(u.name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (const ru of roomUserShort) {
|
for (const ru of roomUserShort) {
|
||||||
for (const u of ru.userInfos) {
|
for (const u of ru.userInfos) {
|
||||||
if (u.seq !== this.loginRes.userSeq) {
|
if (u.seq !== this.loginRes.userSeq) {
|
||||||
|
@ -155,8 +142,11 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.recommendedWordList = [
|
||||||
this.recommendedWordList = [...recommendedWordList];
|
...recommendedWordList.filter(
|
||||||
|
(item, index) => recommendedWordList.indexOf(item) === index
|
||||||
|
)
|
||||||
|
];
|
||||||
|
|
||||||
if (!!this.isSearch) {
|
if (!!this.isSearch) {
|
||||||
this.searchRoomList = room.filter(
|
this.searchRoomList = room.filter(
|
||||||
|
@ -285,15 +275,6 @@ export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked {
|
||||||
}
|
}
|
||||||
|
|
||||||
getRoomUserList(roomInfo: RoomInfo): (RoomUserInfo | UserInfoShort)[] {
|
getRoomUserList(roomInfo: RoomInfo): (RoomUserInfo | UserInfoShort)[] {
|
||||||
if (!!this.roomUserList && 0 < this.roomUserList.length) {
|
|
||||||
const i = this.roomUserList.findIndex(
|
|
||||||
value => roomInfo.roomSeq === value.roomSeq
|
|
||||||
);
|
|
||||||
if (-1 < i) {
|
|
||||||
return this.roomUserList[i].userInfos;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!!this.roomUserShortList && 0 < this.roomUserShortList.length) {
|
if (!!this.roomUserShortList && 0 < this.roomUserShortList.length) {
|
||||||
const i = this.roomUserShortList.findIndex(
|
const i = this.roomUserShortList.findIndex(
|
||||||
value => roomInfo.roomSeq === value.roomSeq
|
value => roomInfo.roomSeq === value.roomSeq
|
||||||
|
|
|
@ -336,14 +336,14 @@
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
*ngIf="isForwardableMessage(message, eventInfoStatus.validFileBaseSeq)"
|
*ngIf="isForwardableMessage(message, eventInfoStatus)"
|
||||||
(click)="onClickMessageContextMenu('REPLAY', message)"
|
(click)="onClickMessageContextMenu('REPLAY', message)"
|
||||||
>
|
>
|
||||||
{{ 'chat.forwardEventTo' | translate }}
|
{{ 'chat.forwardEventTo' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
*ngIf="isForwardableMessage(message, eventInfoStatus.validFileBaseSeq)"
|
*ngIf="isForwardableMessage(message, eventInfoStatus)"
|
||||||
(click)="onClickMessageContextMenu('REPLAY_TO_ME', message)"
|
(click)="onClickMessageContextMenu('REPLAY_TO_ME', message)"
|
||||||
>
|
>
|
||||||
{{ 'chat.forwardEventToMe' | translate }}
|
{{ 'chat.forwardEventToMe' | translate }}
|
||||||
|
|
|
@ -1638,6 +1638,9 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
contents = (event.sentMessageJson as FileEventJson).fileName;
|
contents = (event.sentMessageJson as FileEventJson).fileName;
|
||||||
} else if (event.type === EventType.MassText && !!event.sentMessageJson) {
|
} else if (event.type === EventType.MassText && !!event.sentMessageJson) {
|
||||||
contents = (event.sentMessageJson as MassTextEventJson).content;
|
contents = (event.sentMessageJson as MassTextEventJson).content;
|
||||||
|
} else if ((event.type === EventType.Translation || event.type === EventType.MassTranslation) && !!event.sentMessageJson) {
|
||||||
|
contents = (event.sentMessageJson as TranslationEventJson).original;
|
||||||
|
contents += (event.sentMessageJson as TranslationEventJson).translation;
|
||||||
}
|
}
|
||||||
|
|
||||||
return contents.indexOf(searchText) > -1;
|
return contents.indexOf(searchText) > -1;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { EventType } from '../types/event.type';
|
import { EventType } from '../types/event.type';
|
||||||
|
import { InfoResponse } from '../protocols/info';
|
||||||
|
|
||||||
export interface Info<T = {}> {
|
export interface Info<T = {}> {
|
||||||
// 이벤트SEQ
|
// 이벤트SEQ
|
||||||
|
@ -37,9 +38,16 @@ export function isRecallable(event: Info<any>, userSeq: number): boolean {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isForwardable(event: Info, expiredFileStdSeq: number): boolean {
|
export function isForwardable(
|
||||||
|
event: Info,
|
||||||
|
eventInfoStatus: InfoResponse
|
||||||
|
): boolean {
|
||||||
if (event.type === EventType.File) {
|
if (event.type === EventType.File) {
|
||||||
if (!!expiredFileStdSeq && expiredFileStdSeq <= event.seq) {
|
if (
|
||||||
|
!!eventInfoStatus &&
|
||||||
|
!!eventInfoStatus.validFileBaseSeq &&
|
||||||
|
eventInfoStatus.validFileBaseSeq <= event.seq
|
||||||
|
) {
|
||||||
// valid..
|
// valid..
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user