remove rocket chat

This commit is contained in:
Peter Maquiran
2024-08-09 10:50:32 +01:00
parent 45e829bec3
commit 6cbd8d903c
67 changed files with 962 additions and 5618 deletions
@@ -5,7 +5,7 @@ import { AuthService } from 'src/app/services/auth.service';
import { ChatService } from 'src/app/services/chat.service';
import { MessagesPage } from '../messages.page';
import { ThemeService } from 'src/app/services/theme.service'
import { ChatSystemService} from 'src/app/services/chat/chat-system.service'
// import { ChatSystemService} from 'src/app/services/chat/chat-system.service'
import { SessionStore } from 'src/app/store/session.service';
@Component({
@@ -23,7 +23,7 @@ export class ContactsPage implements OnInit {
room:any;
dm:any;
sessionStore = SessionStore
userList = this.ChatSystemService.users
userList = []
constructor(
private modalController: ModalController,
@@ -31,7 +31,7 @@ export class ContactsPage implements OnInit {
private chatService: ChatService,
private authService: AuthService,
public ThemeService: ThemeService,
public ChatSystemService: ChatSystemService,
// public ChatSystemService: ChatSystemService,
)
{
this.loggedUser = SessionStore.user.ChatData['data'];
@@ -44,7 +44,7 @@ export class ContactsPage implements OnInit {
ngOnInit() {
// this.chatService.refreshtoken();
// this.loadUsers();
this.ChatSystemService.getUser()
// this.ChatSystemService.getUser()
}
@@ -52,10 +52,10 @@ export class ContactsPage implements OnInit {
this.textSearch = event.detail.value.toLowerCase();
this.userList = this.ChatSystemService.users.filter((e) => {
const username = e.name.toLowerCase()
return username.includes(this.textSearch)
})
// this.userList = this.ChatSystemService.users.filter((e) => {
// const username = e.name.toLowerCase()
// return username.includes(this.textSearch)
// })
}
@@ -97,10 +97,10 @@ export class ContactsPage implements OnInit {
this.chatService.createRoom(body).subscribe(async(res) => {
this.room = res['room'];
this.ChatSystemService.getAllRooms(() => {
this.getDirectMessage(this.room._id);
this.loading = false
}, this.room._id);
// this.ChatSystemService.getAllRooms(() => {
// this.getDirectMessage(this.room._id);
// this.loading = false
// }, this.room._id);
}, ()=> {
+124 -125
View File
@@ -19,8 +19,8 @@ import { ThemeService } from 'src/app/services/theme.service'
import { VoiceRecorder, RecordingData, GenericResponse } from 'capacitor-voice-recorder';
import { Haptics, ImpactStyle } from '@capacitor/haptics';
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
import { ChatSystemService } from 'src/app/services/chat/chat-system.service'
import { MessageService } from 'src/app/services/chat/message.service';
// import { ChatSystemService } from 'src/app/services/chat/chat-system.service'
// import { MessageService } from 'src/app/services/chat/message.service';
import { FileType } from 'src/app/models/fileType';
import { SearchPage } from 'src/app/pages/search/search.page';
import { Storage } from '@ionic/storage';
@@ -33,7 +33,7 @@ import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
import { NewEventPage } from '../../agenda/new-event/new-event.page';
import { NotificationsService } from 'src/app/services/notifications.service';
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'
// import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service'
import { FileValidatorService } from "src/app/services/file/file-validator.service"
import { sanitize } from "sanitize-filename-ts";
import { FilePicker } from '@capawesome/capacitor-file-picker';
@@ -141,7 +141,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
private gestureController: GestureController,
public ThemeService: ThemeService,
private platform: Platform,
public ChatSystemService: ChatSystemService,
// public ChatSystemService: ChatSystemService,
private storage: Storage,
//private fileOpener: FileOpener,
private sanitiser: DomSanitizer,
@@ -149,7 +149,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
private file: File,
private fileOpener: FileOpener,
private router: Router,
public RochetChatConnectorService: RochetChatConnectorService,
// public RochetChatConnectorService: RochetChatConnectorService,
private FileValidatorService: FileValidatorService,
///
private roomRepositoryService: RoomRepositoryService,
@@ -208,11 +208,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
// console.log(this.router.url);
this.createDirectoryImage()
// this.chatService.refreshtoken();
this.ChatSystemService.getUserOfRoom(this.roomId).then((value) => {
// this.ChatSystemService.getUserOfRoom(this.roomId).then((value) => {
}).catch((error) => {
console.error(error)
})
// }).catch((error) => {
// console.error(error)
// })
this.getChatMembers();
} catch (error) {
@@ -354,8 +354,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
deleteMessage(msgId: string) {
const room = this.ChatSystemService.getDmRoom(this.roomId)
this.alertService.confirmDeleteMessage(msgId, room);
// const room = this.ChatSystemService.getDmRoom(this.roomId)
// this.alertService.confirmDeleteMessage(msgId, room);
}
@@ -439,8 +439,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
sendMessage() {
this.ChatSystemService.getDmRoom(this.roomId).send({}).then(() => {
})
// this.ChatSystemService.getDmRoom(this.roomId).send({}).then(() => {
// })
}
/* sendMessage(msg) {
@@ -480,22 +480,22 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const formData = new FormData();
formData.append("blobFile", blob);
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": "application/audio",
"msDuration": audioFile.value.msDuration,
"mimeType": audioFile.value.mimeType,
},
attachments: [{
"title": sanitize(fileName),
"title_link_download": true,
"type": "audio"
}],
temporaryData: formData,
attachmentsModelData: {
fileBase64: encodedData,
}
})
// this.ChatSystemService.getDmRoom(roomId).send({
// file: {
// "type": "application/audio",
// "msDuration": audioFile.value.msDuration,
// "mimeType": audioFile.value.mimeType,
// },
// attachments: [{
// "title": sanitize(fileName),
// "title_link_download": true,
// "type": "audio"
// }],
// temporaryData: formData,
// attachmentsModelData: {
// fileBase64: encodedData,
// }
// })
});
this.deleteRecording();
@@ -575,8 +575,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
// this.showLoader = false;
// });
this.members = this.ChatSystemService.getDmRoom(this.roomId).members
this.dmUsers = this.ChatSystemService.getDmRoom(this.roomId).membersExcludeMe
// this.members = this.ChatSystemService.getDmRoom(this.roomId).members
// this.dmUsers = this.ChatSystemService.getDmRoom(this.roomId).membersExcludeMe
}
showDateDuration(start: any) {
@@ -644,20 +644,20 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
async bookMeeting() {
let attendees = this.ChatSystemService.getDmRoom(this.roomId).members.map((val) => {
return {
Name: val.name,
EmailAddress: val.username + "@" + environment.domain,
IsRequired: "true",
}
});
// let attendees = this.ChatSystemService.getDmRoom(this.roomId).members.map((val) => {
// return {
// Name: val.name,
// EmailAddress: val.username + "@" + environment.domain,
// IsRequired: "true",
// }
// });
this.popoverController.dismiss();
if (window.innerWidth <= 1024) {
const modal = await this.modalController.create({
component: NewEventPage,
componentProps: {
attendees: attendees,
// attendees: attendees,
roomId: this.roomId
},
cssClass: 'modal modal-desktop',
@@ -719,21 +719,21 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const formData = new FormData();
formData.append("blobFile", blob);
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": "application/img",
"guid": ''
},
attachments: [{
"title": "file.jpg",
"text": "description",
"title_link_download": false,
}],
temporaryData: formData,
attachmentsModelData: {
fileBase64: imageBase64,
}
})
// this.ChatSystemService.getDmRoom(roomId).send({
// file: {
// "type": "application/img",
// "guid": ''
// },
// attachments: [{
// "title": "file.jpg",
// "text": "description",
// "title_link_download": false,
// }],
// temporaryData: formData,
// attachmentsModelData: {
// fileBase64: imageBase64,
// }
// })
}
@@ -791,26 +791,26 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (data.selected) {
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"name": res.data.selected.Assunto,
"type": "application/webtrix",
"ApplicationId": res.data.selected.ApplicationType,
"DocId": res.data.selected.Id,
"Assunto": res.data.selected.Assunto,
},
temporaryData: res,
attachments: [{
"title": res.data.selected.Assunto,
"description": res.data.selected.DocTypeDesc,
// "title_link": url_no_options,
"title_link_download": true,
"thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
// "message_link": url_no_options,
"text": res.data.selected.DocTypeDesc,
"type": "webtrix"
}],
})
// this.ChatSystemService.getDmRoom(roomId).send({
// file: {
// "name": res.data.selected.Assunto,
// "type": "application/webtrix",
// "ApplicationId": res.data.selected.ApplicationType,
// "DocId": res.data.selected.Id,
// "Assunto": res.data.selected.Assunto,
// },
// temporaryData: res,
// attachments: [{
// "title": res.data.selected.Assunto,
// "description": res.data.selected.DocTypeDesc,
// // "title_link": url_no_options,
// "title_link_download": true,
// "thumb_url": "https://static.ichimura.ed.jp/uploads/2017/10/pdf-icon.png",
// // "message_link": url_no_options,
// "text": res.data.selected.DocTypeDesc,
// "type": "webtrix"
// }],
// })
}
});
@@ -852,21 +852,21 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
formData.append("blobFile", blob);
//console.log('add file', formData)
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": "application/img",
"guid": ''
},
temporaryData: formData,
attachments: [{
"title": file.path,
"text": "description",
"title_link_download": false,
}],
attachmentsModelData: {
fileBase64: imageBase64,
}
})
// this.ChatSystemService.getDmRoom(roomId).send({
// file: {
// "type": "application/img",
// "guid": ''
// },
// temporaryData: formData,
// attachments: [{
// "title": file.path,
// "text": "description",
// "title_link_download": false,
// }],
// attachmentsModelData: {
// fileBase64: imageBase64,
// }
// })
}
@@ -913,22 +913,22 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
formDataa.append('blobFile', blobb);
/* console.log('add file', fileBase64) */
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": resultt.files[0].mimeType,
"guid": '',
},
attachments: [{
"title": sanitize(resultt.files[0].name),
"name": sanitize(resultt.files[0].name),
// "text": "description",
"title_link_download": false,
}],
temporaryData: formDataa,
attachmentsModelData: {
fileBase64: '',
}
})
// this.ChatSystemService.getDmRoom(roomId).send({
// file: {
// "type": resultt.files[0].mimeType,
// "guid": '',
// },
// attachments: [{
// "title": sanitize(resultt.files[0].name),
// "name": sanitize(resultt.files[0].name),
// // "text": "description",
// "title_link_download": false,
// }],
// temporaryData: formDataa,
// attachmentsModelData: {
// fileBase64: '',
// }
// })
return
}
@@ -964,22 +964,22 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
formData.append('blobFile', blob);
/* console.log('add file', fileBase64) */
this.ChatSystemService.getDmRoom(roomId).send({
file: {
"type": file.type,
"guid": '',
},
attachments: [{
"title": sanitize(fileName),
"name": sanitize(fileName),
// "text": "description",
"title_link_download": false,
}],
temporaryData: formData,
attachmentsModelData: {
fileBase64: encodedData,
}
});
// this.ChatSystemService.getDmRoom(roomId).send({
// file: {
// "type": file.type,
// "guid": '',
// },
// attachments: [{
// "title": sanitize(fileName),
// "name": sanitize(fileName),
// // "text": "description",
// "title_link_download": false,
// }],
// temporaryData: formData,
// attachmentsModelData: {
// fileBase64: encodedData,
// }
// });
} else {
this.toastService._badRequest("Ficheiro inválido")
}
@@ -1120,7 +1120,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} */
downloadFileMsg(msg: MessageService) {
downloadFileMsg(msg: any) {
msg.downloadFileMsg();
}
@@ -1387,11 +1387,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
messageDelete({messageId}) {
messageDelete(message: MessageEntity) {
// this.messageRepositoryService.sendMessageDelete()
console.log('messageId', messageId)
this.chatServiceService.messageDelete({
messageId: messageId,
messageId: message.id,
roomId: this.roomId,
})
}