Exemple #1
0
 /**
  * Attempt to mark all notifications as read
  * @return boolean
  */
 public function markAllRead()
 {
     if (wfReadOnly() || $this->notifCountHasReachedMax()) {
         return false;
     }
     // Only update all the unread notifications if it isn't a huge number.
     // TODO: Implement batched jobs it's over the maximum.
     $this->storage->markAllRead($this->mUser);
     $this->resetNotificationCount(DB_MASTER);
     $this->flagCacheWithNoTalkNotification();
     return true;
 }
Exemple #2
0
 /**
  * Initialize Echo extension with necessary data, this function is invoked
  * from $wgExtensionFunctions
  */
 public static function initEchoExtension()
 {
     global $wgEchoBackend, $wgEchoBackendName, $wgEchoNotifications, $wgEchoNotificationCategories, $wgEchoNotificationIcons, $wgEchoConfig, $wgNotificationSenderName;
     // allow extensions to define their own event
     wfRunHooks('BeforeCreateEchoEvent', array(&$wgEchoNotifications, &$wgEchoNotificationCategories, &$wgEchoNotificationIcons));
     $wgEchoBackend = MWEchoBackend::factory($wgEchoBackendName);
     // turn schema off if eventLogging is not enabled
     if (!function_exists('efLogServerSideEvent')) {
         foreach ($wgEchoConfig['eventlogging'] as $schema => $property) {
             if ($property['enabled']) {
                 $wgEchoConfig['eventlogging'][$schema]['enabled'] = false;
             }
         }
     }
     if ($wgNotificationSenderName === null) {
         $wgNotificationSenderName = wfMessage('emailsender')->inContentLanguage()->text();
     }
 }