mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
@@ -8,9 +8,9 @@ import { WsChatService } from 'src/app/services/chat/ws-chat.service';
|
||||
import { showDateDuration } from 'src/plugin/showDateDuration';
|
||||
import { ChatStorageService } from './chat-storage.service'
|
||||
import { ChatMethodsService } from './chat-methods.service'
|
||||
import { MessageModel, DeleteMessageModel } from '../../models/beast-orm'
|
||||
import { MessageModel } from '../../models/beast-orm'
|
||||
import { AESEncrypt } from '../aesencrypt.service'
|
||||
import { HttpClient, HttpEventType } from '@angular/common/http';
|
||||
import { HttpEventType } from '@angular/common/http';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { NetworkServiceService , ConnectionStatus} from 'src/app/services/network-service.service';
|
||||
|
||||
@@ -133,7 +133,11 @@ export class MessageService {
|
||||
|
||||
if(!this.hasFile) {
|
||||
|
||||
const params = {roomId:this.rid, msg:this.msg, localReference: this.localReference}
|
||||
const params = {
|
||||
roomId:this.rid,
|
||||
msg:this.msg,
|
||||
localReference: this.localReference
|
||||
}
|
||||
|
||||
await this.sendRequest(params)
|
||||
|
||||
@@ -153,13 +157,10 @@ export class MessageService {
|
||||
this.errorUploadingAttachment = false
|
||||
this.temporaryData = {}
|
||||
|
||||
|
||||
const params = {roomId:this.rid, msg: this.msg, attachments: this.attachments, file: this.file, localReference: this.localReference}
|
||||
await this.sendRequest(params)
|
||||
|
||||
|
||||
} else if(this.WsChatService.isLogin == false) {
|
||||
|
||||
this.WsChatService.registerCallback({
|
||||
type: 'reConnect',
|
||||
funx: async ()=> {
|
||||
@@ -189,10 +190,6 @@ export class MessageService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) {
|
||||
|
||||
this.WsChatService.send(params).then(
|
||||
@@ -243,13 +240,7 @@ export class MessageService {
|
||||
|
||||
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
|
||||
|
||||
} /* else if (this.file.type == 'application/audio') {
|
||||
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
|
||||
} else if (this.file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
|
||||
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
|
||||
} */
|
||||
|
||||
|
||||
}
|
||||
|
||||
this.attachments[0] = {
|
||||
image_url: downloadFile,
|
||||
|
||||
Reference in New Issue
Block a user