Unbreak notformat=text|html in the API

Just pass any unknown formats through.

Change-Id: I156b49a959b5453cd37cd4c3d58652b5420132f3
This commit is contained in:
Kunal Mehta 2015-12-10 15:23:57 -08:00
parent 4a2c663867
commit cfdc6cb3d0

View file

@ -18,7 +18,6 @@ class EchoDataOutputFormatter {
* @var array Mapping of new formatter to old formatter type
*/
protected static $legacyMapping = array(
'flyout' => 'flyout',
'special' => 'html',
);
@ -146,7 +145,11 @@ class EchoDataOutputFormatter {
$formatter = new self::$formatters[$format]( $user, $lang );
return $formatter->format( $event );
} else {
$legacyFormat = self::$legacyMapping[$format];
if ( isset( self::$legacyMapping[$format] ) ) {
$legacyFormat = self::$legacyMapping[$format];
} else {
$legacyFormat = $format;
}
// Legacy b/c
return EchoNotificationController::formatNotification( $event, $user, $legacyFormat );
}