mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -22,6 +22,7 @@ import { IncomingChatMessage, ChatMessageInterface, falseTypingMethod } from 'sr
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { ConnectionStatus, NetworkServiceService} from 'src/app/services/network-service.service';
|
||||
import { ChatSystemService } from './chat-system.service';
|
||||
import { ViewedMessageService } from './viewed-message.service'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -94,7 +95,8 @@ export class RoomService {
|
||||
private AESEncrypt: AESEncrypt,
|
||||
private AttachmentsService: AttachmentsService,
|
||||
private NetworkServiceService: NetworkServiceService,
|
||||
private ChatSystemService: ChatSystemService
|
||||
private ChatSystemService: ChatSystemService,
|
||||
private ViewedMessageService: ViewedMessageService
|
||||
) {
|
||||
this.NativeNotificationService.askForPermission()
|
||||
|
||||
@@ -104,37 +106,8 @@ export class RoomService {
|
||||
const statusNum = d.fields.args[0][2]
|
||||
const statusText = this.statusNumberToText(statusNum)
|
||||
|
||||
if(this.membersExcludeMe?.map) {
|
||||
const membersIds = this.membersExcludeMe.map((user)=> user._id)
|
||||
this.ViewedMessageService.request(this, userId, statusNum, statusText)
|
||||
|
||||
if(membersIds.includes(userId)) {
|
||||
|
||||
if(statusText != 'offline') {
|
||||
this.deleteMessageToReceive(userId)
|
||||
}
|
||||
|
||||
this.messages.forEach((message, index) => {
|
||||
if(!message.messageOwnerById(userId)) {
|
||||
|
||||
if(!this.messages[index]?.received?.includes(userId)) {
|
||||
|
||||
|
||||
if(this.messages[index]._id) {
|
||||
try {
|
||||
if(!this.messages[index].received.includes(userId)) {
|
||||
this.messages[index].received.push(userId)
|
||||
}
|
||||
} catch(e) {
|
||||
this.messages[index].received = [userId]
|
||||
}
|
||||
this.messages[index].save()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
this.RochetChatConnectorService.registerCallback({
|
||||
|
||||
Reference in New Issue
Block a user