]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' of gitorious.org:statusnet/mainline
authorEvan Prodromou <evan@e14n.com>
Sun, 2 Jun 2013 19:24:57 +0000 (15:24 -0400)
committerEvan Prodromou <evan@e14n.com>
Sun, 2 Jun 2013 19:24:57 +0000 (15:24 -0400)
1  2 
lib/useractivitystream.php

index 3f50b9c3024b838538326cb021b9ab23b20506c3,5422afc2c0a89c434e06c8c114678c0fe3df955b..59ae6184b3e27ac16c0ace731ff4eeedb060cb02
@@@ -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)