mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
rename files
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
|
||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
||||
import { MessageService } from 'src/app/services/chat/message.service';
|
||||
import { showDateDuration } from 'src/plugin/showDateDuration';
|
||||
import { chatHistory } from 'src/app/models/chatMethod';
|
||||
@@ -22,7 +22,7 @@ import { AESEncrypt } from '../aesencrypt.service';
|
||||
import { IncomingChatMessage, ChatMessageInterface, falseTypingMethod } from 'src/app/models/message.model';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { ConnectionStatus, NetworkServiceService} from 'src/app/services/network-service.service';
|
||||
import { WsChatMethodsService } from './ws-chat-methods.service';
|
||||
import { ChatSystemService } from './chat-system.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -79,7 +79,7 @@ export class RoomService {
|
||||
chatServiceDeleteRoom = (roomId) => {}
|
||||
|
||||
constructor(
|
||||
public WsChatService: WsChatService,
|
||||
public RochetChatConnectorService: RochetChatConnectorService,
|
||||
private MessageService: MessageService,
|
||||
private storage: Storage,
|
||||
private platform: Platform,
|
||||
@@ -93,11 +93,11 @@ export class RoomService {
|
||||
private AESEncrypt: AESEncrypt,
|
||||
private AttachmentsService: AttachmentsService,
|
||||
private NetworkServiceService: NetworkServiceService,
|
||||
private wsChatMethodsService: WsChatMethodsService
|
||||
private ChatSystemService: ChatSystemService
|
||||
) {
|
||||
this.NativeNotificationService.askForPermission()
|
||||
|
||||
this.WsChatService.getUserStatus((d) => {
|
||||
this.RochetChatConnectorService.getUserStatus((d) => {
|
||||
|
||||
const userId = d.fields.args[0][0]
|
||||
const statusNum = d.fields.args[0][2]
|
||||
@@ -136,7 +136,7 @@ export class RoomService {
|
||||
}
|
||||
})
|
||||
|
||||
this.WsChatService.registerCallback({
|
||||
this.RochetChatConnectorService.registerCallback({
|
||||
type: 'Offline',
|
||||
funx: () => {
|
||||
/**
|
||||
@@ -181,7 +181,7 @@ export class RoomService {
|
||||
}
|
||||
}
|
||||
|
||||
setData({membersExcludeMe, members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), _updatedAt }) {
|
||||
setData({membersExcludeMe, members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.storage, this.NfService, this.RochetChatConnectorService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), _updatedAt }) {
|
||||
this.customFields = customFields
|
||||
this.id = id
|
||||
this.name = name
|
||||
@@ -236,15 +236,15 @@ export class RoomService {
|
||||
|
||||
if(this.t === 'p') {
|
||||
this.chatService.deleteGroup(body).subscribe(res=>{
|
||||
this.wsChatMethodsService.deleteRoom(this.id);
|
||||
this.wsChatMethodsService.getAllRooms();
|
||||
this.ChatSystemService.deleteRoom(this.id);
|
||||
this.ChatSystemService.getAllRooms();
|
||||
this.chatServiceDeleteRoom(this.id);
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.chatService.deleteChannel(body).subscribe(res=>{
|
||||
this.wsChatMethodsService.deleteRoom(this.id);
|
||||
this.wsChatMethodsService.getAllRooms();
|
||||
this.ChatSystemService.deleteRoom(this.id);
|
||||
this.ChatSystemService.getAllRooms();
|
||||
this.chatServiceDeleteRoom(this.id);
|
||||
});
|
||||
}
|
||||
@@ -261,7 +261,7 @@ export class RoomService {
|
||||
|
||||
receiveMessage() {
|
||||
|
||||
this.WsChatService.updateRoomEventss(
|
||||
this.RochetChatConnectorService.updateRoomEventss(
|
||||
this.id,
|
||||
"stream-room-messages",
|
||||
async (IncomingChatMessage:IncomingChatMessage) => {
|
||||
@@ -335,7 +335,7 @@ export class RoomService {
|
||||
}
|
||||
)
|
||||
|
||||
this.WsChatService.receiveStreamNotifyRoom((message) => {
|
||||
this.RochetChatConnectorService.receiveStreamNotifyRoom((message) => {
|
||||
|
||||
if(message.fields.eventName == this.id+'/'+'typing') {
|
||||
|
||||
@@ -446,7 +446,7 @@ export class RoomService {
|
||||
|
||||
async receiveMessageDelete() {
|
||||
|
||||
this.WsChatService.updateRoomEventss(
|
||||
this.RochetChatConnectorService.updateRoomEventss(
|
||||
this.id,
|
||||
"stream-notify-room",
|
||||
async (ChatMessage) => {
|
||||
@@ -532,14 +532,14 @@ export class RoomService {
|
||||
|
||||
if(this.NetworkServiceService.getCurrentNetworkStatus() == ConnectionStatus.Online) {
|
||||
|
||||
this.WsChatService.deleteMessage(msgId).then(async() => {
|
||||
this.RochetChatConnectorService.deleteMessage(msgId).then(async() => {
|
||||
message.delateRequest = true
|
||||
await message.save();
|
||||
this.deleteMessage(msgId);
|
||||
})
|
||||
|
||||
} else {
|
||||
this.WsChatService.registerCallback({
|
||||
this.RochetChatConnectorService.registerCallback({
|
||||
type: 'reConnect',
|
||||
funx: async ()=> {
|
||||
|
||||
@@ -609,7 +609,7 @@ export class RoomService {
|
||||
}
|
||||
|
||||
if(lastIsTyping != this.isTyping) {
|
||||
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
||||
}
|
||||
|
||||
|
||||
@@ -618,7 +618,7 @@ export class RoomService {
|
||||
}
|
||||
|
||||
sendFalseTypingReadMessage(method,param: object) {
|
||||
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', {method:method, params: param} as falseTypingMethod)
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', {method:method, params: param} as falseTypingMethod)
|
||||
this.setTypingOff()
|
||||
}
|
||||
|
||||
@@ -630,7 +630,7 @@ export class RoomService {
|
||||
|
||||
if(this.isTyping == true) {
|
||||
this.isTyping = false
|
||||
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
||||
this.RochetChatConnectorService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,7 +654,7 @@ export class RoomService {
|
||||
|
||||
|
||||
leave(rid?) {
|
||||
this.WsChatService.leaveRoom(this.id)
|
||||
this.RochetChatConnectorService.leaveRoom(this.id)
|
||||
}
|
||||
|
||||
isJson(str) {
|
||||
@@ -731,7 +731,7 @@ export class RoomService {
|
||||
|
||||
|
||||
|
||||
await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
|
||||
await this.RochetChatConnectorService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
|
||||
// console.log('load history', chatHistory)
|
||||
//
|
||||
|
||||
@@ -807,7 +807,7 @@ export class RoomService {
|
||||
message = this.fix_updatedAt(message)
|
||||
|
||||
|
||||
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||
const wewMessage = new MessageService(this.storage, this.NfService, this.RochetChatConnectorService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||
wewMessage.setData(message)
|
||||
wewMessage.loadHistory = this.hasLoadHistory
|
||||
|
||||
@@ -864,7 +864,7 @@ export class RoomService {
|
||||
async prepareCreate({message, save = true}): Promise<MessageService> {
|
||||
message = this.fix_updatedAt(message)
|
||||
|
||||
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||
const wewMessage = new MessageService(this.storage, this.NfService, this.RochetChatConnectorService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||
wewMessage.setData(message)
|
||||
wewMessage.loadHistory = this.hasLoadHistory
|
||||
|
||||
@@ -902,7 +902,7 @@ export class RoomService {
|
||||
|
||||
simplePrepareMessage(message) {
|
||||
message = this.fix_updatedAt(message)
|
||||
const wewMessage = new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||
const wewMessage = new MessageService(this.storage, this.NfService, this.RochetChatConnectorService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
|
||||
wewMessage.setData(message)
|
||||
wewMessage.loadHistory = this.hasLoadHistory
|
||||
|
||||
@@ -977,7 +977,7 @@ export class RoomService {
|
||||
}
|
||||
|
||||
sendReadMessage() {
|
||||
this.WsChatService.readMessage(this.id)
|
||||
this.RochetChatConnectorService.readMessage(this.id)
|
||||
this.sendFalseTypingReadMessage('viewMessage', {})
|
||||
this.messageUnread = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user