Skip to content

Commit

Permalink
Temporary fix of messaging bug (need to come back to this later) (bug…
Browse files Browse the repository at this point in the history
… 474674).
  • Loading branch information
pudge committed Oct 29, 2001
1 parent 3c9a19e commit 64c7543
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
24 changes: 12 additions & 12 deletions plugins/Journal/journal.pl
Expand Up @@ -431,20 +431,20 @@ sub saveArticle {
my $messages = getObject('Slash::Messages');
if ($messages) {
my $friends = $journal->message_friends;
my $data = {
template_name => 'messagenew',
subject => { template_name => 'messagenew_subj' },
journal => {
description => $description,
article => $form->{article},
posttype => $form->{posttype},
id => $id,
uid => $user->{uid},
nickname => $user->{nickname},
}
};

for (@$friends) {
my $data = {
template_name => 'messagenew',
subject => { template_name => 'messagenew_subj' },
journal => {
description => $description,
article => $form->{article},
posttype => $form->{posttype},
id => $id,
uid => $user->{uid},
nickname => $user->{nickname},
}
};
$messages->create($_, MSG_CODE_JOURNAL_FRIEND, $data);
}
}
Expand Down
5 changes: 5 additions & 0 deletions plugins/Messages/Messages.pm
Expand Up @@ -81,6 +81,11 @@ key. Pass the name of the template in as the "template_name"
key. If "subject" is a template, then pass it as a hashref,
with "template_name" as one of the keys.
B<NOTE>: You cannot re-use the same MESSAGE reference for
multiple messages. The data is manipulated. You must pass in
a new data structure each time through. This should be fixed
in future versions.
=item FROM_ID
Either the UID of the user sending the message, or 0 to denote
Expand Down
10 changes: 5 additions & 5 deletions plugins/Submit/submit.pl
Expand Up @@ -438,13 +438,13 @@ sub saveSub {
my $messages = 0; #getObject('Slash::Messages');
if ($messages) {
my $users = $messages->getMessageUsers(MSG_CODE_NEW_SUBMISSION);
my $data = {
template_name => 'messagenew',
subject => { template_name => 'messagenew_subj' },
submission => $submission,
};

for (@$users) {
my $data = {
template_name => 'messagenew',
subject => { template_name => 'messagenew_subj' },
submission => $submission,
};
$messages->create($_, MSG_CODE_NEW_SUBMISSION, $data);
}
}
Expand Down
10 changes: 5 additions & 5 deletions themes/slashcode/htdocs/submit.pl
Expand Up @@ -438,13 +438,13 @@ sub saveSub {
my $messages = 0; #getObject('Slash::Messages');
if ($messages) {
my $users = $messages->getMessageUsers(MSG_CODE_NEW_SUBMISSION);
my $data = {
template_name => 'messagenew',
subject => { template_name => 'messagenew_subj' },
submission => $submission,
};

for (@$users) {
my $data = {
template_name => 'messagenew',
subject => { template_name => 'messagenew_subj' },
submission => $submission,
};
$messages->create($_, MSG_CODE_NEW_SUBMISSION, $data);
}
}
Expand Down

0 comments on commit 64c7543

Please sign in to comment.