notifications bug

This commit is contained in:
Hannes Mannerheim 2014-11-25 21:38:00 +01:00
parent b69f5d364a
commit 5e8c84edb2
2 changed files with 17 additions and 10 deletions

View File

@ -104,14 +104,21 @@ class ApiQvitterNotificationsAction extends ApiPrivateAuthAction
} }
} }
$from_profile = Profile::getKV($notification->from_profile_id);
// a user might have deleted their profile, don't show these notifications
if($from_profile instanceof Profile) {
$notifications_populated[] = array( $notifications_populated[] = array(
'id'=> $notification->id, 'id'=> $notification->id,
'from_profile'=> self::twitterUserArray(Profile::getKV($notification->from_profile_id)), 'from_profile'=> self::twitterUserArray($from_profile),
'ntype'=> $notification->ntype, 'ntype'=> $notification->ntype,
'notice'=> $notice, 'notice'=> $notice,
'created_at'=>self::dateTwitter($notification->created), 'created_at'=>self::dateTwitter($notification->created),
'is_seen'=>$notification->is_seen 'is_seen'=>$notification->is_seen
); );
}
} }
// mark as seen // mark as seen

View File

@ -2008,7 +2008,7 @@ window.siteTitle = $('head title').html(); // remember this for later use
// replace placeholders in translation // replace placeholders in translation
$.each(window.sL,function(k,v){ $.each(window.sL,function(k,v){
window.sL[k] = v.replace('{site-title}',window.siteTitle); window.sL[k] = v.replace(/{site-title}/g,window.siteTitle);
}); });
// set some static string // set some static string