chat notification added

This commit is contained in:
Eudes Inácio
2023-02-02 18:24:26 +01:00
parent cc9c5a9cf5
commit f7791805f3
11 changed files with 121 additions and 39 deletions
+6 -4
View File
@@ -24,6 +24,7 @@ import { ConnectionStatus, NetworkServiceService} from 'src/app/services/network
import { ChatSystemService } from './chat-system.service';
import { ViewedMessageService } from './viewed-message.service'
import * as FIFOProcessQueue from 'fifo-process-queue';
import { NotificationsService } from '../notifications.service';
@Injectable({
providedIn: 'root'
@@ -97,7 +98,8 @@ export class RoomService {
private AttachmentsService: AttachmentsService,
private NetworkServiceService: NetworkServiceService,
private ChatSystemService: ChatSystemService,
private ViewedMessageService: ViewedMessageService
private ViewedMessageService: ViewedMessageService,
private notificationService: NotificationsService
) {
this.NativeNotificationService.askForPermission()
@@ -158,7 +160,7 @@ export class RoomService {
}
}
setData({membersExcludeMe, members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this.ChatSystemService), _updatedAt }) {
setData({membersExcludeMe, members, u, customFields = {}, id, name, t, lastMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this.ChatSystemService,this.notificationService), _updatedAt }) {
this.customFields = customFields
this.id = id
this.name = name
@@ -811,7 +813,7 @@ export class RoomService {
async prepareCreate({message, save = true}): Promise<MessageService> {
message = this.fix_updatedAt(message)
const wewMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this.ChatSystemService)
const wewMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this.ChatSystemService,this.notificationService)
wewMessage.setData(message)
wewMessage.loadHistory = this.hasLoadHistory
@@ -823,7 +825,7 @@ export class RoomService {
simplePrepareMessage(message) {
message = this.fix_updatedAt(message)
const wewMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this.ChatSystemService)
const wewMessage = new MessageService(this.NfService, this.RochetChatConnectorService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this.ChatSystemService,this.notificationService)
wewMessage.setData(message)
wewMessage.loadHistory = this.hasLoadHistory