42wim / matterircd

Connect to your mattermost or slack using your IRC-client of choice.
MIT License
294 stars 60 forks source link

'ACTION ...' shown to others when typing '/me ...' quickly after a message #367

Closed jdstrand closed 3 years ago

jdstrand commented 3 years ago

Reproducer:

In irssi, if I type quickly:

blah blah
/me ...

then others see (eg, matterhorn, web client):

<nick> blah blah
ACTION ...

but if I wait to type /me ... for a few seconds, then it is correctly displayed to others.

This was seen with 0.21.0 and 0.22.0.

42wim commented 3 years ago

I guess you have PasteBufferTimeout configured ? If you're not going to paste stuff set to 0 otherwise set to a number that matches your typespeed or type slower ;-)

See https://github.com/42wim/matterircd/blob/master/matterircd.toml.example#L34

jdstrand commented 3 years ago

I do have it set to 'PasteBufferTimeout = 2500' which is set so I can paste stuff. However, regardless of how that is set, it seems odd that I get the unicode characters and ACTION when it sees '/me ...' and that this would be a detectable condition, but perhaps I am missing something?

42wim commented 3 years ago

So if you have it set to 0 you still have the same issue?

jdstrand commented 3 years ago

To specifically answer your question, no, it doesn't happen with PasteBufferTimeout = 0 and sure I can workaround it with that setting.

However I would like the be able to continue to use the PasteBufferTimeout and not have 'ACTION ...' as part of the output for others since that isn't what I entered-- I only entered ascii during the period and not the text, 'ACTION'. I haven't looked at the code, but it seems possible to detect a '\n/slashcommand' during the PasteBufferTimeout and to do something with that information.

hloeung commented 3 years ago

FWIW, can reproduce this with setting a large enough PasteBufferTimeout.

huBUTPnIzi

Would be nice to detect '\x01ACTION' in user.Decode() and break up the message into multiples (timer.Stop()?). Sadly, I'm not sure how to (easily?) implement that with the current code base.

42wim commented 3 years ago

fixed in master

jdstrand commented 3 years ago

Thanks! :)