Closed medinae closed 4 years ago
Hiya, thanks for this! Are you certain this doesn't break anything else?
Also we need to fix /ignore with the other kinds of messages, like PrivateMsg. Ideally the fix would apply across the board. :)
Hello, Tests are passing and as you can see in the PR description, everything related to emote is OK.
For the second part of our answer, you mean we have the same issue with emote and private msgs? Shouldn't we do it in another PR?
@shazow Private msg fixed as well. Please review. Also, please check the PR description.
That's great, thank you!
My only concern is the (in)validity of this comment: https://github.com/shazow/ssh-chat/pull/349/files#diff-927aa726acccc0fd011d2817854c3452L141-L143
I'm going to take some time making sure it's not going to break in unexpected ways and then merge it, otherwise it looks good. :)
Yes make sense. ''To allow the sender to see the emote'' is curious. But I roughly tested it, and in particular that part. Works well.
Yeah would be nice if you double check. Let me know. Thanks.
I think my plan was to use the From()
interface to differentiate between private and public messages, but I don't see any code that actually does that (maybe it was removed?). Would suck if private messages leak with this change so I'm trying to be extra careful. :)
but I don't see any code that actually does that
Yep, haven't found a specific usage either.
Hm, the test is failing for me locally (I think travisci is borked):
$ make test
go test -race -test.timeout 5s ./...
ok github.com/shazow/ssh-chat (cached)
--- FAIL: TestIgnore (0.00s)
room_test.go:119: Got: "** user1 crying\r\n"; Expected: "user1: hello\r\n"
room_test.go:156: test is broken
FAIL
I'll check today. Probably something to fix in the tests.
Yea, that whole test could use a simpler rewrite.
I found the broken part of the test on my end. Will merge shortly.
The "crying" emote was rendering for the other user whose screen buffer was compared later with a different string, so I added a flush of that before.
Strange that it's not failing for you, wonder if it's running the wrong codebase? What version of Go are you using?
Before
After