fix donwload attachment and modal to edit message

This commit is contained in:
Peter Maquiran
2024-08-29 12:13:15 +01:00
parent 97ad62e2b6
commit d8d294b662
38 changed files with 627 additions and 198 deletions
+24 -31
View File
@@ -1,52 +1,45 @@
import { SafeResourceUrl } from "@angular/platform-browser";
import { MessageAttachmentFileType, MessageAttachmentSource, MessageEntity } from "src/app/core/chat/entity/message";
import { IMessageType, MessageEntity, MessageEntitySchema } from "src/app/core/chat/entity/message";
import { SessionStore } from "src/app/store/session.service";
export class MessageViewModal {
$id!: number
id!: string
$id?: number
id?: string
roomId?: string
receiverId?: number
message!: string
message?: string
messageType: number = 0
canEdit: boolean = false
oneShot: boolean = false
sentAt!: string
sentAt?: string
requireUnlock: boolean = false
info: {
memberId?: number
readAt?: string,
deliverAt?: string
}[] = []
sender!: {
wxUserId: number,
wxFullName: string,
wxeMail: string,
userPhoto: string,
}
info: typeof MessageEntitySchema._type.info = []
sender!: typeof MessageEntitySchema._type.sender
sending: boolean = false
sendAttemp = 0
attachments: {
safeFile?: SafeResourceUrl;
fileType: MessageAttachmentFileType,
source: MessageAttachmentSource,
file?: string,
fileName: string,
applicationId?: number,
docId?: string,
mimeType?: string,
description?: string
id?: string
}[] = []
reactions = []
attachments: typeof MessageEntitySchema._type.attachments = []
reactions: typeof MessageEntitySchema._type.reactions = []
requestId!: string
status = ''
isDeleted: typeof MessageEntitySchema._type.isDeleted = false
status!: 'allViewed' | 'allReceived'| 'enviado'| 'enviar'
messageUiType!: 'info-meeting'| 'my-message'| 'other-message'
constructor(model: MessageEntity) {
Object.assign(this, model)
this.setMessageUIType()
}
setMessageUIType() {
if(this.messageType == IMessageType.information) {
this.messageUiType = 'info-meeting'
} else if (this.sender?.wxUserId === SessionStore.user.UserId) {
this.messageUiType = 'my-message'
} else {
this.messageUiType = 'other-message'
}
}
messageStatus(totalMembers: number) {
if(this.allViewed(totalMembers)) {