fixed #10838: Forwarded forum post email to new CS adds reply to original thread

This commit is contained in:
Graham Knop 2009-09-01 22:40:08 +00:00
parent 838ae00af5
commit 6f3980a9c9
3 changed files with 161 additions and 1 deletions

View file

@ -204,7 +204,12 @@ sub execute {
my $post = undef;
if ($message->{inReplyTo} && $message->{inReplyTo} =~ m/cs\-([\w_-]{22})\@/) {
my $id = $1;
$post = WebGUI::Asset->newByDynamicClass($self->session, $id);
my $repliedPost = WebGUI::Asset->newByDynamicClass($self->session, $id);
if ($repliedPost
&& $repliedPost->isa('WebGUI::Asset::Post')
&& $repliedPost->getThread->getParent->getId eq $cs->getId) {
$post = $repliedPost;
}
}
if (defined $post && $cs->get("allowReplies") && $user->isInGroup($cs->get("postGroupId")) && (!$cs->get("requireSubscriptionForEmailPosting") || $user->isInGroup($cs->get("subscriptionGroupId")) || $user->isInGroup($post->get("subscriptionGroupId")))) {