Skip to content

Commit 3bb989a

Browse files
committed
Fix personal notes chat handling to exclude own messages from styling
1 parent 3470ff8 commit 3bb989a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Resources/Views/main.leaf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,13 @@
11651165
messageDiv.dataset.messageId = message.id;
11661166
}
11671167

1168-
const isOwnMessage = currentUser && message.authorId && message.authorId === currentUser.info.id;
1168+
const chat = chats.find(c => c.id === currentChatId);
1169+
1170+
// Check if this is a personal notes chat (chat with oneself)
1171+
const otherUser = chat?.isPersonal ? chat.allUsers.find(user => user.id !== currentUser?.info.id) : null;
1172+
const isPersonalNotesChat = chat?.isPersonal && (!otherUser || otherUser.id === currentUser?.info.id);
1173+
1174+
const isOwnMessage = currentUser && message.authorId && message.authorId === currentUser.info.id && !isPersonalNotesChat;
11691175
if (isOwnMessage) {
11701176
messageDiv.classList.add('own');
11711177
}
@@ -1181,7 +1187,6 @@
11811187
}
11821188

11831189
// Find author info
1184-
const chat = chats.find(c => c.id === currentChatId);
11851190
const author = chat?.allUsers.find(user => user.id === message.authorId);
11861191
const authorName = author ? author.name : 'Unknown';
11871192
const authorInitials = author ? getInitials(author.name) : '?';

0 commit comments

Comments
 (0)