2021-12-22 10:31:10 +01:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
|
import { ChatService } from '../chat.service';
|
2022-03-04 14:20:39 +01:00
|
|
|
import { v4 as uuidv4 } from 'uuid'
|
2021-12-22 10:31:10 +01:00
|
|
|
|
|
|
|
|
@Injectable({
|
|
|
|
|
providedIn: 'root'
|
|
|
|
|
})
|
|
|
|
|
export class ChatMethodsService {
|
|
|
|
|
|
2022-02-08 17:44:15 +01:00
|
|
|
constructor(
|
|
|
|
|
private chatService: ChatService) {
|
2021-12-22 10:31:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sendMessage(roomId:string, data:any) {
|
|
|
|
|
|
|
|
|
|
let body = {
|
|
|
|
|
"message":
|
|
|
|
|
{
|
|
|
|
|
"rid": roomId,
|
|
|
|
|
"msg":"",
|
2022-03-04 14:20:39 +01:00
|
|
|
"file": {
|
2021-12-22 10:31:10 +01:00
|
|
|
"type": "application/meeting",
|
|
|
|
|
"subject": data.subject,
|
|
|
|
|
"start_date": data.start,
|
|
|
|
|
"end_date": data.end,
|
|
|
|
|
"venue": data.venue,
|
|
|
|
|
"id": data.id,
|
2023-01-24 15:56:47 +01:00
|
|
|
"calendarId": data.calendarId
|
2021-12-22 10:31:10 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.chatService.sendMessage(body).subscribe(res=> {});
|
|
|
|
|
}
|
2022-03-04 14:20:39 +01:00
|
|
|
|
|
|
|
|
send({roomId, msg, attachments = null, file = null, localReference = null}) {
|
|
|
|
|
|
|
|
|
|
let body = {
|
|
|
|
|
"message":
|
|
|
|
|
{
|
|
|
|
|
rid: roomId,
|
|
|
|
|
localReference: localReference,
|
|
|
|
|
msg: msg,
|
|
|
|
|
attachments,
|
|
|
|
|
file
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return this.chatService.sendMessage(body)
|
|
|
|
|
}
|
2022-03-15 15:49:59 +01:00
|
|
|
|
|
|
|
|
deleteMessage(body) {
|
|
|
|
|
return this.chatService.deleteMessage(body)
|
|
|
|
|
}
|
2022-03-04 14:20:39 +01:00
|
|
|
|
|
|
|
|
}
|