fishroom icon indicating copy to clipboard operation
fishroom copied to clipboard

Configurable filters for reply-quote text in IRC

Open Artoria2e5 opened this issue 8 years ago • 9 comments

On #archlinux-cn, the results of replying to someone can be highly annoying, if the replied message contains a command, e.g. 'google (varia bot).

It would be great if users can supply functions to filter the thing...

Artoria2e5 avatar Apr 01 '16 16:04 Artoria2e5

Hmm, give an example? that what kind of reply message format is better, so that I can implement it.

Cheers,

bigeagle avatar Apr 02 '16 04:04 bigeagle

I am not asking for a better format, just some filter that can avoid generation of bot commands.

For example, s/'([a-z])/’\1/g should be used on archlinux_cn.

Artoria2e5 avatar Apr 02 '16 18:04 Artoria2e5

I don't understand. On what situation you wanna filter bot commands? Filter IRC commands' appearance in fishroom or what? Give me an example of the message flow. like this:

A: 'google something
gbot: blahblahblah

and A's message shouldn't appear in fishroom.

bigeagle avatar Apr 03 '16 03:04 bigeagle

u can give me screenshots or whatever, just point out, which message, on which direction (e.g. irc to tg) should be filtered.

bigeagle avatar Apr 03 '16 03:04 bigeagle

0001 a@tg: 'google foo
0002 varia@irc: <results for foo>
0003 b@tg: <reply msg 0001> blah
irc-> [b]: (a 'google foo...) blah
0004 varia@irc: <results for foo...) blah>

And everyone is unhappy.

Artoria2e5 avatar Apr 03 '16 15:04 Artoria2e5

but why ^(Re: a 'google foo) could trigger varia

bigeagle avatar Apr 03 '16 15:04 bigeagle

Because varia matches for commands all through the text. I think the author did that in order to make sure that bridge-bot users can use the bot.

Actually, as a tg-bridge user myself, I use varia to trigger smbot and other IRC bots.

Artoria2e5 avatar Apr 03 '16 17:04 Artoria2e5

This kind of substitution would cause "quote injection", maybe tomorrow someone would compain about why the quote was substituted.

bigeagle avatar Apr 03 '16 17:04 bigeagle

Write some config options to accept functions (perfectly valid in py) and let them 撕逼.

In the end they will write a varia command matcher...

Artoria2e5 avatar Apr 03 '16 17:04 Artoria2e5