mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
54 lines
1.0 KiB
TypeScript
54 lines
1.0 KiB
TypeScript
import { Injectable } from '@angular/core';
|
|
import { ChatService } from '../chat.service';
|
|
import { v4 as uuidv4 } from 'uuid'
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class ChatMethodsService {
|
|
|
|
constructor(
|
|
private chatService: ChatService) {
|
|
}
|
|
|
|
sendMessage(roomId:string, data:any) {
|
|
|
|
let body = {
|
|
"message":
|
|
{
|
|
"rid": roomId,
|
|
"msg":"",
|
|
"file": {
|
|
"type": "application/meeting",
|
|
"subject": data.subject,
|
|
"start_date": data.start,
|
|
"end_date": data.end,
|
|
"venue": data.venue,
|
|
"id": data.id,
|
|
}
|
|
}
|
|
}
|
|
this.chatService.sendMessage(body).subscribe(res=> {});
|
|
}
|
|
|
|
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)
|
|
}
|
|
|
|
deleteMessage(body) {
|
|
return this.chatService.deleteMessage(body)
|
|
}
|
|
|
|
} |