]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorRoland Haeder <roland@mxchange.org>
Wed, 13 Jan 2016 15:58:08 +0000 (16:58 +0100)
committerRoland Haeder <roland@mxchange.org>
Wed, 13 Jan 2016 15:58:08 +0000 (16:58 +0100)
Preserved some type-hints

Signed-off-by: Roland Haeder <roland@mxchange.org>
141 files changed:
1  2 
.gitignore
actions/apiaccountratelimitstatus.php
actions/apiconversation.php
actions/apilistmemberships.php
actions/apilists.php
actions/apimediaupload.php
actions/apisearchatom.php
actions/apistatusesdestroy.php
actions/apistatusesshow.php
actions/apitimelinetag.php
actions/apitimelineuser.php
actions/doc.php
actions/foaf.php
actions/groupbyid.php
actions/grouprss.php
actions/logout.php
actions/noticesearch.php
actions/noticesearchrss.php
actions/peopletagautocomplete.php
actions/peopletagsbyuser.php
actions/peopletagsforuser.php
actions/publicrss.php
actions/recoverpassword.php
actions/redirecturl.php
actions/replies.php
actions/repliesrss.php
actions/robotstxt.php
actions/rsd.php
actions/shownotice.php
actions/tag.php
actions/tagrss.php
actions/userrss.php
classes/Avatar.php
classes/Memcached_DataObject.php
classes/Notice.php
classes/User_group.php
htaccess.sample
lib/action.php
lib/activityutils.php
lib/apioauthaction.php
lib/attachmentlist.php
lib/attachmentlistitem.php
lib/default.php
lib/formaction.php
lib/framework.php
lib/imagefile.php
lib/implugin.php
lib/installer.php
lib/noticelistitem.php
lib/profileaction.php
lib/router.php
lib/schemaupdater.php
lib/urlmapper.php
lib/util.php
plugins/Autocomplete/actions/autocomplete.php
plugins/Bookmark/BookmarkPlugin.php
plugins/Bookmark/actions/newbookmark.php
plugins/DirectMessage/actions/apidirectmessage.php
plugins/DirectionDetector/DirectionDetectorPlugin.php
plugins/Directory/DirectoryPlugin.php
plugins/Directory/actions/groupdirectory.php
plugins/Directory/lib/sortablegrouplist.php
plugins/DomainStatusNetwork/scripts/installforemail.php
plugins/DomainStatusNetwork/scripts/proposesite.php
plugins/DomainStatusNetwork/scripts/sitefordomain.php
plugins/EmailRegistration/scripts/cancelemailregistration.php
plugins/EmailRegistration/scripts/registeremailuser.php
plugins/EmailReminder/scripts/sendemailreminder.php
plugins/Event/EventPlugin.php
plugins/Event/actions/cancelrsvp.php
plugins/Event/actions/newevent.php
plugins/ExtendedProfile/actions/profiledetail.php
plugins/FacebookBridge/actions/facebookfinishlogin.php
plugins/Favorite/actions/showfavorites.php
plugins/GNUsocialPhotos/actions/editphoto.php
plugins/Mapstraction/actions/map.php
plugins/OStatus/OStatusPlugin.php
plugins/OStatus/actions/ostatusinit.php
plugins/OStatus/classes/FeedSub.php
plugins/OStatus/classes/Ostatus_profile.php
plugins/OStatus/lib/magicenvelope.php
plugins/OStatus/lib/ostatusqueuehandler.php
plugins/OStatus/lib/salmonaction.php
plugins/OStatus/scripts/fixup-shadow.php
plugins/OStatus/scripts/gcfeeds.php
plugins/OStatus/scripts/renew-feeds.php
plugins/OStatus/scripts/resub-feed.php
plugins/OStatus/scripts/rm_bad_feedsubs.php
plugins/OStatus/scripts/testfeed.php
plugins/OStatus/scripts/update-profile-data.php
plugins/OStatus/scripts/update-profile.php
plugins/OStatus/scripts/update_ostatus_profiles.php
plugins/OStatus/tests/slap.php
plugins/Oembed/actions/oembed.php
plugins/OpenID/OpenIDPlugin.php
plugins/OpenID/actions/publicxrds.php
plugins/OpenID/openid.php
plugins/OpportunisticQM/lib/opportunisticqueuemanager.php
plugins/QnA/QnAPlugin.php
plugins/QnA/actions/qnanewanswer.php
plugins/Realtime/RealtimePlugin.php
plugins/Realtime/scripts/cleanupchannels.php
plugins/RequireValidatedEmail/scripts/registerbyemail.php
plugins/SearchSub/actions/searchsubs.php
plugins/Sitemap/scripts/updatecounts.php
plugins/StrictTransportSecurity/StrictTransportSecurityPlugin.php
plugins/TagSub/actions/tagsubs.php
plugins/TwitterBridge/TwitterBridgePlugin.php
plugins/TwitterBridge/daemons/synctwitterfriends.php
plugins/TwitterBridge/daemons/twitterdaemon.php
plugins/TwitterBridge/daemons/twitterstatusfetcher.php
plugins/TwitterBridge/scripts/fakestream.php
plugins/TwitterBridge/scripts/initialize_notice_to_status.php
plugins/TwitterBridge/scripts/streamtest.php
plugins/WebFinger/WebFingerPlugin.php
plugins/Xmpp/XmppPlugin.php
scripts/checkschema.php
scripts/clearcache.php
scripts/console.php
scripts/createsim.php
scripts/deleteprofile.php
scripts/dumpschema.php
scripts/flushrouter.php
scripts/flushsite.php
scripts/gnusocialversion.php
scripts/importtwitteratom.php
scripts/make-release.php
scripts/makegroupadmin.php
scripts/registeruser.php
scripts/sessiongc.php
scripts/setpassword.php
scripts/settag.php
scripts/showcache.php
scripts/showtable.php
scripts/uncache_users.php
scripts/updatelocation.php
scripts/updateurls.php
scripts/upgrade.php
scripts/userrole.php
tests/atompub/atompub_test.php
tests/oauth/oauth_post_notice.php

diff --cc .gitignore
Simple merge
Simple merge
Simple merge
Simple merge
index 129691a3b42f8c58b09835c38b906c179f12dea4,0b241638ad6c8fd61616efb2fdfd2ab8691c02f7..42672e6191c40aacf46561341a184d778fa4c5c5
@@@ -185,10 -185,10 +185,10 @@@ class ApiListsAction extends ApiBareAut
  
          list($this->lists,
               $this->next_cursor,
-              $this->prev_cursor) = Profile_list::getAtCursor($fn, array($this->auth_user), $cursor, $count);
+              $this->prev_cursor) = Profile_list::getAtCursor($fn, array($this->scoped), $cursor, $count);
      }
  
 -    function isReadOnly($args)
 +    function isReadOnly(array $args=array())
      {
          return false;
      }
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc actions/doc.php
Simple merge
index a17962b97e49d70f04d525fb82e3ccb06f717f3f,260388ba447b72819ea0f908e4da35e9ade80391..4420c2d5036cc59bf6bb4ad08fbcacce749e436a
@@@ -24,9 -24,9 +24,9 @@@ define('LISTENEE', -1)
  define('BOTH', 0);
  
  // @todo XXX: Documentation missing.
- class FoafAction extends Action
+ class FoafAction extends ManagedAction
  {
 -    function isReadOnly($args)
 +    function isReadOnly(array $args=array())
      {
          return true;
      }
index befd526de11a6472e432ab1a7153d4866e65d7e2,de87ec5c672e20da7632ef8f29e99c9411e4a91a..448924bf473dc9eab1969ba4b61f706ae07af51f
@@@ -47,17 -42,12 +42,12 @@@ if (!defined('GNUSOCIAL')) { exit(1); 
   * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
   * @link     http://status.net/
   */
- class GroupbyidAction extends Action
+ class GroupbyidAction extends ManagedAction
  {
      /** group we're viewing. */
-     var $group = null;
+     protected $group = null;
  
-     /**
-      * Is this page read-only?
-      *
-      * @return boolean true
-      */
 -    function isReadOnly($args)
 +    function isReadOnly(array $args=array())
      {
          return true;
      }
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 62418df21709640c2bc79f56aca461cf7928ae09,826ab66a679188dac905bcae3e6b2ce6b3721033..724f46e909fe279c4ea292d6e9f15abfcaf6c7bc
@@@ -83,28 -54,12 +54,12 @@@ class RedirecturlAction extends Managed
          return true;
      }
  
-     /**
-      * Handler method
-      *
-      * @param array $argarray is ignored since it's now passed in in prepare()
-      *
-      * @return void
-      */
-     function handle($argarray=null)
+     public function showPage()
      {
-         common_redirect($this->file->url, 307);
+         common_redirect($this->file->getUrl(false), 301);
      }
  
-     /**
-      * Return true if read only.
-      *
-      * MAY override
-      *
-      * @param array $args other arguments
-      *
-      * @return boolean is read only action?
-      */
 -    function isReadOnly($args)
 +    function isReadOnly(array $args=array())
      {
          return true;
      }
Simple merge
index df632fb4ce5ebbb36bd8229a873f7869605a34a3,54f83592c0ffa0dc0eca90a44d365c6aa9d38dc5..e3f04b53a4b66e1657444a21232ee568dac7366d
@@@ -75,13 -45,7 +45,7 @@@ class RepliesrssAction extends Targeted
          return $c;
      }
  
-     function getImage()
-     {
-         $profile = $this->user->getProfile();
-         return $profile->avatarUrl(AVATAR_PROFILE_SIZE);
-     }
 -    function isReadOnly($args)
 +    function isReadOnly(array $args=array())
      {
          return true;
      }
Simple merge
diff --cc actions/rsd.php
Simple merge
Simple merge
diff --cc actions/tag.php
Simple merge
Simple merge
index 1ae94ee93f9ae1a60153300ac2240b44d4b3db06,7bed1dd256bdf5db902e61841deea57dd86492fb..147d98cc261f557424dd274a1c347168dbb2acc8
@@@ -98,22 -58,16 +58,16 @@@ class UserrssAction extends TargetedRss
          return $c;
      }
  
-     function getImage()
-     {
-         $profile = $this->user->getProfile();
-         return $profile->avatarUrl(AVATAR_PROFILE_SIZE);
-     }
      // override parent to add X-SUP-ID URL
  
-     function initRss($limit=0)
+     function initRss()
      {
-         $url = common_local_url('sup', null, null, $this->user->id);
+         $url = common_local_url('sup', null, null, $this->target->getID());
          header('X-SUP-ID: '.$url);
-         parent::initRss($limit);
+         parent::initRss();
      }
  
 -    function isReadOnly($args)
 +    function isReadOnly(array $args=array())
      {
          return true;
      }
Simple merge
Simple merge
index 269b846f24d4f71a87b47b328764d83eece2982c,60c821ae5d2eeef191a9a57f3bfebb7e8841bc07..cc00cd1dd6ac5432b9036c28c404664339b9503d
@@@ -1670,35 -1730,42 +1730,42 @@@ class Notice extends Managed_DataObjec
          return $reply;
      }
  
-     protected $_replies = array();
+     protected $_attentionids = array();
  
      /**
-      * Pull the complete list of @-reply targets for this notice.
+      * Pull the complete list of known activity context attentions for this notice.
       *
-      * @return array of integer profile ids
+      * @return array of integer profile ids (also group profiles)
       */
-     function getReplies()
+     function getAttentionProfileIDs()
      {
-         if (isset($this->_replies[$this->id])) {
-             return $this->_replies[$this->id];
+         if (!isset($this->_attentionids[$this->getID()])) {
+             $atts = Attention::multiGet('notice_id', array($this->getID()));
+             // (array)null means empty array
+             $this->_attentionids[$this->getID()] = (array)$atts->fetchAll('profile_id');
          }
+         return $this->_attentionids[$this->getID()];
+     }
  
-         $replyMap = Reply::listGet('notice_id', array($this->id));
-         $ids = array();
+     protected $_replies = array();
  
-         foreach ($replyMap[$this->id] as $reply) {
-             $ids[] = $reply->profile_id;
+     /**
+      * Pull the complete list of @-mentioned profile IDs for this notice.
+      *
+      * @return array of integer profile ids
+      */
+     function getReplies()
+     {
+         if (!isset($this->_replies[$this->getID()])) {
+             $mentions = Reply::multiGet('notice_id', array($this->getID()));
+             $this->_replies[$this->getID()] = $mentions->fetchAll('profile_id');
          }
-         $this->_setReplies($ids);
-         return $ids;
+         return $this->_replies[$this->getID()];
      }
  
 -    function _setReplies($replies)
 +    function _setReplies(array $replies)
      {
-         $this->_replies[$this->id] = $replies;
+         $this->_replies[$this->getID()] = $replies;
      }
  
      /**
          return ($result == 1) ? true : false;
      }
  
 -    protected function _inScope($profile)
 +    protected function _inScope(Profile $profile=null)
      {
-         if (!is_null($this->scope)) {
-             $scope = $this->scope;
-         } else {
-             $scope = self::defaultScope();
-         }
+         $scope = is_null($this->scope) ? self::defaultScope() : $this->getScope();
  
-         if ($scope == 0 && !$this->getProfile()->isPrivateStream()) { // Not scoping, so it is public.
+         if ($scope === 0 && !$this->getProfile()->isPrivateStream()) { // Not scoping, so it is public.
              return !$this->isHiddenSpam($profile);
          }
  
Simple merge
diff --cc htaccess.sample
index 3670c8d3d3bc321c2a714631127af4e76a1eef8f,af6e19784d1aa3f720571594b92a2b5f216a0b3b..8a689858c73b9ec3ac7f3bdb99de1726378e105a
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*) index.php?p=$1 [L,QSA]
- <<<<<<< HEAD
--
--  ## You can also use PATHINFO by using this RewriteRule instead:
--  # RewriteRule (.*) index.php/$1 [L,QSA]
- </IfModule>
- <FilesMatch "\.(ini)">
-   # For mod_access_compat in Apache <2.4
-   #Order allow,deny
-   # Use this instead for Apache >2.4 (mod_authz_host)
-   # Require all denied
- </FilesMatch>
- =======
  </IfModule>
  
  <FilesMatch "\.(ini)">
 -    <IfVersion < 2.3>
 -        Order allow,deny
 -        Deny from all
 -    </IfVersion>
 -    <IfVersion >= 2.3>
 -        Require all denied
 -    </IfVersion>
 +  Order allow,deny
  </FilesMatch>
- >>>>>>> Adding htaccess.sample back*shame*
diff --cc lib/action.php
Simple merge
index a0fc4872328e0f5103aea0797727098e9f5196db,8a2be350225140d6198128ad33d97a42a305c39b..76e4777deb5feb471dc69960ff1c1feee64c00f4
@@@ -347,10 -348,10 +348,10 @@@ class ActivityUtil
          return null;
      }
  
-     static function compareTypes($type, array $objects)    // this does verbs too!
 -    static function compareTypes($type, $objects)
++    static function compareTypes($type, array $objects)
      {
          $type = self::resolveUri($type);
 -        foreach ((array)$objects as $object) {
 +        foreach ($objects as $object) {
              if ($type === self::resolveUri($object)) {
                  return true;
              }
Simple merge
Simple merge
Simple merge
diff --cc lib/default.php
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc lib/router.php
Simple merge
index 03892970c5d3794b68a793d3c3c21141daf3d5cf,38b5b93865255cc719875385f9e927c999da4abe..575080a7bc2f906327a547dd8f18c686b51b9093
@@@ -109,9 -108,8 +108,8 @@@ class SchemaUpdate
              return $checksums;
          } catch (Exception $e) {
              // no dice!
 -            common_log(LOG_DEBUG, "Possibly schema_version table doesn't exist yet.");
 +            common_debug("Possibly schema_version table doesn't exist yet.");
          }
-         PEAR::popErrorHandling();
  
          return $checksums;
      }
              }
          } catch (Exception $e) {
              // no dice!
 -            common_log(LOG_DEBUG, "Possibly schema_version table doesn't exist yet.");
 +            common_debug("Possibly schema_version table doesn't exist yet.");
          }
-         PEAR::popErrorHandling();
          $this->checksums[$table] = $checksum;
      }
  }
Simple merge
diff --cc lib/util.php
Simple merge
Simple merge
Simple merge
index 1815b977596fe267ce731a1bf59a1de7b16a4040,f773094a74c426e9ccc023b43468d08e5a61cef2..1815b977596fe267ce731a1bf59a1de7b16a4040
mode 100644,100755..100755
index 28741a5d4fb94a6cca6630d26c525e038e94ba8a,96a722fdab775767ae943be3483be888905789eb..28741a5d4fb94a6cca6630d26c525e038e94ba8a
mode 100644,100755..100755
index 2eaa600d2598009bffb075811eaabbbc133fe8b6,59412ccebab6929169091d7ccddae77aa837d6b4..2eaa600d2598009bffb075811eaabbbc133fe8b6
mode 100644,100755..100755
index 7ae81f7ccf8f48ead06666ce58052fa3c03817fc,d834aade600abdb032570d35fb9dc1f9b7bf5b36..7ae81f7ccf8f48ead06666ce58052fa3c03817fc
mode 100644,100755..100755
index a785a76a6649080aefba71cc0323ed8172971292,02915240d32d2e57b3abbff7f280e6dfd9256921..a785a76a6649080aefba71cc0323ed8172971292
mode 100644,100755..100755
index b126f9e049329cdd2f56834d9a8f8991b0d8ad8c,5b5b26dde38aa9a4d9a68e216336d64fd80a6dcc..b126f9e049329cdd2f56834d9a8f8991b0d8ad8c
mode 100644,100755..100755
Simple merge
index 31a26837511a135540901dcc69f69a39809f93ad,662a1de0b36694a3ab9ff8816779e16af326c641..5fe95358c369bc9c4c1b3a68acffa335239dd218
@@@ -137,10 -137,10 +137,10 @@@ class CancelrsvpAction extends Actio
              $notice = $this->rsvp->getNotice();
              // NB: this will delete the rsvp, too
              if (!empty($notice)) {
 -                common_log(LOG_DEBUG, "Deleting notice...");
 +                common_debug("Deleting notice...");
-                 $notice->delete();
+                 $notice->deleteAs($this->scoped);
              } else {
 -                common_log(LOG_DEBUG, "Deleting RSVP alone...");
 +                common_debug("Deleting RSVP alone...");
                  $this->rsvp->delete();
              }
          } catch (ClientException $ce) {
Simple merge
index 37660175fac3ce52efbd2c2504a4416b5cf3e03e,ea0b8ad6309ef263131b4e91835414dd1700da8f..272dfbb53fa8e6e98991366ee22d41d8e6f10c64
@@@ -23,8 -21,7 +21,7 @@@ if (!defined('GNUSOCIAL')) { exit(1); 
  
  class ProfileDetailAction extends ShowstreamAction
  {
 -    function isReadOnly($args)
 +    function isReadOnly(array $args=array())
      {
          return true;
      }
Simple merge
Simple merge
Simple merge
index c63bf84dd155d5d1bc15eb901cc2b407bb8cbcab,d36cbe21d66c902579e680224cfa2d0a967da3d5..9d41b6727341d41eaa31949f574bd1b2c6cd47c4
@@@ -372,15 -371,16 +371,17 @@@ class Ostatus_profile extends Managed_D
       * send immediately but won't get the return value.
       *
       * @param mixed $entry XML string, Notice, or Activity
 +     * @param Profile $actor Acting profile
       * @return boolean success
       */
 -    public function notifyDeferred($entry, $actor)
 +    public function notifyDeferred($entry, Profile $actor)
      {
          if ($this->salmonuri) {
+             common_debug("OSTATUS: user {$actor->getNickname()} ({$actor->getID()}) wants to ping {$this->localProfile()->getNickname()} on {$this->salmonuri}");
              $data = array('salmonuri' => $this->salmonuri,
                            'entry' => $this->notifyPrepXml($entry),
-                           'actor' => $actor->id);
+                           'actor' => $actor->getID(),
+                           'target' => $this->localProfile()->getID());
  
              $qm = QueueManager::get();
              return $qm->enqueue($data, 'salmon');
       * @param Activity $activity
       * @param string $method 'push' or 'salmon'
       * @return mixed saved Notice or false
-      * @todo FIXME: Break up this function, it's getting nasty long
       */
 -    public function processPost($activity, $method)
 +    public function processPost(Activity $activity, $method)
      {
-         $notice = null;
-         $profile = ActivityUtils::checkAuthorship($activity, $this->localProfile());
-         // It's not always an ActivityObject::NOTE, but... let's just say it is.
-         $note = $activity->objects[0];
-         // The id URI will be used as a unique identifier for the notice,
-         // protecting against duplicate saves. It isn't required to be a URL;
-         // tag: URIs for instance are found in Google Buzz feeds.
-         $sourceUri = $note->id;
-         $dupe = Notice::getKV('uri', $sourceUri);
-         if ($dupe instanceof Notice) {
-             common_log(LOG_INFO, "OStatus: ignoring duplicate post: $sourceUri");
-             return $dupe;
-         }
-         // We'll also want to save a web link to the original notice, if provided.
-         $sourceUrl = null;
-         if ($note->link) {
-             $sourceUrl = $note->link;
-         } else if ($activity->link) {
-             $sourceUrl = $activity->link;
-         } else if (preg_match('!^https?://!', $note->id)) {
-             $sourceUrl = $note->id;
-         }
-         // Use summary as fallback for content
-         if (!empty($note->content)) {
-             $sourceContent = $note->content;
-         } else if (!empty($note->summary)) {
-             $sourceContent = $note->summary;
-         } else if (!empty($note->title)) {
-             $sourceContent = $note->title;
-         } else {
-             // @todo FIXME: Fetch from $sourceUrl?
-             // TRANS: Client exception. %s is a source URI.
-             throw new ClientException(sprintf(_m('No content for notice %s.'),$sourceUri));
-         }
-         // Get (safe!) HTML and text versions of the content
-         $rendered = common_purify($sourceContent);
-         $content = common_strip_html($rendered);
-         $shortened = common_shorten_links($content);
-         // If it's too long, try using the summary, and make the
-         // HTML an attachment.
-         $attachment = null;
-         if (Notice::contentTooLong($shortened)) {
-             $attachment = $this->saveHTMLFile($note->title, $rendered);
-             $summary = common_strip_html($note->summary);
-             if (empty($summary)) {
-                 $summary = $content;
-             }
-             $shortSummary = common_shorten_links($summary);
-             if (Notice::contentTooLong($shortSummary)) {
-                 $url = common_shorten_url($sourceUrl);
-                 $shortSummary = substr($shortSummary,
-                                        0,
-                                        Notice::maxContent() - (mb_strlen($url) + 2));
-                 $content = $shortSummary . ' ' . $url;
-                 // We mark up the attachment link specially for the HTML output
-                 // so we can fold-out the full version inline.
-                 // @todo FIXME i18n: This tooltip will be saved with the site's default language
-                 // TRANS: Shown when a notice is longer than supported and/or when attachments are present. At runtime
-                 // TRANS: this will usually be replaced with localised text from StatusNet core messages.
-                 $showMoreText = _m('Show more');
-                 $attachUrl = common_local_url('attachment',
-                                               array('attachment' => $attachment->id));
-                 $rendered = common_render_text($shortSummary) .
-                             '<a href="' . htmlspecialchars($attachUrl) .'"'.
-                             ' class="attachment more"' .
-                             ' title="'. htmlspecialchars($showMoreText) . '">' .
-                             '&#8230;' .
-                             '</a>';
-             }
-         }
-         $options = array('is_local' => Notice::REMOTE,
-                         'url' => $sourceUrl,
-                         'uri' => $sourceUri,
-                         'rendered' => $rendered,
-                         'replies' => array(),
-                         'groups' => array(),
-                         'peopletags' => array(),
-                         'tags' => array(),
-                         'urls' => array());
-         // Check for optional attributes...
+         $actor = ActivityUtils::checkAuthorship($activity, $this->localProfile());
  
-         if (!empty($activity->time)) {
-             $options['created'] = common_sql_date($activity->time);
-         }
-         if ($activity->context) {
-             // TODO: context->attention
-             list($options['groups'], $options['replies'])
-                 = self::filterAttention($profile, $activity->context->attention);
-             // Maintain direct reply associations
-             // @todo FIXME: What about conversation ID?
-             if (!empty($activity->context->replyToID)) {
-                 $orig = Notice::getKV('uri', $activity->context->replyToID);
-                 if ($orig instanceof Notice) {
-                     $options['reply_to'] = $orig->id;
-                 }
-             }
-             if (!empty($activity->context->conversation)) {
-                 // we store the URI here, Notice class can look it up later
-                 $options['conversation'] = $activity->context->conversation;
-             }
-             $location = $activity->context->location;
-             if ($location) {
-                 $options['lat'] = $location->lat;
-                 $options['lon'] = $location->lon;
-                 if ($location->location_id) {
-                     $options['location_ns'] = $location->location_ns;
-                     $options['location_id'] = $location->location_id;
-                 }
-             }
-         }
-         if ($this->isPeopletag()) {
-             $options['peopletags'][] = $this->localPeopletag();
-         }
-         // Atom categories <-> hashtags
-         foreach ($activity->categories as $cat) {
-             if ($cat->term) {
-                 $term = common_canonical_tag($cat->term);
-                 if ($term) {
-                     $options['tags'][] = $term;
-                 }
-             }
-         }
-         // Atom enclosures -> attachment URLs
-         foreach ($activity->enclosures as $href) {
-             // @todo FIXME: Save these locally or....?
-             $options['urls'][] = $href;
-         }
+         $options = array('is_local' => Notice::REMOTE);
  
          try {
-             $saved = Notice::saveNew($profile->id,
-                                      $content,
-                                      'ostatus',
-                                      $options);
-             if ($saved instanceof Notice) {
-                 Ostatus_source::saveNew($saved, $this, $method);
-                 if (!empty($attachment)) {
-                     File_to_post::processNew($attachment->id, $saved->id);
-                 }
-             }
+             $stored = Notice::saveActivity($activity, $actor, $options);
+             Ostatus_source::saveNew($stored, $this, $method);
          } catch (Exception $e) {
              common_log(LOG_ERR, "OStatus save of remote message $sourceUri failed: " . $e->getMessage());
              throw $e;
Simple merge
Simple merge
index 817ef4eb166cc9f97225443fd57ac564e4a63bb2,ffaae5588d1eae757e07e15ac654f27056d168fc..817ef4eb166cc9f97225443fd57ac564e4a63bb2
mode 100644,100755..100755
index f1db4b358ff35b0497457ad75ef27086a411ee30,a95cd54dbc8d8b636106e598a4ddeca56b7bcc62..f1db4b358ff35b0497457ad75ef27086a411ee30
mode 100644,100755..100755
index 01136de4173c5e04e871bc966d1b6deab49106fe,8f8ac3ee1d968416dacd8557e6e5fba7360181a4..01136de4173c5e04e871bc966d1b6deab49106fe
mode 100644,100755..100755
index edf64cd5f6247c047dbe01c5c95bef1caab103a9,d5d0924fbfe3fe7330df4f49f543c20d175a8368..efad67dbb5005f1894b2289341992c1708134a60
mode 100644,100755..100755
@@@ -34,9 -34,11 +34,11 @@@ Options
  
  END_OF_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
- if (empty($args[0]) || !Validate::uri($args[0])) {
+ $validate = new Validate();
+ if (empty($args[0]) || !$validate->uri($args[0])) {
      print "$helptext";
      exit(1);
  }
index 1957f95cb368f3cafce9cf6b36ce25acbb156a25,ce1698a60c2bff4751a228127965bf6422e176e4..1957f95cb368f3cafce9cf6b36ce25acbb156a25
mode 100644,100755..100755
index e22f22ac501abe91143dceac0141ed2cdfacfae5,da1eee292ef8d5a3b439a7d0bb039ad167b39c4e..2a12069b5f5eeee7962d8b1014d42a42da9988e6
mode 100644,100755..100755
@@@ -33,9 -33,11 +33,11 @@@ Mainly intended for testing funky feed 
  
  END_OF_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
- if (empty($args[0]) || !Validate::uri($args[0])) {
+ $validate = new Validate();
+ if (empty($args[0]) || !$validate->uri($args[0])) {
      print "$helptext";
      exit(1);
  }
index 772cc073e2f1a9af816aa658c1a9b3cdcd322ebb,ca48dc34a7db1b7a57308da618f015c7b0a97cac..c56bedd05c6ce70fc29a07ff697523ea941740f6
mode 100644,100755..100755
index 5b0c8b92e6af62a5f215019a3b8dba3aaee2e9b4,c5d9aa897c264549dac9a07a0da7c14d72a53699..40adda102ef8a6128c6403445abbd0f49459eed4
mode 100644,100755..100755
@@@ -30,9 -30,11 +30,11 @@@ things restarted if the hub or feed URL
  
  END_OF_HELP;
  
 -require_once INSTALLDIR.'/scripts/commandline.inc';
 +require_once INSTALLDIR.'/scripts/commandline.inc.php';
  
- if (empty($args[0]) || !Validate::uri($args[0])) {
+ $validate = new Validate();
+ if (empty($args[0]) || !$validate->uri($args[0])) {
      print "$helptext";
      exit(1);
  }
index 707dbe61f808d0c8c162843e589a23888d3f6c6e,3f54c83cda1ec3da4f121509d043d814f0e2cf5f..1f70bac897aecadd5581d9148d20ce2c8e7e125f
mode 100644,100755..100755
index eaef76d8cdeb1f1e2e59b5cb568f1b0856395268,e3f5439aed69bd239da22149538dfbbade619819..eaef76d8cdeb1f1e2e59b5cb568f1b0856395268
mode 100644,100755..100755
Simple merge
Simple merge
index 0000000000000000000000000000000000000000,25801e7861cb1d3798f26141e6d5128890021100..eaeb84147db9474fe9a716e73a2150b7fa8e471b
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,77 +1,77 @@@
 -    function isReadOnly($args)
+ <?php
+ /**
+  * Public XRDS for OpenID
+  *
+  * PHP version 5
+  *
+  * @category Action
+  * @package  StatusNet
+  * @author   Evan Prodromou <evan@status.net>
+  * @author   Craig Andrews <candrews@integralblue.com>
+  * @author   Robin Millette <millette@status.net>
+  * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
+  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
+  * @link     http://status.net/
+  *
+  * StatusNet - the distributed open-source microblogging tool
+  * Copyright (C) 2008, 2009, StatusNet, Inc.
+  *
+  * This program is free software: you can redistribute it and/or modify
+  * it under the terms of the GNU Affero General Public License as published by
+  * the Free Software Foundation, either version 3 of the License, or
+  * (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU Affero General Public License for more details.
+  *
+  * You should have received a copy of the GNU Affero General Public License
+  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  */
+ if (!defined('GNUSOCIAL')) { exit(1); }
+ require_once __DIR__.'/../openid.php';
+ /**
+  * Public XRDS
+  *
+  * @category Action
+  * @package  StatusNet
+  * @author   Evan Prodromou <evan@status.net>
+  * @author   Robin Millette <millette@status.net>
+  * @author   Craig Andrews <candrews@integralblue.com>
+  * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org
+  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
+  * @link     http://status.net/
+  */
+ class PublicxrdsAction extends Action
+ {
+     /**
+      * Is read only?
+      *
+      * @return boolean true
+      */
++    function isReadOnly(array $args=array())
+     {
+         return true;
+     }
+     /**
+      * Class handler.
+      *
+      * @param array $args array of arguments
+      *
+      * @return nothing
+      */
+     protected function handle()
+     {
+         parent::handle();
+         $xrdsOutputter = new XRDSOutputter();
+         $xrdsOutputter->startXRDS();
+         Event::handle('StartPublicXRDS', array($this,&$xrdsOutputter));
+         Event::handle('EndPublicXRDS', array($this,&$xrdsOutputter));
+         $xrdsOutputter->endXRDS();
+     }
+ }
Simple merge
Simple merge
Simple merge
Simple merge
index b6035bfac56227814ffb7d0e3b8945577b8a861c,37883b1da65d41f013273b5f8cdc355432b64baa..b6035bfac56227814ffb7d0e3b8945577b8a861c
mode 100644,100755..100755
index 6935e00ee5ff192073faf1faf3c99ba6ed5a1a5e,4d2000ab0fe714903549880f040c1f97dc77cad0..6935e00ee5ff192073faf1faf3c99ba6ed5a1a5e
mode 100644,100755..100755
index 744dab82876e816f023fe1cd0878873eb7855bfe,91bc0ac4e9720a23532973182c7bb749a06e1bb7..744dab82876e816f023fe1cd0878873eb7855bfe
mode 100644,100755..100755
Simple merge
index e563f534934ce2a4ce09c8eeaa99079a95b53e51,8b774889d19722214cea7595862bd8e8eb48359e..e563f534934ce2a4ce09c8eeaa99079a95b53e51
mode 100644,100755..100755
index 7860a1fedf3b0d2086c82d4ca714835b17434856,83e8a0df5e57350503478530a1759c898a0e24c1..13a8d42b9815b9a066b07c8ce68dda207606935f
@@@ -149,15 -150,9 +150,9 @@@ class TwitterStatusFetcher extends Para
          unset($_DB_DATAOBJECT['CONNECTIONS']);
      }
  
-     function getTimeline($flink, $timelineUri = 'home_timeline')
+     function getTimeline(Foreign_link $flink, $timelineUri = 'home_timeline')
      {
-         if (empty($flink)) {
-             common_log(LOG_ERR, $this->name() .
-                        " - Can't retrieve Foreign_link for foreign ID $fid");
-             return;
-         }
 -        common_log(LOG_DEBUG, $this->name() . ' - Trying to get ' . $timelineUri .
 +        common_debug($this->name() . ' - Trying to get ' . $timelineUri .
                     ' timeline for Twitter user ' . $flink->foreign_id);
  
          $client = null;
index 12fb2457482399bdacc8662b95d5c781f34dbd08,f4a60c479d62498474f45710d7aae87535126b47..12fb2457482399bdacc8662b95d5c781f34dbd08
mode 100644,100755..100755
index 5b7dc20d8681c50f61b302660dc03e38b21b87af,ce8c847aa799c2c744490f3b0e40779810a54f62..53a530333d59b925c654d3100234336b75b138bf
@@@ -54,7 -65,7 +65,7 @@@ class WebFingerPlugin extends Plugi
              $login = true;
              return false;
          }
--        
++
          return true;
      }
  
Simple merge
Simple merge
index 5904681edd8a7fbea0ad96b0e76373d37f09d6c4,c67d6275d89194cbcaf1641443e695a9ce14cd03..5904681edd8a7fbea0ad96b0e76373d37f09d6c4
mode 100644,100755..100755
Simple merge
index e5b47df6dee7daf09c13f59de2c74ab82197c470,624043161da9f19fe0e3512e760e0f770e3f2ca4..e5b47df6dee7daf09c13f59de2c74ab82197c470
mode 100644,100755..100755
index 0000000000000000000000000000000000000000,8eed6ff97b718ce7ad77f6d00a2e60a4fdba785c..c1ef5a449a9869c3ffb06d1cce2d1c7e8c371561
mode 000000,100755..100755
--- /dev/null
@@@ -1,0 -1,78 +1,78 @@@
 -require_once INSTALLDIR.'/scripts/commandline.inc';
+ #!/usr/bin/env php
+ <?php
+ /*
+  * StatusNet - a distributed open-source microblogging tool
+  * Copyright (C) 2008, 2009, StatusNet, Inc.
+  *
+  * This program is free software: you can redistribute it and/or modify
+  * it under the terms of the GNU Affero General Public License as published by
+  * the Free Software Foundation, either version 3 of the License, or
+  * (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU Affero General Public License for more details.
+  *
+  * You should have received a copy of the GNU Affero General Public License
+  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  */
+ define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
+ $shortoptions = 'i::n::u::y';
+ $longoptions = array('id=', 'nickname=', 'uri=', 'yes');
+ $helptext = <<<END_OF_DELETEUSER_HELP
+ deleteprofile.php [options]
+ deletes a profile from the database
+   -i --id       ID of the profile
+   -n --nickname nickname of a local user
+   -u --uri      OStatus profile URI (only remote users, requires OStatus plugin)
+   -y --yes      do not wait for confirmation
+ END_OF_DELETEUSER_HELP;
++require_once INSTALLDIR.'/scripts/commandline.inc.php';
+ if (have_option('i', 'id')) {
+     $id = get_option_value('i', 'id');
+     $profile = Profile::getKV('id', $id);
+     if (!$profile instanceof Profile) {
+         print "Can't find profile with ID $id\n";
+         exit(1);
+     }
+ } else if (have_option('n', 'nickname')) {
+     $nickname = get_option_value('n', 'nickname');
+     $user = User::getKV('nickname', $nickname);
+     if (!$user instanceof User) {
+         print "Can't find user with nickname '$nickname'\n";
+         exit(1);
+     }
+     $profile = $user->getProfile();
+ } else if (have_option('u', 'uri')) {
+     $uri = get_option_value('u', 'uri');
+     $oprofile = Ostatus_profile::getKV('uri', $uri);
+     if (!$oprofile instanceof Ostatus_profile) {
+         print "Can't find profile with URI '$uri'\n";
+         exit(1);
+     }
+     $profile = $oprofile->localProfile();
+ } else {
+     print "You must provide either an ID, a URI or a nickname.\n";
+     exit(1);
+ }
+ if (!have_option('y', 'yes')) {
+     print "About to PERMANENTLY delete profile '".$profile->getNickname()."' ({$profile->id}). Are you sure? [y/N] ";
+     $response = fgets(STDIN);
+     if (strtolower(trim($response)) != 'y') {
+         print "Aborting.\n";
+         exit(0);
+     }
+ }
+ print "Deleting...";
+ $profile->delete();
+ print "DONE.\n";
index 05638cda4cb22aed28c57fe79916a8c1b1814a49,9c5e3cf8b38c2fd9808803ba9c2c8437fcddfb89..05638cda4cb22aed28c57fe79916a8c1b1814a49
mode 100644,100755..100755
index a9952b4304fc2d4f01dd5cd03a25eff1b9d70205,51178a725c6d5acfb369cfcbebcb81387c897b75..a9952b4304fc2d4f01dd5cd03a25eff1b9d70205
mode 100644,100755..100755
index 3950fb7cf71830b4b51b316bbf4606db130f8fca,b7f385ac45f8652990f2849904845726814c470e..3950fb7cf71830b4b51b316bbf4606db130f8fca
mode 100644,100755..100755
index 91c2dc7f646ec759ddac1bff7008876fbccee86c,dbe9c54c5ba9d838787dc2affbc3afe0265585f2..91c2dc7f646ec759ddac1bff7008876fbccee86c
mode 100644,100755..100755
index d121179f47a9e45e0fa1777d0d9f9c29c419b499,a29526f27e1726f57f3679dcdab034fbf4350614..d121179f47a9e45e0fa1777d0d9f9c29c419b499
mode 100644,100755..100755
index a3d9c70eb061bdb435826dfc78bead11b27e92b3,157cae067db619a491c0ed9d8a07a8f8ae97f1a5..a3d9c70eb061bdb435826dfc78bead11b27e92b3
mode 100644,100755..100755
index 3d3b1d3e841accdfaddcbe98d3af8d091ed8a787,345d93c665745896d99c81e5d1623b56a2c3700f..3d3b1d3e841accdfaddcbe98d3af8d091ed8a787
mode 100644,100755..100755
index b7ee9f368ca32aee845c4f429f18a966f5a87199,97caf645cd6eb812904d9c68da110e958e30ca49..b7ee9f368ca32aee845c4f429f18a966f5a87199
mode 100644,100755..100755
index ef452fdb064f61847689f811368abcfb4d4fba47,af55ddf3f0d971d9c8af92636104c9527ecf4cb9..ef452fdb064f61847689f811368abcfb4d4fba47
mode 100644,100755..100755
Simple merge
index 3c234f2c31cdc430321c17d4abd082c94476a00c,19abce43c8018a5d1de97ca83e5740f730c2c294..3c234f2c31cdc430321c17d4abd082c94476a00c
mode 100644,100755..100755
index b4fe7b63ce9601b8c9d67648597a6bec63e1ce99,8ef08467d6be139dd2a50ee11670962cbeb30cf7..b4fe7b63ce9601b8c9d67648597a6bec63e1ce99
mode 100644,100755..100755
index 986260e1d23bdf8d16ac5ad2b425fae4217325a2,eb18a98e20d510cb3dfd2d8feee39abbd341dfd7..986260e1d23bdf8d16ac5ad2b425fae4217325a2
mode 100644,100755..100755
index 6cd2101ad7a4561378cf498456e99f569d3f25f3,b5955fd5aa9335a0ae259cdfb7baa24c3ea228bc..6cd2101ad7a4561378cf498456e99f569d3f25f3
mode 100644,100755..100755
index c8024cb769a86fb6d868e52c483b6ef9b9084063,abf9627cc71e6daffc61c3b26802b7a435bece14..c8024cb769a86fb6d868e52c483b6ef9b9084063
mode 100644,100755..100755
index c49187c299407c194b27cb669f75ac3d395b3206,8657d80b8480221056b27e20863a4ee8b15ab624..80b4ffc4060ca2ad7e06ccca92cdc2119513f3f3
mode 100644,100755..100755
index 2873146b3d90dce5e143cdc474acceb08890fdc4,56c81c8b31bcac66b902d97f6fc7d85f30a8c9e0..dff4057cd487099ce93b09c0073cb4ebc9ac9c4f
mode 100644,100755..100755
index a5eddeae5fc3dd5a1525ff6d12bdd2d1b4863b6e,d1061b18322417a6afb9c18e634dd5c6c467a78e..a5eddeae5fc3dd5a1525ff6d12bdd2d1b4863b6e
mode 100644,100755..100755
index 4259c0cdc701dde222477542b0e59448e3395142,fb675c778e3c33754f7da53da80dd9c92806b973..4259c0cdc701dde222477542b0e59448e3395142
mode 100644,100755..100755
index 6742ab1580b1dddd3c35772d70d878d6e2356bd8,23fc04b531567aedffc836627fc316eb7b563d88..6742ab1580b1dddd3c35772d70d878d6e2356bd8
mode 100644,100755..100755