NAME

FTN::Crypt::Msg - Message parsing for the FTN::Crypt module.

SYNOPSIS

use FTN::Crypt::Msg;

my $obj = FTN::Crypt::Msg->new(
    Address => $ftn_address,
    Message => $msg,
);
$obj->add_kludge('ENC: PGP5');
$obj->remove_kludge('ENC');
my $text = $obj->get_text;
my $kludges = $obj->get_kludges;
my $msg = $obj->get_message;

METHODS

new()

Constructor.

Parameters:

  • Address: Recipient's FTN address.

  • Message: FTN message text with kludges.

Returns:

Created object or error in FTN::Crypt::Msg->error.

Sample:

my $obj = FTN::Crypt::Msg->new(
    Address => $ftn_address,
    Message => $msg,
) or die FTN::Crypt::Msg->error;

add_kludge()

Add kludge to the message.

Parameters:

  • Kludge string.

  • Optional [TOP|BOTTOM|<index]> Kludges block, defaults to TOP.

Returns:

True or error in $obj->error.

Sample:

$obj->add_kludge('ENC: PGP5') or die $obj->error;

remove_kludge()

Remove kludge from the message.

Parameters:

  • Kludge string, may be only the first part of the composite kludge.

  • Optional [TOP|BOTTOM|<index]> Kludges block, defaults to TOP.

Returns:

True or error in $obj->error.

Sample:

$obj->remove_kludge('ENC') or die $obj->error;

get_kludges()

Get message kludges.

Parameters:

None.

Returns:

Arrayref with kludges list or error in $obj->error.

Sample:

$obj->get_kludges() or die $obj->error;

get_address()

Get recipient's FTN address.

Parameters:

None.

Returns:

Recipient's FTN address or error in $obj->error.

Sample:

my $ftn_address = $obj->get_address() or die $obj->error;

set_address()

Set recipient's FTN address.

Parameters:

  • Recipient's FTN address.

Returns:

True or error in $obj->error.

Sample:

$obj->set_address($ftn_address)

get_text()

Get text part of the message.

Parameters:

  • Optional [TOP|BOTTOM|<index]> Text block, defaults to BOTTOM.

Returns:

Text part of the message or error in $obj->error.

Sample:

my $text = $obj->get_text() or die $obj->error;

get_all_text()

Get all text parts of the message.

Parameters:

None.

Returns:

Arrayref with text parts of the message or error in $obj->error.

Sample:

my $text = $obj->get_all_text() or die $obj->error;

set_text()

Set text part of the message.

Parameters:

  • Text part of the message.

  • Optional [TOP|BOTTOM|<index]> Text block, defaults to BOTTOM.

Returns:

True or error in $obj->error.

Sample:

$obj->set_text($text) or die $obj->error;

get_message()

Get FTN message text with kludges.

Parameters:

None.

Returns:

FTN message text with kludges or error in $obj->error.

Sample:

my $msg = $obj->get_message() or die $obj->error;

set_message()

Set FTN message text with kludges.

Parameters:

  • FTN message text with kludges.

Returns:

True or error in $obj->error.

Sample:

$obj->set_message($msg) or die $obj->error;

AUTHOR

Petr Antonov, <pietro@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2019 by Petr Antonov

This library is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses at https://opensource.org/licenses/Artistic-1.0, and http://www.gnu.org/licenses/gpl-2.0.html.

This package is provided "as is" and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose.