Reuse the same hash in the loop, modifying the unique keys.

This commit is contained in:
Colin Kuskie 2009-02-26 15:25:12 -08:00
parent d1680cf867
commit 9dcd7d4af2

View file

@ -1151,14 +1151,16 @@ sub www_sendMessageSave {
#Let sendMessage deal with displaying errors
return $self->www_sendMessage($errorMsg) if $hasError;
my $messageProperties = {
message => $message,
subject => $subject,
status => 'unread',
sentBy => $fromUser->userId
};
foreach my $uid (@toUsers) {
$inbox->addMessage({
message => $message,
subject => $subject,
userId => $uid,
status => 'unread',
sentBy => $fromUser->userId
});
$messageProperties->{userId} = $uid;
$inbox->addMessage($messageProperties);
}
$self->appendCommonVars($var,$inbox);