tuna / fishroom

Message forwarding for multiple IM protocols
GNU General Public License v3.0
289 stars 58 forks source link

Configurable filters for reply-quote text in IRC #23

Open Artoria2e5 opened 8 years ago

Artoria2e5 commented 8 years ago

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...

bigeagle commented 8 years ago

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

Cheers,

Artoria2e5 commented 8 years ago

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.

bigeagle commented 8 years ago

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 commented 8 years ago

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

Artoria2e5 commented 8 years ago
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.

bigeagle commented 8 years ago

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

Artoria2e5 commented 8 years ago

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.

bigeagle commented 8 years ago

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

Artoria2e5 commented 8 years ago

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

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