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

 
 

task #10881: /filter - substitution option

Submitter:  Christopher O'Neill <deltafire>
Submitted:  Tue 18 Jan 2011 10:42:28 PM UTC
Votes: 20
 
Category:  display Should Start On:  Tue 18 Jan 2011 12:00:00 AM UTC
Should be Finished on:  Tue 18 Jan 2011 12:00:00 AM UTC Priority:  * 5 - Normal
Status:  None Privacy:  Public
Assigned to:  flashcode Percent Complete:  0%
Originator Name:  Open/Closed:  Open
Planned Release:  None IRC nick: 
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group administrator
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>
Group administrator
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:

-- xxx.xxxx.net (xxx.xxxx.net): *** Notice --

and:

!bopm@xxx.xxxx.net{xxx.xxxx.net} added temporary 60 min. K-Line for [

and finally:

] [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)]


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 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>
Group administrator
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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 20 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-07-28 sal9000 Carbon-Copy- Added sal9000
    2011-08-22 flashcode StatusNeed Info None
    2011-04-07 arza Carbon-Copy- Added arza
    2011-02-03 fixato Carbon-Copy- Added fixato
    2011-01-19 flashcode CategoryNone display
        StatusNone Need Info
        Assigned toNone flashcode

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code