taskWeeChat - Tasks: task #10881, /filter - substitution option

 
 

task #10881: /filter - substitution option

Submitted by:  Christopher O'Neill <deltafire>
Submitted on:  Tue 18 Jan 2011 10:42:28 PM UTC  
Votes:  35  
 
Category: displayShould Start On: Tue 18 Jan 2011 12:00:00 AM UTC
Should be Finished on: Tue 18 Jan 2011 12:00:00 AM UTCPriority: 5 - Normal
Status: NonePrivacy: Public
Percent Complete: 0%Assigned to: Sebastien Helleu <flashcode>
Originator Name: Open/Closed: Open
Planned Release: NoneIRC nick: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Mon 22 Aug 2011 09:37:50 AM UTC, comment #8:

Would be great to add this possibility, as said by deltafire cool functions could be added. rmodifier is different in a way it does not allow to come back to the original message.

eg. curious filter nick.
/filter add ignore * * nick\t s/.*//

toggle long lines (here more than 50 char)
/filter add longline * * * s/(.{50}).*/\1/

filter badwords
/filter add badword * * badword s/badword/☠☠☠/

undeline words
/filter add keyword * * keyword s/keyword/[color/bold/underline]keyword/

As discussed in the channel, it would be great also to add command triggers (maybe an other command than filter)

eg. spam detection
/filter add spamfilter * * spam @print XYbuffer "spam detected"

Anonymous
Mon 22 Aug 2011 09:09:01 AM UTC, comment #7:

Finally, I think it's better to improve filters (and not do that in rmodifiers), since filter already has needed info to select lines: list of buffers, tags, regex.

The default action of a filter would be "hide line", and another action would be "change line", using another regex.

And last thing, format of filters in config file could be improved to have real options for filters. So that a filter option could be modifier with /set (no need to remove/add filter to change something).

Sebastien Helleu <flashcode>
Project AdministratorIn charge of this item.
Thu 18 Aug 2011 05:58:03 AM UTC, comment #6:

Then maybe rmodifier could be improved. Please open another task for that if you want something new in rmodifier, I'll close this one.

Sebastien Helleu <flashcode>
Project AdministratorIn charge of this item.
Wed 17 Aug 2011 11:32:26 PM UTC, comment #5:

I think comment #2 already answers comments #3 and #4:

I've experimented a bit with /rmodifier, it almost does what I want but not quite. It appears to allow matched expressions to be nullified, censored or left as is; it does not allow the the format or content to be altered.

Christopher O'Neill <deltafire>
Thu 03 Feb 2011 08:38:04 PM UTC, comment #4:

Darn, I miss a preview or edit option on Savannah..

Deltafire: If I look at your example, shouldn't it be possible to achieve that by nullifying expressions? I mean, basically you are looking at nullifying:
and:
and finally:

Granted, that could perhaps be achieved in a nicer way.

Filip H.F. "FiXato" Slagter <fixato>
Thu 03 Feb 2011 08:36:21 PM UTC, comment #3:

Deltafire: If I look at your example, shouldn't it be possible to achieve that by nullifying expressions? I mean, basically you are looking at nullifying:
+++verbose+++
-- xxx.xxxx.net (xxx.xxxx.net): *** Notice --
---verbose---
and:
+++verbose+++
!bopm@xxx.xxxx.net{xxx.xxxx.net} added temporary 60 min. K-Line for [
---verbose---
and finally:
+++verbose+++
] [Temporary K-line 60 min. - You're listed on an IP blacklist. Please visit http://www.xxxxx.net/rbl.php for more information. (ip=61.160.83.138&network=XxxxNet (2011/1/23 18.11)]
---verbose---

Granted, that could perhaps be achieved in a nicer way.

Filip H.F. "FiXato" Slagter <fixato>
Sun 23 Jan 2011 05:24:19 PM UTC, comment #2:

I've experimented a bit with /rmodifier, it almost does what I want but not quite. It appears to allow matched expressions to be nullified, censored or left as is; it does not allow the the format or content to be altered.

The situation is I get sent lengthy messages from the server, for example:

17:11 EN -- xxx.xxxx.net (xxx.xxxx.net): *** Notice -- BOPM!bopm@xxx.xxxx.net{xxx.xxxx.net} added temporary 60 min. K-Line for [*@61.160.83.138] [Temporary K-line 60 min. - You're listed on an IP blacklist. Please visit http://www.xxxxx.net/rbl.php for more information. (ip=61.160.83.138&network=XxxxNet (2011/1/23 18.11)]

There is much redundant information here, what I'd like to actually see is:

17:11 EN BOPM *@61.160.83.138

Or similar. Obviously I could write a script to do this (which is what I had in irssi), but the /filter and /rmodifier commands are almost there.

Let me know what you think, if this is beyond the scope of /rmodifier then just close this task and I'll write a script for it instead :)

Christopher O'Neill <deltafire>
Wed 19 Jan 2011 07:15:55 AM UTC, comment #1:

For me, such task should not be done by /filter, which is just a filter to hide lines.

To change lines with regex, look at rmodifier plugin, it's purpose of this plugin: use regex to change content of modifier messages.
Try /help rmodifier
It was primarly designed to hide password displayed in input, but I think it can work to modify any message displayed.

If you agree, I'll close this task.

Sebastien Helleu <flashcode>
Project AdministratorIn charge of this item.
Tue 18 Jan 2011 10:42:28 PM UTC, original submission:

It would be very useful if instead of just dropping matched items, /filter could perform a reg-ex substitution on them instead. I'd like to use this to filter lengthy server messages into something more space efficient, but I'd imagine this would have plenty of other uses too.

Christopher O'Neill <deltafire>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by sal9000 (Voted in favor of this item)
  • -unavailable- added by arza (Voted in favor of this item)
  • -unavailable- added by fixato (Posted a comment)
  • -unavailable- added by fixato (Voted in favor of this item)
  • -unavailable- added by flashcode (Posted a comment)
  • -unavailable- added by deltafire (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 35 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 28 Jul 2012 06:42:33 AM UTCsal9000Carbon-Copy-=>Added sal9000
    Mon 22 Aug 2011 09:09:01 AM UTCflashcodeStatusNeed Info=>None
    Thu 07 Apr 2011 06:27:56 PM UTCarzaCarbon-Copy-=>Added arza
    Thu 03 Feb 2011 08:36:21 PM UTCfixatoCarbon-Copy-=>Added fixato
    Wed 19 Jan 2011 07:15:55 AM UTCflashcodeCategoryNone=>display
      StatusNone=>Need Info
      Assigned toNone=>flashcode

    Back to the top


    Powered by Savane 3.1-cleanup