Skip to content

Commit 05d92cd

Browse files
committed
Fix incorrect chat grouping of Discord messages
What: Prevents Discord messages from different users that are sent within a minute of each other from being grouped together under the first user that sends a message by also checking the name given for the sender instead of just the sender's id. This mostly ensures that all chat messages are attributed to the correct user. Why: Users in Hubs can have the same name so the chat messages are grouped by a sender id, but because all the messages from Discord come through the Discord bot, the sender id is the same for all of them regardless of who sent them in Discord. Note: this will still group messages improperly if the Discord users have the same display name in the Discord server but preventing that would likely require much more extensive and broad reaching changes (probably in reticulum and the Hubs Discord bot repository as well) and it would do little to reduce confusion.
1 parent 69405e1 commit 05d92cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/react-components/room/contexts/ChatContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function shouldCreateNewMessageGroup(messageGroups: NewMessageT[], newMessage: N
3030

3131
const lastMessageGroup = messageGroups[messageGroups.length - 1];
3232

33-
if (lastMessageGroup.senderSessionId !== newMessage.sessionId) {
33+
if (lastMessageGroup.senderSessionId !== newMessage.sessionId || lastMessageGroup.sender !== newMessage.name) {
3434
return true;
3535
}
3636
if (lastMessageGroup.type !== newMessage.type) {

0 commit comments

Comments
 (0)