Merge branch 'master' of https://git.loafle.net/ucap-web/next-ucap-messenger
This commit is contained in:
commit
77ae813584
|
@ -355,14 +355,14 @@
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
*ngIf="isForwardableMessage(message, eventInfoStatusSubject.value)"
|
*ngIf="isForwardableMessage(message, roomInfoSubject.value)"
|
||||||
(click)="onClickMessageContextMenu('FORWARD', message)"
|
(click)="onClickMessageContextMenu('FORWARD', message)"
|
||||||
>
|
>
|
||||||
{{ 'chat.forwardEventTo' | translate }}
|
{{ 'chat.forwardEventTo' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
mat-menu-item
|
mat-menu-item
|
||||||
*ngIf="isForwardableMessage(message, eventInfoStatusSubject.value)"
|
*ngIf="isForwardableMessage(message, roomInfoSubject.value)"
|
||||||
(click)="onClickMessageContextMenu('FORWARD_TO_ME', message)"
|
(click)="onClickMessageContextMenu('FORWARD_TO_ME', message)"
|
||||||
>
|
>
|
||||||
{{ 'chat.forwardEventToMe' | translate }}
|
{{ 'chat.forwardEventToMe' | translate }}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { EventType } from '../types/event.type';
|
import { EventType } from '../types/event.type';
|
||||||
import { InfoResponse } from '../protocols/info';
|
import { InfoResponse } from '../protocols/info';
|
||||||
|
import { RoomInfo } from '@ucap-webmessenger/protocol-room';
|
||||||
|
|
||||||
export interface Info<T = {}> {
|
export interface Info<T = {}> {
|
||||||
// 이벤트SEQ
|
// 이벤트SEQ
|
||||||
|
@ -38,10 +39,7 @@ export function isRecallable(event: Info<any>, userSeq: number): boolean {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isForwardable(
|
export function isForwardable(event: Info, roomInfo: RoomInfo): boolean {
|
||||||
event: Info,
|
|
||||||
eventInfoStatus: InfoResponse
|
|
||||||
): boolean {
|
|
||||||
if (
|
if (
|
||||||
event.type === EventType.Plan ||
|
event.type === EventType.Plan ||
|
||||||
event.type === EventType.AllimTms ||
|
event.type === EventType.AllimTms ||
|
||||||
|
@ -50,9 +48,9 @@ export function isForwardable(
|
||||||
return false;
|
return false;
|
||||||
} else if (event.type === EventType.File) {
|
} else if (event.type === EventType.File) {
|
||||||
if (
|
if (
|
||||||
!!eventInfoStatus &&
|
!!roomInfo &&
|
||||||
!!eventInfoStatus.validFileBaseSeq &&
|
!!roomInfo.expiredFileStdSeq &&
|
||||||
eventInfoStatus.validFileBaseSeq <= event.seq
|
roomInfo.expiredFileStdSeq <= event.seq
|
||||||
) {
|
) {
|
||||||
// valid..
|
// valid..
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
</ucap-chat-message-box-mass>
|
</ucap-chat-message-box-mass>
|
||||||
<ucap-chat-message-box-file
|
<ucap-chat-message-box-file
|
||||||
*ngSwitchCase="EventType.File"
|
*ngSwitchCase="EventType.File"
|
||||||
[eventInfoStatus]="eventInfoStatus"
|
[roomInfo]="roomInfo"
|
||||||
[message]="message"
|
[message]="message"
|
||||||
(save)="onSave($event)"
|
(save)="onSave($event)"
|
||||||
(fileViewer)="onFileViewer($event)"
|
(fileViewer)="onFileViewer($event)"
|
||||||
|
|
|
@ -23,6 +23,7 @@ import {
|
||||||
import { NGXLogger } from 'ngx-logger';
|
import { NGXLogger } from 'ngx-logger';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { FileDownloadItem } from '@ucap-webmessenger/api';
|
import { FileDownloadItem } from '@ucap-webmessenger/api';
|
||||||
|
import { RoomInfo } from '@ucap-webmessenger/protocol-room';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ucap-chat-message-box',
|
selector: 'ucap-chat-message-box',
|
||||||
|
@ -56,7 +57,7 @@ export class MessageBoxComponent implements OnInit, AfterViewInit {
|
||||||
profileImage: string;
|
profileImage: string;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
eventInfoStatus?: InfoResponse;
|
roomInfo: RoomInfo;
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
translationSimpleview = false;
|
translationSimpleview = false;
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
import { StatusCode, FileDownloadItem } from '@ucap-webmessenger/api';
|
import { StatusCode, FileDownloadItem } from '@ucap-webmessenger/api';
|
||||||
import { FileType } from '@ucap-webmessenger/protocol-file';
|
import { FileType } from '@ucap-webmessenger/protocol-file';
|
||||||
import { NGXLogger } from 'ngx-logger';
|
import { NGXLogger } from 'ngx-logger';
|
||||||
|
import { RoomInfo } from '@ucap-webmessenger/protocol-room';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ucap-chat-message-box-file',
|
selector: 'ucap-chat-message-box-file',
|
||||||
|
@ -17,7 +18,7 @@ export class FileComponent implements OnInit {
|
||||||
@Input()
|
@Input()
|
||||||
message: Info<FileEventJson>;
|
message: Info<FileEventJson>;
|
||||||
@Input()
|
@Input()
|
||||||
eventInfoStatus: InfoResponse;
|
roomInfo: RoomInfo;
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
save = new EventEmitter<{
|
save = new EventEmitter<{
|
||||||
|
@ -48,8 +49,8 @@ export class FileComponent implements OnInit {
|
||||||
|
|
||||||
getExpiredFile() {
|
getExpiredFile() {
|
||||||
if (
|
if (
|
||||||
!!this.eventInfoStatus &&
|
!!this.roomInfo &&
|
||||||
this.eventInfoStatus.validFileBaseSeq <= this.message.seq
|
this.roomInfo.expiredFileStdSeq <= this.message.seq
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
[senderName]="getUserName(message.senderSeq)"
|
[senderName]="getUserName(message.senderSeq)"
|
||||||
[profileImageRoot]="profileImageRoot"
|
[profileImageRoot]="profileImageRoot"
|
||||||
[profileImage]="getUserProfile(message.senderSeq)"
|
[profileImage]="getUserProfile(message.senderSeq)"
|
||||||
[eventInfoStatus]="eventInfoStatus"
|
[roomInfo]="roomInfo"
|
||||||
[translationSimpleview]="translationSimpleview"
|
[translationSimpleview]="translationSimpleview"
|
||||||
[unreadCount]="isShowUnreadCount ? getUnreadCount(message) : undefined"
|
[unreadCount]="isShowUnreadCount ? getUnreadCount(message) : undefined"
|
||||||
(openProfile)="onClickOpenProfile($event)"
|
(openProfile)="onClickOpenProfile($event)"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user