shazow / ssh-chat

Chat over SSH.
https://shazow.net/posts/ssh-how-does-it-even/
MIT License
5.59k stars 408 forks source link

bot: Don't include emoji prefixes in DMs #414

Closed shazow closed 2 years ago

shazow commented 2 years ago

Right now TERM=bot successfully avoids including name prefixes in public contexts, but DMs to a bot still include prefixes.

Reproduce:

$ TERM=bot ssh somebot@...
<have someone with an emoji prefix DM the bot, e.g. /msg somebot hi>
<observe incoming message came with an emoji prefix, it shouldn't>

Change is probably around here: https://github.com/shazow/ssh-chat/blob/68e9d6880df569fc6d0da071814d494db54fb51e/chat/message/message.go#L194

Should probably use user.ID() when t == nil, but need to test this. (Might need to update in other places too.)