do not show notifications for own messages

This commit is contained in:
marlon-erler
2026-09-28 16:06:51 +02:00
parent 22acf7f7d8
commit 4a6c0a20b5
6 changed files with 21 additions and 10 deletions
+14 -6
View File
@@ -2410,8 +2410,7 @@
this.updateContact(...contact);
};
this.unwrapContact = (id, knownName) => {
if (this.contacts.has(id))
return this.contacts.get(id);
if (this.contacts.has(id)) return this.contacts.get(id);
return this.updateContact(id, knownName);
};
// load
@@ -2423,7 +2422,10 @@
}
};
this.loadData();
this.contactListModel.contactHandlerManager.setHandler("contact-list-view-model", this.handleContact);
this.contactListModel.contactHandlerManager.setHandler(
"contact-list-view-model",
this.handleContact
);
}
};
var ContactViewModel = class {
@@ -2986,6 +2988,7 @@
chatMessage.status = "received" /* Received */;
this.addMessage(chatMessage);
if (chatMessage.stringifiedFile) return;
if (chatMessage.senderId == this.settingsModel.userid) return;
this.setReadStatus(true);
};
this.handleReaction = (reaction) => {
@@ -4749,7 +4752,10 @@
};
// view
this.showChatMessage = (chatMessage) => {
const contact = this.contactListViewModel.unwrapContact(chatMessage.senderId, chatMessage.senderName);
const contact = this.contactListViewModel.unwrapContact(
chatMessage.senderId,
chatMessage.senderName
);
const chatMessageViewModel = new ChatMessageViewModel(
this.coreViewModel,
this,
@@ -5017,8 +5023,9 @@
// src/ViewModel/Global/notificationViewModel.ts
var NotificationViewModel = class {
// init
constructor(chatListViewModel2) {
constructor(chatListViewModel2, settingsViewModel2) {
this.chatListViewModel = chatListViewModel2;
this.settingsViewModel = settingsViewModel2;
// data
this.seenMessageIds = /* @__PURE__ */ new Set();
this.messagesInMarquee = [];
@@ -5029,6 +5036,7 @@
this.showNotification = (message) => {
if (this.seenMessageIds.has(message.fileId)) return;
if (this.chatListViewModel.selectedChat.value == void 0) return;
if (message.senderId == this.settingsViewModel.settingsModel.userid) return;
const notification = this.createNotification(message);
const currentChat = this.chatListViewModel.selectedChat.value.chatModel.id;
const currentPage = this.chatListViewModel.selectedChat.value.selectedPage.value;
@@ -5170,7 +5178,7 @@
}
return fullChannel;
};
this.notificationViewModel = new NotificationViewModel(this);
this.notificationViewModel = new NotificationViewModel(this, this.settingsViewModel);
this.loadChats();
}
};
Vendored
+1 -1
View File
@@ -1,4 +1,4 @@
const VERSION = "2610 Beta 16"
const VERSION = "2610 Beta 17"
function processUrl(event) {
const url = event.request.url;
+1 -1
View File
@@ -1 +1 @@
2610 Beta 16
2610 Beta 17