diff --git a/Echo.php b/Echo.php index e42de9d14..fb6a14ce7 100644 --- a/Echo.php +++ b/Echo.php @@ -147,6 +147,8 @@ $wgHooks['ArticleEditUpdateNewTalk'][] = 'EchoHooks::abortNewtalkNotification'; // Configuration +$wgEchoDisableStandardEmail = true; + $wgEchoDefaultNotificationTypes = array( 'all' => array( 'notify' => true, diff --git a/Hooks.php b/Hooks.php index c1fde1888..f959d1e0f 100644 --- a/Hooks.php +++ b/Hooks.php @@ -243,7 +243,8 @@ class EchoHooks { * @return true in all cases */ static function abortEmailNotification() { - return false; + global $wgEchoDisableStandardEmail; + return ! $wgEchoDisableStandardEmail; } public static function makeGlobalVariablesScript( &$vars, $outputPage ) { diff --git a/model/Event.php b/model/Event.php index b5f79eb08..628e41c48 100644 --- a/model/Event.php +++ b/model/Event.php @@ -175,12 +175,14 @@ class EchoEvent { * Loads data from the database into this object, given the event ID. * @param $id Event ID */ - public function loadFromID($id) { - $dbr = wfGetDB( DB_SLAVE ); + public function loadFromID( $id, $fromMaster = false ) { + $db = wfGetDB( $fromMaster ? DB_MASTER : DB_SLAVE ); - $row = $dbr->selectRow( 'echo_event', '*', array('event_id' => $id), __METHOD__ ); + $row = $db->selectRow( 'echo_event', '*', array('event_id' => $id), __METHOD__ ); - if ( ! $row ) { + if ( ! $row && !$fromMaster ) { + $this->loadFromID( $id, true ); + } elseif ( ! $row ) { throw new MWException( "No EchoEvent found with ID: $id"); }