@@ -49,20 +49,18 @@ public function __construct(
4949 public function show () {
5050 try {
5151 $ user = $ this ->activityManager ->getCurrentUserId ();
52-
5352 $ userLang = $ this ->config ->getUserValue ($ user , 'core ' , 'lang ' );
5453
5554 // Overwrite user and language in the helper
5655 $ this ->l = $ this ->l10nFactory ->get ('activity ' , $ userLang );
5756 $ this ->helper ->setL10n ($ this ->l );
5857
5958 $ description = $ this ->l ->t ('Personal activity feed for %s ' , $ user );
60- $ response = $ this ->data ->get ($ this ->helper , $ this ->settings , $ user , 0 , self ::DEFAULT_PAGE_SIZE , 'desc ' , 'all ' );
61- $ activities = $ response ['data ' ];
59+ $ data = $ this ->data ->get ($ this ->helper , $ this ->settings , $ user , 0 , self ::DEFAULT_PAGE_SIZE , 'desc ' , 'all ' );
60+ $ activities = $ data ['data ' ];
6261 } catch (\UnexpectedValueException $ e ) {
6362 $ this ->l = $ this ->l10nFactory ->get ('activity ' );
6463 $ description = $ this ->l ->t ('Your feed URL is invalid ' );
65-
6664 $ activities = [
6765 [
6866 'activity_id ' => -1 ,
@@ -71,17 +69,19 @@ public function show() {
7169 'subject_prepared ' => $ description ,
7270 ]
7371 ];
72+ $ response ->throttle ();
7473 }
7574
7675 $ title = $ this ->themingDefaults ->getTitle ();
77- $ response = new TemplateResponse ('activity ' , 'rss ' , [
76+
77+ $ response ->setParams ([
7878 'rssLang ' => $ this ->l ->getLanguageCode (),
7979 'rssLink ' => $ this ->urlGenerator ->linkToRouteAbsolute ('activity.Feed.show ' ),
8080 'rssPubDate ' => date ('r ' ),
81- 'description ' => $ description ,
8281 'title ' => $ title !== '' ? $ this ->l ->t ('Activity feed for %1$s ' , [$ title ]) : $ this ->l ->t ('Activity feed ' ),
82+ 'description ' => $ description ,
8383 'activities ' => $ activities ,
84- ], '' );
84+ ]);
8585
8686 if (stristr ($ this ->request ->getHeader ('accept ' ), 'application/rss+xml ' )) {
8787 $ response ->addHeader ('Content-Type ' , 'application/rss+xml ' );
0 commit comments