notice actions

I'm trying to come up with a way to add the code to make it possible to determine which notice policy item added an action to a notice and I'm running into some trouble.

My initial thought was to make the set of notices actions turn into a table yielding a set of counts. Like this...

    ## The actions that are to be applied to this notice. The set[count]
    ## is to indicate which :bro:id:`Notice::policy` items
    ## triggered the action being added to the notice.
    actions: table[Notice::Action] of set[count] &log &optional;

The problem with this is that tables aren't loggable. I also though about using a multiply keyed index for the set, but that doesn't work either because I need to be able to check for action membership in each of the action plugins (that actually does the action). I'm just not coming up with any good solutions unfortunately and I'm getting the feeling we're going to have to hack this in.

  .Seth

Is it sufficient to record just the notice item but not the action
type? Then you could do just set[count].

Or you do the table but manually turn it into a string for logging.

Robin

Is it sufficient to record just the notice item but not the action
type? Then you could do just set[count].

You wouldn't be able to do the membership checks anymore. They're done like this now...

  if ( ACTION_EMAIL in n$actions )
    email_notice_to(n, mail_dest, T);

Or you do the table but manually turn it into a string for logging.

Yeah, I thought of that. It just feels really hacky and I've trying to avoid things that feel hacky. :slight_smile:

  .Seth