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
+23 -7
View File
@@ -275,18 +275,25 @@ export class RoomService {
if(message.fields.eventName == this.id+'/'+'typing') {
const args = message.fields.args
if (typeof args[1] != 'object') {
this.userThatIsTyping = this.usernameToDisplayName(args[0])
this.isTyping = args[1]
this.otherUserType = args[1]
this.readAllMessage()
const user = args[0]
if(SessionStore.user.UserName != user) {
this.readAllMessage()
}
} else if(args[0]?.method == 'viewMessage' || args[1]?.method == 'viewMessage') {
this.readAllMessage()
const user = args[0]
if(SessionStore.user.UserName != user) {
this.readAllMessage()
}
} else if(args[0]?.method == 'deleteMessage' || args[1]?.method == 'deleteMessage') {
this.deleteMessage(args[1]?.method?._id)
@@ -295,7 +302,6 @@ export class RoomService {
}
} else if (message.fields.eventName == this.id+'/'+'deleteMessage') {}
})
@@ -313,6 +319,7 @@ export class RoomService {
if(!found) {
ChatMessage.origin = 'stream'
const message = await this.prepareCreate({message: ChatMessage, save: true});
this.registerSendMessage(message)
@@ -445,7 +452,13 @@ export class RoomService {
"stream-notify-room",
async (ChatMessage) => {
const DeletedMessageId = ChatMessage.fields.args[0]._id;
this.deleteMessage(DeletedMessageId)
const message = this.messages.find((e) => e._id == DeletedMessageId)
if(message.delate == false) {
this.deleteMessage(DeletedMessageId)
}
}
)
}
@@ -556,7 +569,8 @@ export class RoomService {
attachments,
file,
temporaryData,
localReference
localReference,
origin: 'local'
}
this.message= ''
@@ -657,6 +671,7 @@ export class RoomService {
// this.typing(this.message)
this.chatOpen = true
this.messageUnread = false
this.sendReadMessage()
}
@@ -737,6 +752,7 @@ export class RoomService {
for(let message of chatHistory.result.messages.reverse()) {
if (!messagesId.includes(message._id)) {
message.origin = 'history'
const messagesToSave = await this.prepareMessageCreateIfNotExist({message: message});
if(messagesToSave != null) {