This is an old revision of the document!


Internals: tools.pl

This module provides various tools for Sympa.

checkcommand()

Checks for no command in the body of the message. If there are some command in it, it returns true and sends a message to $sender by calling List::send_global_file() (see list-send-global-file, page [*]) with mail template message_report.

IN:

  1. msg(+): ref(MIME::Entity) - the message to check
  2. sender(+): the message sender
  3. robot(+): robot

OUT:

  • 1 if there are some command in the message
  • 0 else

get_array_from_splitted_string()

Return an array made from a string splitted by ','. It removes spaces.

IN: string(+): string to split

OUT: ref(ARRAY) -

diff_on_arrays()

Makes set operation on arrays seen as set (with no double):

IN:

  1. A(+): ref(ARRAY) - set
  2. B(+): ref(ARRAY) - set

OUT: ref(HASH) with keys:

  • deleted: A B
  • added: B A
  • intersection: A B
  • union: A B

clean_msg_id()

Cleans a msg_id to use it without '
n', '
s', < and >.

IN: msg_id(+): the message id

OUT: the clean msg_id

clean_email()

Lower-case it and remove leading and trailing spaces.

IN: msg_id(+): the email

OUT: the clean email

make_tt2_include_path()

Make an array of include path for tt2 parsing

IN:

  1. robot(+): SCALAR - the robotset
  2. dir: SCALAR - directory ending each path
  3. lang: SCALAR - for lang directories
  4. list: ref(List) - for list directory

OUT: ref(ARRAY) - include tt2 path, respecting path priorities.

  • internals/internals-tools.1165828964.txt.gz
  • Last modified: 2018/03/29 03:48
  • (external edit)