기간만료된 파일 전달 하지 못하도록 수정.

This commit is contained in:
leejinho 2019-12-04 14:36:15 +09:00
parent d1b7c4585d
commit baafd13cd6
4 changed files with 29 additions and 6 deletions

View File

@ -98,7 +98,6 @@ export class AppWindow {
// }
});
this.window.on(ElectronBrowserWindowChannel.Focus, e => {
console.log(e);
this.window.flashFrame(false);
});
}

View File

@ -172,7 +172,7 @@
>
<ucap-chat-messages
[messages]="eventList"
[eventInfoStatus]="eventInfoStatus$ | async"
[eventInfoStatus]="eventInfoStatus"
[eventRemain]="eventRemain$ | async"
[userInfos]="userInfoList"
[loginRes]="loginRes"
@ -248,12 +248,14 @@
</button>
<button
mat-menu-item
*ngIf="isForwardableMessage(message, eventInfoStatus.validFileBaseSeq)"
(click)="onClickMessageContextMenu('REPLAY', message)"
>
대화 전달
</button>
<button
mat-menu-item
*ngIf="isForwardableMessage(message, eventInfoStatus.validFileBaseSeq)"
(click)="onClickMessageContextMenu('REPLAY_TO_ME', message)"
>
대화 나에게 전달

View File

@ -31,6 +31,7 @@ import {
isRecalled,
isCopyable,
isRecallable,
isForwardable,
InfoResponse,
EventJson,
FileEventJson,
@ -144,7 +145,8 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
userInfoList: UserInfo[];
userInfoListSubscription: Subscription;
eventListProcessing$: Observable<boolean>;
eventInfoStatus$: Observable<InfoResponse>;
eventInfoStatus: InfoResponse;
eventInfoStatusSubscription: Subscription;
sessionVerInfo: VersionInfo2Response;
eventRemain$: Observable<boolean>;
@ -155,6 +157,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
isRecalledMessage = isRecalled;
isCopyableMessage = isCopyable;
isRecallableMessage = isRecallable;
isForwardableMessage = isForwardable;
/** Timer 대화방의 대화 삭제를 위한 interval */
interval: any;
@ -253,9 +256,12 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
)
.subscribe();
this.eventInfoStatus$ = this.store.pipe(
select(AppStore.MessengerSelector.EventSelector.infoStatus)
);
this.eventInfoStatusSubscription = this.store
.pipe(
select(AppStore.MessengerSelector.EventSelector.infoStatus),
tap(res => (this.eventInfoStatus = res))
)
.subscribe();
this.interval = setInterval(() => {
if (!!this.roomInfo && !!this.roomInfo.isTimeRoom) {
@ -277,6 +283,9 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
if (!!this.eventListSubscription) {
this.eventListSubscription.unsubscribe();
}
if (!!this.eventInfoStatusSubscription) {
this.eventInfoStatusSubscription.unsubscribe();
}
clearInterval(this.interval);
}

View File

@ -32,3 +32,16 @@ export function isRecallable(event: Info<any>, userSeq: number): boolean {
event.senderSeq === userSeq && event.type !== EventType.RecalledMessage
);
}
export function isForwardable(event: Info, expiredFileStdSeq: number): boolean {
if (event.type === EventType.File) {
if (!!expiredFileStdSeq && expiredFileStdSeq <= event.seq) {
// valid..
return true;
} else {
// expired..
return false;
}
}
return true;
}