[Slashdotjp-dev 1271] [799] Create messages when the journal is submission

アーカイブの一覧に戻る

svnno****@sourc***** svnno****@sourc*****
2008年 10月 23日 (木) 16:57:34 JST


Revision: 799
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=799
Author:   tach
Date:     2008-10-23 16:57:34 +0900 (Thu, 23 Oct 2008)

Log Message:
-----------
Create messages when the journal is submission

Modified Paths:
--------------
    slashjp/branches/2.5.0.192/debian/changelog
    slashjp/branches/2.5.0.192/plugins/Journal/Journal.pm


-------------- next part --------------
Modified: slashjp/branches/2.5.0.192/debian/changelog
===================================================================
--- slashjp/branches/2.5.0.192/debian/changelog	2008-10-23 06:32:54 UTC (rev 798)
+++ slashjp/branches/2.5.0.192/debian/changelog	2008-10-23 07:57:34 UTC (rev 799)
@@ -10,8 +10,9 @@
   * Select enable/disable moderation for not m2able reasons when it is not
     eligible
   * Fix unwanted object creation at plugin/Messages/Messages.pm
+  * Create messages when the journal is submission
 
- -- Taku YASUI <tach****@osdn*****>  Thu, 23 Oct 2008 06:31:58 +0000
+ -- Taku YASUI <tach****@osdn*****>  Thu, 23 Oct 2008 07:56:51 +0000
 
 slash (2.5.0.192-20) unstable; urgency=low
 

Modified: slashjp/branches/2.5.0.192/plugins/Journal/Journal.pm
===================================================================
--- slashjp/branches/2.5.0.192/plugins/Journal/Journal.pm	2008-10-23 06:32:54 UTC (rev 798)
+++ slashjp/branches/2.5.0.192/plugins/Journal/Journal.pm	2008-10-23 07:57:34 UTC (rev 799)
@@ -496,6 +496,25 @@
 	my $subid = $slashdb->createSubmission($submission);
 	if ($subid) {
 		$self->logJournalTransfer($src_journal->{id}, $subid);
+
+		# create messages
+		my $messages = getObject('Slash::Messages');
+		if ($messages) {
+			my $users = $messages->getMessageUsers(MSG_CODE_NEW_SUBMISSION);
+			my $messagesub = { %$submission };
+			$messagesub->{subid} = $subid;
+			$messagesub->{story} = $story;
+			$messagesub->{subj} = $src_journal->{description};
+			my $data = {
+				template_name	=> 'messagenew',
+				template_page	=> 'submit',
+				subject		=> {
+					template_name	=> 'messagenew_subj',
+					template_page	=> 'submit', },
+				submission	=> $messagesub,
+			};
+			$messages->create($users, MSG_CODE_NEW_SUBMISSION, $data) if @$users;
+		}
 	} else {
 		print STDERR ("Failed attempting to transfer journal id: $src_journal->{id}\n");
 	}


Slashdotjp-dev メーリングリストの案内
アーカイブの一覧に戻る