This commit is contained in:
Peter Maquiran
2022-02-10 14:24:27 +01:00
2 changed files with 38 additions and 25 deletions
+6 -6
View File
@@ -39,7 +39,7 @@ export class MessageService {
}
setData({customFields, channels, mentions, msg ,rid ,ts, u, t, _id, _updatedAt, file, attachments, temporaryData}:Message) {
this.customFields = customFields
this.customFields = customFields
this.channels = channels || []
this.mentions = mentions || []
this.msg = msg || ""
@@ -80,7 +80,7 @@ export class MessageService {
const firstName = capitalizeTxt(username.split('.')[0])
const lastName = capitalizeTxt(username.split('.')[1])
return firstName + ' ' + lastName
}
}
getFileFromDb() {
@@ -116,14 +116,14 @@ export class MessageService {
if(this.hasSendAttachment == false) {
uploadSuccessfully = await this.NfService.beforeSendAttachment(this)
}
this.uploadingFile = false
if(uploadSuccessfully || this.hasSendAttachment == false) {
this.hasSendAttachment = true
this.errorUploadingAttachment = false
this.temporaryData = {}
this.WsChatService.send({roomId:this.rid, msg: this.msg, attachments: this.attachments, file: this.file}).then((data: any) => {
if (environment.chatOffline) {
// console.log('send sucees', data.result)
@@ -147,11 +147,11 @@ export class MessageService {
this.errorUploadingAttachment = true
}
}
}
redefinedMessage(messagem, ChatMessage) {
redefinedMessage(messagem, ChatMessage) {
this.setData(ChatMessage)
}