From: Evan Prodromou Date: Sun, 2 Jun 2013 19:24:57 +0000 (-0400) Subject: Merge branch 'master' of gitorious.org:statusnet/mainline X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7ad5ed1db9fe6694f324c2a65e0dbfc29ed404fd;p=quix0rs-gnu-social.git Merge branch 'master' of gitorious.org:statusnet/mainline --- 7ad5ed1db9fe6694f324c2a65e0dbfc29ed404fd diff --cc lib/useractivitystream.php index 3f50b9c302,5422afc2c0..59ae6184b3 --- a/lib/useractivitystream.php +++ b/lib/useractivitystream.php @@@ -122,35 -169,29 +169,48 @@@ class UserActivityStream extends AtomUs if ($this->outputMode == self::OUTPUT_RAW) { // Grab anything after the last pre-sorted activity. - $notices = $this->getNoticesBetween(0, $end); - foreach ($notices as $noticeAct) { - try { - $nact = $noticeAct->asActivity(); - $nact->outputTo($this, false, false); - } catch (Exception $e) { - // Continue + try { + $notices = $this->getNoticesBetween(0, $end); + foreach ($notices as $noticeAct) { + try { + $nact = $noticeAct->asActivity(); + if ($format == Feed::ATOM) { + $nact->outputTo($this, false, false); + } else { + if ($haveOne) { + fwrite($handle, ","); + } + fwrite($handle, json_encode($nact->asArray())); + $haveOne = true; + } + } catch (Exception $e) { + common_log(LOG_ERR, $e->getMessage()); + continue; + } } + } catch (Exception $e) { + common_log(LOG_ERR, $e->getMessage()); } } + + // We always add the registration activity at the end, even if + // they have older activities (from restored backups) in their stream. + + try { + $ract = $this->user->registrationActivity(); + if ($format == Feed::ATOM) { + $ract->outputTo($this, false, false); + } else { + if ($haveOne) { + fwrite($handle, ","); + } + fwrite($handle, json_encode($ract->asArray())); + $haveOne = true; + } + } catch (Exception $e) { + common_log(LOG_ERR, $e->getMessage()); + continue; + } } function compareObject($a, $b)