- fix: cs mail posts - no url prepending

- Multiple "Re:"'s on CS Mail posts are now a thing of the past.
 - Made mail message ids follow convention.
This commit is contained in:
JT Smith 2006-06-14 17:48:38 +00:00
parent 24ed8f3e3f
commit e225c2276a
4 changed files with 26 additions and 15 deletions

View file

@ -100,11 +100,16 @@ sub addPost {
$prefix =~ s/\//\\\//g;
my $title = $message->{subject};
$title =~ s/$prefix//;
if ($title =~ m/re:/i) {
$title =~ s/re://ig;
$title = "Re: ".$title;
$title =~ s/\s+/ /g;
}
my $post = $parent->addChild({
className=>$class,
title=>$title,
menuTitle =>$title,
url=>$title,
url=>$parent->get("url")."/".$title,
content=>$content,
ownerUserId=>$user->userId,
username=>$user->profileField("alias") || $user->username,
@ -188,7 +193,7 @@ sub execute {
}
my $post = undef;
if ($message->{inReplyTo}) {
$message->{inReplyTo} =~ m/cs\-([\w_-]{22})/;
$message->{inReplyTo} =~ m/cs\-([\w_-]{22})\@/;
my $id = $1;
$post = WebGUI::Asset->newByDynamicClass($self->session, $id);
}