public static function NotificationPreference($ActivityType, $Preferences, $Type = NULL) {
      if (is_numeric($Preferences)) {
         $User = Gdn::UserModel()->GetID($Preferences);
         if (!$User)
            return $Type == 'both' ? array(FALSE, FALSE) : FALSE;
         $Preferences = GetValue('Preferences', $User);
      }
      
      if ($Type === NULL) {
         $Result = self::NotificationPreference($ActivityType, $Preferences, 'Email')
                || self::NotificationPreference($ActivityType, $Preferences, 'Popup');
         
         return $Result;
      } elseif ($Type === 'both') {
         $Result = array(
            self::NotificationPreference($ActivityType, $Preferences, 'Popup'),
            self::NotificationPreference($ActivityType, $Preferences, 'Email')
            );
         return $Result;
      }
      
      $ConfigPreference = C("Preferences.$Type.$ActivityType", '0');
      if ((int)$ConfigPreference === 2)
         $Preference = TRUE; // This preference is forced on.
      if ($ConfigPreference !== FALSE)
         $Preference = ArrayValue($Type.'.'.$ActivityType, $Preferences, $ConfigPreference);
      else
         $Preference = FALSE;
      
      return $Preference;
   }