Merge branches 'feature/viewer-attachment' and 'feature/viewer-attachment' of https://bitbucket.org/equilibriumito/gabinete-digital-fo into feature/viewer-attachment

This commit is contained in:
Eudes Inácio
2024-04-05 21:31:49 +01:00
15 changed files with 229 additions and 255 deletions
+4 -2
View File
@@ -6,7 +6,7 @@ import { SessionStore } from 'src/app/store/session.service';
import { capitalizeTxt } from 'src/plugin/text';
import { Update as room } from 'src/app/models/chatMethod';
import { Storage } from '@ionic/storage';
import { Platform } from '@ionic/angular';
import { ModalController, NavController, Platform } from '@ionic/angular';
import { SqliteService } from 'src/app/services/sqlite.service';
import { ChatService } from 'src/app/services/chat.service';
import { NativeNotificationService } from 'src/app/services/native-notification.service';
@@ -68,6 +68,8 @@ export class ChatSystemService {
private NetworkServiceService: NetworkServiceService,
private ViewedMessageService: ViewedMessageService,
private notificationService: NotificationsService,
private modalController: ModalController,
private navController: NavController
) {
@@ -482,7 +484,7 @@ export class ChatSystemService {
if (setData.name != 'Rocket Cat' && setData.name != 'general' && chat == false) {
// 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.notificationService), 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, this.notificationService)
let room: RoomService = new RoomService(this.RochetChatConnectorService, new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this, this.notificationService), 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, this.notificationService,this.modalController,this.navController)
room.setData(setData)
room.receiveMessage()
room.getAllUsers = this.getUsers
+11 -2
View File
@@ -4,7 +4,7 @@ import { MessageService, MessageServiceDateLabel } from 'src/app/services/chat/m
import { showDateDuration } from 'src/plugin/showDateDuration';
import { chatHistory } from 'src/app/models/chatMethod';
import { Storage } from '@ionic/storage';
import { Platform } from '@ionic/angular';
import { ModalController, NavController, Platform } from '@ionic/angular';
import { SqliteService } from 'src/app/services/sqlite.service';
import { NativeNotificationService } from 'src/app/services/native-notification.service';
import { SessionStore } from 'src/app/store/session.service';
@@ -101,7 +101,9 @@ export class RoomService {
private NetworkServiceService: NetworkServiceService,
private ChatSystemService: ChatSystemService,
private ViewedMessageService: ViewedMessageService,
private notificationService: NotificationsService
private notificationService: NotificationsService,
private modalController: ModalController,
private navController: NavController
) {
/* this.NativeNotificationService.askForPermission() */
@@ -219,6 +221,9 @@ export class RoomService {
if (difference < 0) {
this.deleteRoom();
if(this.chatOpen && window.location.pathname.includes('chat')) {
this.closeModal()
}
} else {
setTimeout(() => {
@@ -1287,4 +1292,8 @@ export class RoomService {
this.members = members
this.membersExcludeMe = users
}
async closeModal() {
await this.modalController.dismiss();
}
}
@@ -1,5 +1,4 @@
import { Injectable } from '@angular/core';
import { PublicationFormMV } from 'src/app/shared/publication/upload/upload-streaming.service';
@Injectable({
providedIn: 'root'
@@ -151,6 +151,7 @@ class ReconnectingWebSocketSignalR {
console.log('committing')
return new Promise((resolve, reject) => {
if(this.isOpen) {
console.log('open')
try {
console.log('this.connection.invoke', this.connection)
this.connection.invoke("CommitUpload", path).then((e) => {
@@ -168,6 +169,7 @@ class ReconnectingWebSocketSignalR {
}
} else {
console.log('wait')
this.onConnect.push(()=> {
resolve(this.commit(path))
})