Reuse the same hash in the loop, modifying the unique keys.
This commit is contained in:
parent
d1680cf867
commit
9dcd7d4af2
1 changed files with 9 additions and 7 deletions
|
|
@ -1151,14 +1151,16 @@ sub www_sendMessageSave {
|
||||||
#Let sendMessage deal with displaying errors
|
#Let sendMessage deal with displaying errors
|
||||||
return $self->www_sendMessage($errorMsg) if $hasError;
|
return $self->www_sendMessage($errorMsg) if $hasError;
|
||||||
|
|
||||||
|
my $messageProperties = {
|
||||||
|
message => $message,
|
||||||
|
subject => $subject,
|
||||||
|
status => 'unread',
|
||||||
|
sentBy => $fromUser->userId
|
||||||
|
};
|
||||||
|
|
||||||
foreach my $uid (@toUsers) {
|
foreach my $uid (@toUsers) {
|
||||||
$inbox->addMessage({
|
$messageProperties->{userId} = $uid;
|
||||||
message => $message,
|
$inbox->addMessage($messageProperties);
|
||||||
subject => $subject,
|
|
||||||
userId => $uid,
|
|
||||||
status => 'unread',
|
|
||||||
sentBy => $fromUser->userId
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->appendCommonVars($var,$inbox);
|
$self->appendCommonVars($var,$inbox);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue