# ====================================================
# Autor: n.d.p. / 2001-01-07
-# lm : n.d.p. / 2001-01-08
+# lm : n.d.p. / 2001-02-25
# ====================================================
# Funktion:
# * Schnittstellen fuer den Zugriff auf Messages
package Posting::_lib;
-use vars qw(@ISA @EXPORT_OK);
+use vars qw(@EXPORT_OK);
+use base qw(Exporter);
use Encode::Plain; $Encode::Plain::utf8 = 1;
# Funktionsexport
# ====================================================
-require Exporter;
-@ISA = qw(Exporter);
@EXPORT_OK = qw(get_message_header get_message_body get_message_node parse_single_thread
hr_time short_hr_time long_hr_time
get_all_threads
# Messagebody auslesen
###########################
-sub get_message_body ($$) {
- my ($xml,$mid) = @_;
+sub get_message_body ($$)
+{
+ my ($xml, $mid) = @_;
my $body;
- foreach ($xml -> getElementsByTagName ('ContentList', 1) -> item (0) -> getElementsByTagName ('MessageContent', 0)) {
- if ($_ -> getAttribute ('mid') eq $mid) {
+ foreach ($xml -> getElementsByTagName ('ContentList', 1) -> item (0) -> getElementsByTagName ('MessageContent', 0))
+ {
+ if ($_ -> getAttribute ('mid') eq $mid)
+ {
$body = ($_ -> hasChildNodes)?$_ -> getFirstChild -> getData:'';
- last;}}
+ last;
+ }
+ }
\$body;
}
$message -> setAttribute ('flag', 'deleted') if ($msg -> {deleted});
# Header erzeugen
- my $header = $xml -> createElement ('Header');
+ my $header = $xml -> createElement ('Header');
# alles inside of 'Header'
my $author = $xml -> createElement ('Author');
- my $name = $xml -> createElement ('Name');
- $name -> addText (toUTF8($msg -> {name}));
- my $email = $xml -> createElement ('Email');
+ my $name = $xml -> createElement ('Name');
+ $name -> addText (toUTF8($msg -> {name}));
+
+ my $email = $xml -> createElement ('Email');
my $category = $xml -> createElement ('Category');
$category -> addText (toUTF8($msg -> {cat}));
my $date = $xml -> createElement ('Date');
$date -> setAttribute ('longSec', $msg -> {time});
- $author -> appendChild ($name);
- $author -> appendChild ($email);
+ $author -> appendChild ($name);
+ $author -> appendChild ($email);
$header -> appendChild ($author);
$header -> appendChild ($category);
$header -> appendChild ($subject);
if ($msg -> {kids}) {
for (@{$msg -> {kids}}) {
- $message -> appendChild (&create_message_xml ($xml, $msges, $_));}}
+ $message -> appendChild (&create_message_xml ($xml, $msges, $_));
+ }
+ }
$message;
}
# ====================================================
# end of Posting::_lib
-# ====================================================
\ No newline at end of file
+# ====================================================