This commit is contained in:
Peter Maquiran
2023-01-24 15:56:47 +01:00
parent 0748612054
commit fbd50137f3
153 changed files with 5997 additions and 953 deletions
+20 -13
View File
@@ -18,7 +18,6 @@ import { ChatMethodsService } from './chat-methods.service';
import { AESEncrypt } from '../aesencrypt.service'
import { AttachmentsService } from 'src/app/services/attachments.service';
import { NetworkServiceService} from 'src/app/services/network-service.service';
import { JsonStore } from '../jsonStore.service';
import { ViewedMessageService } from './viewed-message.service'
@Injectable({
providedIn: 'root'
@@ -97,7 +96,7 @@ export class ChatSystemService {
}
loadChat() {
if(SessionStore.user.ChatData) {
if(SessionStore.user?.ChatData?.data) {
this.ReLoadChat()
}
}
@@ -185,14 +184,18 @@ export class ChatSystemService {
async getAllRooms () {
this.loadingWholeList = true
var rooms;
try {
rooms = await this.RochetChatConnectorService.getRooms();
} catch (error) {
console.error('chatgetrooms',error)
}
if(this.RochetChatConnectorService.isLogin) {
try {
await this.storage.remove('Rooms');
} catch(e) {}
rooms = await this.RochetChatConnectorService.getRooms();
} catch (error) {
this.loadingWholeList = false
console.error('chatgetrooms',error)
}
try {
await this.storage.remove('Rooms');
} catch(e) {}
}
let index = 0
@@ -317,8 +320,12 @@ export class ChatSystemService {
this.defaultSubtribe(id)
}
this.RochetChatConnectorService.streamNotifyLogged().then((subscription=>{
this.RochetChatConnectorService.streamNotifyLogged().then((subscription => {
console.log(subscription)
}))
this.RochetChatConnectorService.subStreamMessageUser().then((subscription => {
console.log(subscription)
}))
}
@@ -407,7 +414,7 @@ export class ChatSystemService {
let roomId = this.getRoomId(roomData);
if (setData.name != 'Rocket Cat') {
if (setData.name != 'Rocket Cat' && setData.name != 'general' ) {
// create room
if(!this.roomExist(roomId)) {
let room:RoomService = new RoomService(this.RochetChatConnectorService, new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this, this.ViewedMessageService)
@@ -615,7 +622,7 @@ export class ChatSystemService {
return !roomData.fname
}
getUsers = () =>{
getUsers = () => {
return this.users
}