mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
remove un used import
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user