remove un used import

This commit is contained in:
Peter Maquiran
2023-06-22 12:53:35 +01:00
parent f849610b8c
commit 6ea40ab55f
37 changed files with 289 additions and 324 deletions
+29
View File
@@ -0,0 +1,29 @@
import { ChatSystemService } from "../services/chat/chat-system.service";
export class ChatController {
static ChatSystemService: ChatSystemService
static async createGroup(name) {
let data: any = await this.ChatSystemService.createGroup(name)
if(data?.error?.error == 'error-invalid-room-name') {
name = name.slice(0, 12)
data = await this.ChatSystemService.createGroup(name)
return {
data,
roomName: name
}
}
return {
data,
roomName: name
}
}
static async createOrFindGroup(name) {
let data: any = await this.createGroup(name)
}
}
+48
View File
@@ -0,0 +1,48 @@
import { chatUser } from '../models/chatMethod'
import { ChatController } from './chat'
export class EventController {
static create() {
}
static edit() {
}
static async createOrFindGroupFromEvent(name, attendees) {
// chatController.
const {data, roomName} = await ChatController.createGroup(name)
const roomId = data.rid
if (data.error.error == "error-duplicate-channel-name") {
const getGroupByName = ChatController.ChatSystemService.getGroupByName(roomName)
if(getGroupByName) {
return getGroupByName
}
} else if (roomId) {
const room = await ChatController.ChatSystemService.waitRoomToCreate(roomId)
const chatUsers: chatUser[] = []
for (let webTRIXUser of attendees ) {
const username = webTRIXUser.EmailAddress.split("@")[0];
const name = webTRIXUser.Name
const findChatUser = ChatController.ChatSystemService.searchContact(name, username)
if(findChatUser) {
chatUsers.push(findChatUser)
}
}
for (let chatUser of chatUsers) {
room.addContacts(chatUser._id)
}
return room
}
}
}
+3
View File
@@ -0,0 +1,3 @@
export class DispatchController {
}