formatting and layout (tabs = 4 spaces, no trailing whitespace)
This commit is contained in:
parent
0d6318c92b
commit
3b9fd25787
|
@ -82,50 +82,43 @@ class ApiQvitterNotificationsAction extends ApiPrivateAuthAction
|
||||||
*/
|
*/
|
||||||
function showTimeline()
|
function showTimeline()
|
||||||
{
|
{
|
||||||
|
|
||||||
$notice = null;
|
$notice = null;
|
||||||
|
|
||||||
$notifications_populated = array();
|
$notifications_populated = array();
|
||||||
|
|
||||||
foreach($this->notifications as $notification) {
|
|
||||||
|
|
||||||
|
|
||||||
// all but follow has an notice
|
|
||||||
if($notification->ntype != 'follow') {
|
|
||||||
|
|
||||||
// we need a notice id here, skip this notification if notice id is null
|
|
||||||
if($notification->notice_id === null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$notice = self::twitterSimpleStatusArray(Notice::getKV($notification->notice_id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$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(
|
foreach ($this->notifications as $notification) {
|
||||||
'id'=> $notification->id,
|
// all but follow has an notice
|
||||||
'from_profile'=> self::twitterUserArray($from_profile),
|
if ($notification->ntype != 'follow') {
|
||||||
'ntype'=> $notification->ntype,
|
// we need a notice id here, skip this notification if notice id is null
|
||||||
'notice'=> $notice,
|
if($notification->notice_id === null) {
|
||||||
'created_at'=>self::dateTwitter($notification->created),
|
continue;
|
||||||
'is_seen'=>$notification->is_seen
|
} else {
|
||||||
);
|
$notice = self::twitterSimpleStatusArray(Notice::getKV($notification->notice_id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
$from_profile = Profile::getKV($notification->from_profile_id);
|
||||||
}
|
|
||||||
|
|
||||||
// mark as seen
|
// a user might have deleted their profile, don't show these notifications
|
||||||
foreach($this->notifications as $notification) {
|
if ($from_profile instanceof Profile) {
|
||||||
if($notification->is_seen == 0) {
|
$notifications_populated[] = array(
|
||||||
$notification->is_seen = 1;
|
'id'=> $notification->id,
|
||||||
$notification->update();
|
'from_profile'=> self::twitterUserArray($from_profile),
|
||||||
}
|
'ntype'=> $notification->ntype,
|
||||||
}
|
'notice'=> $notice,
|
||||||
|
'created_at'=>self::dateTwitter($notification->created),
|
||||||
|
'is_seen'=>$notification->is_seen
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// mark as seen
|
||||||
|
foreach($this->notifications as $notification) {
|
||||||
|
if($notification->is_seen == 0) {
|
||||||
|
$notification->is_seen = 1;
|
||||||
|
$notification->update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->initDocument('json');
|
$this->initDocument('json');
|
||||||
$this->showJsonObjects($notifications_populated);
|
$this->showJsonObjects($notifications_populated);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user