mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
bug send file chat
This commit is contained in:
Generated
+15
@@ -2999,6 +2999,21 @@
|
|||||||
"@types/cordova": "^0.0.34"
|
"@types/cordova": "^0.0.34"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@ionic-native/document-viewer": {
|
||||||
|
"version": "5.36.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@ionic-native/document-viewer/-/document-viewer-5.36.0.tgz",
|
||||||
|
"integrity": "sha512-4AuQ7yDyN4coetNNDDkk5hf9ptoj+FvzBcOPH30ZVNnhlzvqtTT5t4coksDqzUlz5vqJuAGQwawpwqdYdTx0rA==",
|
||||||
|
"requires": {
|
||||||
|
"@types/cordova": "^0.0.34"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/cordova": {
|
||||||
|
"version": "0.0.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
|
||||||
|
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"@ionic-native/fcm": {
|
"@ionic-native/fcm": {
|
||||||
"version": "5.36.0",
|
"version": "5.36.0",
|
||||||
"resolved": "https://registry.npmjs.org/@ionic-native/fcm/-/fcm-5.36.0.tgz",
|
"resolved": "https://registry.npmjs.org/@ionic-native/fcm/-/fcm-5.36.0.tgz",
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
"@fullcalendar/interaction": "^5.3.0",
|
"@fullcalendar/interaction": "^5.3.0",
|
||||||
"@ionic-native/camera": "^5.31.1",
|
"@ionic-native/camera": "^5.31.1",
|
||||||
"@ionic-native/core": "^5.0.7",
|
"@ionic-native/core": "^5.0.7",
|
||||||
|
"@ionic-native/document-viewer": "^5.36.0",
|
||||||
"@ionic-native/fcm": "^5.36.0",
|
"@ionic-native/fcm": "^5.36.0",
|
||||||
"@ionic-native/file": "^5.36.0",
|
"@ionic-native/file": "^5.36.0",
|
||||||
"@ionic-native/file-path": "^5.30.0",
|
"@ionic-native/file-path": "^5.30.0",
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ ion-toolbar{
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@media only screen and (min-width: 801px) {
|
@media only screen and (min-width: 701px) {
|
||||||
.content-right{
|
.content-right{
|
||||||
display: flex !important;
|
display: flex !important;
|
||||||
width: 65%;
|
width: 65%;
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ export class RoomService {
|
|||||||
|
|
||||||
|
|
||||||
if(this.isSenderIsNotMe(ChatMessage)) {
|
if(this.isSenderIsNotMe(ChatMessage)) {
|
||||||
this.addMessageDB(ChatMessage)
|
//this.addMessageDB(ChatMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@ export class RoomService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
addMessageDB(ChatMessage) {
|
/* addMessageDB(ChatMessage) {
|
||||||
this.storage.get('chatmsg' + this.id).then((messages: any = []) => {
|
this.storage.get('chatmsg' + this.id).then((messages: any = []) => {
|
||||||
if(messages==null) messages = []
|
if(messages==null) messages = []
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ export class RoomService {
|
|||||||
|
|
||||||
this.storage.set('chatmsg' + this.id, messages)
|
this.storage.set('chatmsg' + this.id, messages)
|
||||||
})
|
})
|
||||||
}
|
} */
|
||||||
|
|
||||||
async receiveMessageDelete() {
|
async receiveMessageDelete() {
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ export class RoomService {
|
|||||||
|
|
||||||
console.log('offlineChatMessage', offlineChatMessage)
|
console.log('offlineChatMessage', offlineChatMessage)
|
||||||
|
|
||||||
this.addMessageDB(offlineChatMessage)
|
//this.addMessageDB(offlineChatMessage)
|
||||||
const message: MessageService = this.prepareMessage(offlineChatMessage)
|
const message: MessageService = this.prepareMessage(offlineChatMessage)
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import { SearchPage } from 'src/app/pages/search/search.page';
|
|||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
||||||
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
||||||
|
import { DocumentViewer, DocumentViewerOptions} from '@ionic-native/document-viewer';
|
||||||
|
|
||||||
const IMAGE_DIR = 'stored-images';
|
const IMAGE_DIR = 'stored-images';
|
||||||
@Component({
|
@Component({
|
||||||
@@ -600,22 +601,26 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
const roomId = this.roomId
|
const roomId = this.roomId
|
||||||
|
|
||||||
const file: any = await this.fileService.getFileFromDevice(types);
|
const file: any = await this.fileService.getFileFromDevice(types);
|
||||||
console.log('Add image', file)
|
console.log('Add file', file)
|
||||||
const imageData = await this.fileToBase64Service.convert(file)
|
/* const imageData = await this.fileToBase64Service.convert(file).then((filee) => {
|
||||||
|
console.log('Add file', filee)
|
||||||
|
}) */
|
||||||
|
const blob = new Blob([file],{type: file.type})
|
||||||
|
console.log('Add file', blob)
|
||||||
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("blobFile", file);
|
formData.append("blobFile", blob);
|
||||||
|
|
||||||
this.wsChatMethodsService.getDmRoom(roomId).send({
|
this.wsChatMethodsService.getDmRoom(roomId).send({
|
||||||
file: {
|
file: {
|
||||||
"type": "application/img",
|
"type": file.type,
|
||||||
"guid": '',
|
"guid": '',
|
||||||
},
|
},
|
||||||
attachments: [{
|
attachments: [{
|
||||||
"title": file.name ,
|
"title": file.name ,
|
||||||
"name": file.name ,
|
"name": file.name ,
|
||||||
// "text": "description",
|
// "text": "description",
|
||||||
"image_url": imageData, // rocketchat
|
"image_url": file, // rocketchat
|
||||||
"title_link_download": false,
|
"title_link_download": false,
|
||||||
}],
|
}],
|
||||||
temporaryData: formData
|
temporaryData: formData
|
||||||
@@ -747,6 +752,13 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pdfPreviwe() {
|
||||||
|
const options: DocumentViewerOptions = {
|
||||||
|
title: 'My App'
|
||||||
|
};
|
||||||
|
DocumentViewer.viewDocument
|
||||||
|
}
|
||||||
|
|
||||||
async openPreview(msg) {
|
async openPreview(msg) {
|
||||||
|
|
||||||
if (msg.file.image_url === null || msg.file.image_url === '' ) {
|
if (msg.file.image_url === null || msg.file.image_url === '' ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user