]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'nightly' of git.gnu.io:gnu/gnu-social into nightly
authorabjectio <abjectio@kollektivet0x242.no>
Sun, 12 Jul 2015 08:40:24 +0000 (10:40 +0200)
committerabjectio <abjectio@kollektivet0x242.no>
Sun, 12 Jul 2015 08:40:24 +0000 (10:40 +0200)
226 files changed:
PLUGINS.txt
actions/all.php
actions/allrss.php
actions/apitimelinetag.php
actions/deletenotice.php
actions/foaf.php
actions/grouprss.php
actions/logout.php
actions/noticesearchrss.php
actions/pluginsadminpanel.php
actions/publicrss.php
actions/redirecturl.php
actions/replies.php
actions/repliesrss.php
actions/robotstxt.php
actions/showstream.php
actions/startpage.php [deleted file]
actions/subscriptions.php
actions/tag.php
actions/tagrss.php
actions/top.php
actions/usergroups.php
actions/userrss.php
classes/File_redirection.php
classes/Local_group.php
classes/Notice.php
classes/Notice_tag.php
classes/Profile.php
classes/Reply.php
classes/Subscription_queue.php
classes/User.php
extlib/Auth/OpenID/Consumer.php
extlib/Auth/OpenID/FileStore.php
extlib/Auth/OpenID/PredisStore.php
extlib/Auth/OpenID/TrustRoot.php
extlib/Auth/Yadis/Manager.php
extlib/Auth/Yadis/ParanoidHTTPFetcher.php
extlib/Auth/Yadis/ParseHTML.php
extlib/Auth/Yadis/XML.php
extlib/Auth/Yadis/XRDS.php
extlib/Auth/Yadis/Yadis.php
extlib/DB/DataObject.php [changed mode: 0755->0644]
extlib/DB/DataObject/Cast.php [changed mode: 0755->0644]
extlib/DB/DataObject/Error.php [changed mode: 0755->0644]
extlib/DB/DataObject/Generator.php [changed mode: 0755->0644]
extlib/Mail.php [changed mode: 0755->0644]
extlib/Mail/RFC822.php [changed mode: 0755->0644]
extlib/Mail/mail.php [changed mode: 0755->0644]
extlib/Mail/mimeDecode.php
extlib/Mail/mock.php [changed mode: 0755->0644]
extlib/Mail/null.php [changed mode: 0755->0644]
extlib/Mail/sendmail.php [changed mode: 0755->0644]
extlib/Mail/smtp.php [changed mode: 0755->0644]
extlib/Mail/smtpmx.php [changed mode: 0755->0644]
extlib/Net/URL2.php [changed mode: 0755->0644]
extlib/Validate.php
js/util.js
lib/action.php
lib/activityutils.php
lib/apiaction.php [changed mode: 0755->0644]
lib/atomnoticefeed.php
lib/avatarlink.php
lib/default.php
lib/deletenoticeform.php [new file with mode: 0644]
lib/feedlist.php
lib/formaction.php
lib/framework.php
lib/groupsnav.php
lib/implugin.php
lib/invitebuttonsection.php
lib/mail.php
lib/noticestreamaction.php [new file with mode: 0644]
lib/peopletagswidget.php
lib/personaltagcloudsection.php
lib/profileaction.php
lib/profilelistitem.php
lib/publictagcloudsection.php
lib/router.php
lib/rss10action.php [new file with mode: 0644]
lib/rssaction.php [deleted file]
lib/selftagswidget.php
lib/tagcloudsection.php
lib/targetedrss10action.php [new file with mode: 0644]
lib/toselector.php
plugins/AntiBrute/AntiBrutePlugin.php [changed mode: 0755->0644]
plugins/Bookmark/actions/bookmarksrss.php
plugins/DirectMessage/actions/apidirectmessage.php
plugins/DirectMessage/actions/apidirectmessagenew.php
plugins/Directory/DirectoryPlugin.php
plugins/Directory/css/directory.css
plugins/Directory/lib/sortablegrouplist.php
plugins/Directory/lib/sortablesubscriptionlist.php
plugins/DomainStatusNetwork/scripts/installforemail.php [changed mode: 0644->0755]
plugins/DomainStatusNetwork/scripts/proposesite.php [changed mode: 0644->0755]
plugins/DomainStatusNetwork/scripts/sitefordomain.php [changed mode: 0644->0755]
plugins/EmailRegistration/scripts/cancelemailregistration.php [changed mode: 0644->0755]
plugins/EmailRegistration/scripts/registeremailuser.php [changed mode: 0644->0755]
plugins/EmailReminder/scripts/sendemailreminder.php [changed mode: 0644->0755]
plugins/ExtendedProfile/actions/profiledetail.php
plugins/Favorite/actions/favoritesrss.php
plugins/Favorite/actions/showfavorites.php
plugins/Favorite/classes/Fave.php
plugins/FeedPoller/scripts/pollfeed.php [changed mode: 0644->0755]
plugins/GeoURL/GeoURLPlugin.php
plugins/Gravatar/GravatarPlugin.php [deleted file]
plugins/Gravatar/README [deleted file]
plugins/Gravatar/locale/Gravatar.pot [deleted file]
plugins/Gravatar/locale/af/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ar/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/arz/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ast/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/be-tarask/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/bg/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/br/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ca/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/cs/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/da/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/de/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/el/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/en_GB/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/eo/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/es/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/eu/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/fa/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/fi/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/fr/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/fur/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/gl/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/he/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/hsb/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/hu/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ia/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/id/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/is/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/it/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ja/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ka/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ko/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ksh/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/lb/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/lt/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/lv/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/mg/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/mk/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ml/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ms/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/my/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/nb/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ne/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/nl/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/nn/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/pl/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/pt/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/pt_BR/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ru/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/sr-ec/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/sv/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ta/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/te/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/tl/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/tr/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/uk/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/ur_PK/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/vi/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/zh_CN/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Gravatar/locale/zh_TW/LC_MESSAGES/Gravatar.po [deleted file]
plugins/Mapstraction/OpenLayers/img/cloud-popup-relative.png [changed mode: 0755->0644]
plugins/ModLog/ModLogPlugin.php
plugins/OStatus/OStatusPlugin.php
plugins/OStatus/extlib/phpseclib/Crypt/RC2.php [changed mode: 0755->0644]
plugins/OStatus/lib/magicenvelope.php
plugins/OStatus/scripts/fixup-shadow.php [changed mode: 0644->0755]
plugins/OStatus/scripts/gcfeeds.php [changed mode: 0644->0755]
plugins/OStatus/scripts/renew-feeds.php [changed mode: 0644->0755]
plugins/OStatus/scripts/resub-feed.php [changed mode: 0644->0755]
plugins/OStatus/scripts/rm_bad_feedsubs.php [changed mode: 0644->0755]
plugins/OStatus/scripts/testfeed.php [changed mode: 0644->0755]
plugins/OStatus/scripts/update-profile-data.php [changed mode: 0644->0755]
plugins/OStatus/scripts/update-profile.php [changed mode: 0644->0755]
plugins/OStatus/scripts/update_ostatus_profiles.php [changed mode: 0644->0755]
plugins/OStatus/tests/slap.php [changed mode: 0644->0755]
plugins/OpenID/OpenIDPlugin.php
plugins/README-plugins [deleted file]
plugins/README.md [new file with mode: 0644]
plugins/Realtime/scripts/cleanupchannels.php [changed mode: 0644->0755]
plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php
plugins/RequireValidatedEmail/scripts/registerbyemail.php [changed mode: 0644->0755]
plugins/SearchSub/actions/searchsubs.php
plugins/SearchSub/lib/searchsubmenu.php
plugins/Share/forms/repeat.php
plugins/Sitemap/scripts/updatecounts.php [changed mode: 0644->0755]
plugins/TagSub/actions/tagsubs.php
plugins/TwitterBridge/daemons/twitterdaemon.php [changed mode: 0644->0755]
plugins/TwitterBridge/scripts/initialize_notice_to_status.php [changed mode: 0644->0755]
plugins/WebFinger/WebFingerPlugin.php
plugins/doc/Plugin_development.md [new file with mode: 0644]
scripts/clearcache.php [changed mode: 0644->0755]
scripts/createsim.php [changed mode: 0644->0755]
scripts/delete_notice.php [new file with mode: 0755]
scripts/dumpschema.php [changed mode: 0644->0755]
scripts/flushrouter.php [changed mode: 0644->0755]
scripts/flushsite.php [changed mode: 0644->0755]
scripts/gnusocialversion.php [changed mode: 0644->0755]
scripts/importtwitteratom.php [changed mode: 0644->0755]
scripts/make-release.php [changed mode: 0644->0755]
scripts/makegroupadmin.php [changed mode: 0644->0755]
scripts/registeruser.php [changed mode: 0644->0755]
scripts/sessiongc.php [changed mode: 0644->0755]
scripts/settag.php [changed mode: 0644->0755]
scripts/showcache.php [changed mode: 0644->0755]
scripts/showtable.php [changed mode: 0644->0755]
scripts/uncache_users.php [changed mode: 0644->0755]
scripts/updatelocation.php [changed mode: 0644->0755]
scripts/updateurls.php [changed mode: 0644->0755]
scripts/upgrade.php [changed mode: 0644->0755]
scripts/userrole.php [changed mode: 0644->0755]
tests/atompub/atompub_test.php [changed mode: 0644->0755]
tests/oauth/oauth_post_notice.php [changed mode: 0644->0755]
theme/base/css/display.css
theme/neo-gnu/css/display.css
theme/neo-quitter/LICENSE [changed mode: 0755->0644]
theme/neo-quitter/default-avatar-mini.png [changed mode: 0755->0644]
theme/neo-quitter/default-avatar-profile.png [changed mode: 0755->0644]
theme/neo-quitter/default-avatar-stream.png [changed mode: 0755->0644]
theme/neo-quitter/favicon.ico [changed mode: 0755->0644]
theme/neo/css/display.css

index 79533b96dea55f346e0638ad899c956f34948590..d2b7015bf590f5fe36c7464ae365516278c2fb58 100644 (file)
@@ -1,7 +1,7 @@
 Plugins
 =======
 
-Beginning with the 0.7.x branch, StatusNet has supported a simple but
+GNU social supports a simple but
 powerful plugin architecture. Important events in the code are named,
 like 'StartNoticeSave', and other software can register interest
 in those events. When the events happen, the other software is called
@@ -37,7 +37,7 @@ can enable a plugin with the following line in config.php:
 
 This will look for and load files named 'ExamplePlugin.php' or
 'Example/ExamplePlugin.php' either in the plugins/ directory (for
-plugins that ship with StatusNet) or in the local/ directory (for
+plugins that ship with GNU social) or in the local/ directory (for
 plugins you write yourself or that you get from somewhere else) or
 local/plugins/.
 
index 886117e6a46096eebe99695e076179f9297b7b30..19413076b57f89231ba72f8ca333da6d06e5b065 100644 (file)
@@ -39,9 +39,7 @@ if (!defined('GNUSOCIAL')) { exit(1); }
 
 class AllAction extends ShowstreamAction
 {
-    var $notice;
-
-    protected function getStream()
+    public function getStream()
     {
         if ($this->scoped instanceof Profile && $this->scoped->isLocal() && $this->scoped->getUser()->streamModeOnly()) {
             $stream = new InboxNoticeStream($this->target, $this->scoped);
@@ -54,7 +52,7 @@ class AllAction extends ShowstreamAction
 
     function title()
     {
-        if (!empty($this->scoped) && $this->scoped->id == $this->target->id) {
+        if (!empty($this->scoped) && $this->scoped->sameAs($this->target)) {
             // TRANS: Title of a user's own start page.
             return _('Home timeline');
         } else {
@@ -71,44 +69,44 @@ class AllAction extends ShowstreamAction
                 common_local_url(
                     'ApiTimelineFriends', array(
                         'format' => 'as',
-                        'id' => $this->target->nickname
+                        'id' => $this->target->getNickname()
                     )
                 ),
                 // TRANS: %s is user nickname.
-                sprintf(_('Feed for friends of %s (Activity Streams JSON)'), $this->target->nickname)),
+                sprintf(_('Feed for friends of %s (Activity Streams JSON)'), $this->target->getNickname())),
             new Feed(Feed::RSS1,
                 common_local_url(
                     'allrss', array(
                         'nickname' =>
-                        $this->target->nickname)
+                        $this->target->getNickname())
                 ),
                 // TRANS: %s is user nickname.
-                sprintf(_('Feed for friends of %s (RSS 1.0)'), $this->target->nickname)),
+                sprintf(_('Feed for friends of %s (RSS 1.0)'), $this->target->getNickname())),
             new Feed(Feed::RSS2,
                 common_local_url(
                     'ApiTimelineFriends', array(
                         'format' => 'rss',
-                        'id' => $this->target->nickname
+                        'id' => $this->target->getNickname()
                     )
                 ),
                 // TRANS: %s is user nickname.
-                sprintf(_('Feed for friends of %s (RSS 2.0)'), $this->target->nickname)),
+                sprintf(_('Feed for friends of %s (RSS 2.0)'), $this->target->getNickname())),
             new Feed(Feed::ATOM,
                 common_local_url(
                     'ApiTimelineFriends', array(
                         'format' => 'atom',
-                        'id' => $this->target->nickname
+                        'id' => $this->target->getNickname()
                     )
                 ),
                 // TRANS: %s is user nickname.
-                sprintf(_('Feed for friends of %s (Atom)'), $this->target->nickname))
+                sprintf(_('Feed for friends of %s (Atom)'), $this->target->getNickname()))
         );
     }
 
     function showEmptyListMessage()
     {
         // TRANS: Empty list message. %s is a user nickname.
-        $message = sprintf(_('This is the timeline for %s and friends but no one has posted anything yet.'), $this->target->nickname) . ' ';
+        $message = sprintf(_('This is the timeline for %s and friends but no one has posted anything yet.'), $this->target->getNickname()) . ' ';
 
         if (common_logged_in()) {
             if ($this->target->id === $this->scoped->id) {
@@ -118,12 +116,12 @@ class AllAction extends ShowstreamAction
             } else {
                 // TRANS: %1$s is user nickname, %2$s is user nickname, %2$s is user nickname prefixed with "@".
                 // TRANS: This message contains Markdown links. Keep "](" together.
-                $message .= sprintf(_('You can try to [nudge %1$s](../%2$s) from their profile or [post something to them](%%%%action.newnotice%%%%?status_textarea=%3$s).'), $this->target->nickname, $this->target->nickname, '@' . $this->target->nickname);
+                $message .= sprintf(_('You can try to [nudge %1$s](../%2$s) from their profile or [post something to them](%%%%action.newnotice%%%%?status_textarea=%3$s).'), $this->target->getNickname(), $this->target->getNickname(), '@' . $this->target->getNickname());
             }
         } else {
             // TRANS: Encouragement displayed on empty timeline user pages for anonymous users.
             // TRANS: %s is a user nickname. This message contains Markdown links. Keep "](" together.
-            $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to them.'), $this->target->nickname);
+            $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to them.'), $this->target->getNickname());
         }
 
         $this->elementStart('div', 'guide');
@@ -134,19 +132,10 @@ class AllAction extends ShowstreamAction
     function showContent()
     {
         if (Event::handle('StartShowAllContent', array($this))) {
-
-            $profile = null;
-
-            $current_user = common_current_user();
-
-            if (!empty($current_user)) {
-                $profile = $current_user->getProfile();
-            }
-
-            if (!empty($current_user) && $current_user->streamModeOnly()) {
+            if ($this->scoped instanceof Profile && $this->scoped->isLocal() && $this->scoped->getUser()->streamModeOnly()) {
                 $nl = new PrimaryNoticeList($this->notice, $this, array('show_n'=>NOTICES_PER_PAGE));
             } else {
-                $nl = new ThreadedNoticeList($this->notice, $this, $profile);
+                $nl = new ThreadedNoticeList($this->notice, $this, $this->scoped);
             }
 
             $cnt = $nl->show();
@@ -157,7 +146,7 @@ class AllAction extends ShowstreamAction
 
             $this->pagination(
                 $this->page > 1, $cnt > NOTICES_PER_PAGE,
-                $this->page, 'all', array('nickname' => $this->target->nickname)
+                $this->page, 'all', array('nickname' => $this->target->getNickname())
             );
 
             Event::handle('EndShowAllContent', array($this));
index fee52c79ab3c7301f307865c6504b12ec39d6d5e..4b6df25048645286e97f6c12cb319d9f3e317dfe 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
-
-require_once INSTALLDIR.'/lib/rssaction.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * RSS feed for user and friends timeline.
@@ -46,52 +42,12 @@ require_once INSTALLDIR.'/lib/rssaction.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://status.net/
  */
-class AllrssAction extends Rss10Action
+class AllrssAction extends TargetedRss10Action
 {
-    var $user = null;
-
-    /**
-     * Initialization.
-     *
-     * @param array $args Web and URL arguments
-     *
-     * @return boolean false if user doesn't exist
-     *
-     */
-    function prepare($args)
-    {
-        parent::prepare($args);
-        $nickname   = $this->trimmed('nickname');
-        $this->user = User::getKV('nickname', $nickname);
-
-        if (!$this->user) {
-            // TRANS: Client error when user not found for an rss related action.
-            $this->clientError(_('No such user.'));
-        } else {
-            $this->notices = $this->getNotices($this->limit);
-            return true;
-        }
-    }
-
-    /**
-     * Get notices
-     *
-     * @param integer $limit max number of notices to return
-     *
-     * @return array notices
-     */
-    function getNotices($limit=0)
+    protected function getNotices()
     {
-        $stream = new InboxNoticeStream($this->user->getProfile());
-        $notice = $stream->getNotices(0, $limit, null, null);
-
-        $notices = array();
-
-        while ($notice->fetch()) {
-            $notices[] = clone($notice);
-        }
-
-        return $notices;
+        $stream = new InboxNoticeStream($this->target);
+        return $stream->getNotices(0, $this->limit)->fetchAll();
     }
 
      /**
@@ -101,33 +57,17 @@ class AllrssAction extends Rss10Action
      */
     function getChannel()
     {
-        $user = $this->user;
         $c    = array('url' => common_local_url('allrss',
                                              array('nickname' =>
-                                                   $user->nickname)),
+                                                   $this->target->getNickname())),
                    // TRANS: Message is used as link title. %s is a user nickname.
-                   'title' => sprintf(_('%s and friends'), $user->nickname),
+                   'title' => sprintf(_('%s and friends'), $this->target->getNickname()),
                    'link' => common_local_url('all',
                                              array('nickname' =>
-                                                   $user->nickname)),
+                                                   $this->target->getNickname())),
                    // TRANS: Message is used as link description. %1$s is a username, %2$s is a site name.
                    'description' => sprintf(_('Updates from %1$s and friends on %2$s!'),
-                                            $user->nickname, common_config('site', 'name')));
+                                            $this->target->getNickname(), common_config('site', 'name')));
         return $c;
     }
-
-    /**
-     * Get image.
-     *
-     * @return string user avatar URL or null
-     */
-    function getImage()
-    {
-        $user    = $this->user;
-        $profile = $user->getProfile();
-        if (!$profile) {
-            return null;
-        }
-        return $profile->avatarUrl(AVATAR_PROFILE_SIZE);
-    }
 }
index b3f17d0712019c9578f92f5fd8aa6dccbfe4b0f2..1184440c7ddd9742f8388ad84130e61b8e53d9e5 100644 (file)
@@ -51,19 +51,10 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction
 {
     var $notices = null;
 
-    /**
-     * Take arguments for running
-     *
-     * @param array $args $_REQUEST args
-     *
-     * @return boolean success flag
-     */
-    function prepare($args)
+    protected function prepare(array $args=array())
     {
         parent::prepare($args);
 
-        common_debug("apitimelinetag prepare()");
-
         $this->tag     = $this->arg('tag');
         $this->notices = $this->getNotices();
 
@@ -79,9 +70,9 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction
      *
      * @return void
      */
-    function handle($args)
+    protected function handle()
     {
-        parent::handle($args);
+        parent::handle();
         $this->showTimeline();
     }
 
@@ -172,21 +163,12 @@ class ApiTimelineTagAction extends ApiPrivateAuthAction
      */
     function getNotices()
     {
-        $notices = array();
-
-        $notice = Notice_tag::getStream(
-            $this->tag,
-            ($this->page - 1) * $this->count,
-            $this->count + 1,
-            $this->since_id,
-            $this->max_id
-        );
-
-        while ($notice->fetch()) {
-            $notices[] = clone($notice);
-        }
+        $notice = Notice_tag::getStream($this->tag)->getNotices(($this->page - 1) * $this->count,
+                                                                 $this->count + 1,
+                                                                 $this->since_id,
+                                                                 $this->max_id);
 
-        return $notices;
+        return $notice->fetchAll();
     }
 
     /**
index eb84b4f3ae5d877281e4d205bf4ebc5fa42359b9..40b276a34895e664c2801fc4b741a876ae378360 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 // @todo FIXME: documentation needed.
-class DeletenoticeAction extends Action
+class DeletenoticeAction extends FormAction
 {
-    var $error        = null;
-    var $user         = null;
-    var $notice       = null;
-    var $profile      = null;
-    var $user_profile = null;
+    protected $notice = null;
 
-    function prepare($args)
+    protected function doPreparation()
     {
-        parent::prepare($args);
-
-        $this->user   = common_current_user();
-
-        if (!$this->user) {
-            // TRANS: Error message displayed when trying to perform an action that requires a logged in user.
-            common_user_error(_('Not logged in.'));
-            exit;
-        }
-
-        $notice_id    = $this->trimmed('notice');
-        $this->notice = Notice::getKV($notice_id);
-
-        if (!$this->notice) {
-            // TRANS: Error message displayed trying to delete a non-existing notice.
-            common_user_error(_('No such notice.'));
-            exit;
-        }
-
-        $this->profile      = $this->notice->getProfile();
-        $this->user_profile = $this->user->getProfile();
+        $this->notice = Notice::getByID($this->trimmed('notice'));
 
-        return true;
-    }
-
-    function handle($args)
-    {
-        parent::handle($args);
-
-        if ($this->notice->profile_id != $this->user_profile->id &&
-                   !$this->user->hasRight(Right::DELETEOTHERSNOTICE)) {
+        if (!$this->scoped->sameAs($this->notice->getProfile()) &&
+                   !$this->scoped->hasRight(Right::DELETEOTHERSNOTICE)) {
             // TRANS: Error message displayed trying to delete a notice that was not made by the current user.
-            common_user_error(_('Cannot delete this notice.'));
-            exit;
+            $this->clientError(_('Cannot delete this notice.'));
         }
-        // XXX: Ajax!
 
-        if ($_SERVER['REQUEST_METHOD'] == 'POST') {
-            $this->deleteNotice();
-        } else if ($_SERVER['REQUEST_METHOD'] == 'GET') {
-            $this->showForm();
-        }
-    }
-
-    /**
-     * Show the page notice
-     *
-     * Shows instructions for the page
-     *
-     * @return void
-     */
-    function showPageNotice()
-    {
-        $instr  = $this->getInstructions();
-        $output = common_markup_to_html($instr);
-
-        $this->elementStart('div', 'instructions');
-        $this->raw($output);
-        $this->elementEnd('div');
+        $this->formOpts['notice'] = $this->notice;
     }
 
     function getInstructions()
@@ -117,84 +61,17 @@ class DeletenoticeAction extends Action
         return _('Delete notice');
     }
 
-    /**
-     * Wrapper for showing a page
-     *
-     * Stores an error and shows the page
-     *
-     * @param string $error Error, if any
-     *
-     * @return void
-     */
-    function showForm($error = null)
-    {
-        $this->error = $error;
-        $this->showPage();
-    }
-
-    /**
-     * Insert delete notice form into the content
-     *
-     * @return void
-     */
-    function showContent()
-    {
-        $this->elementStart('form', array('id' => 'form_notice_delete',
-                                          'class' => 'form_settings',
-                                          'method' => 'post',
-                                          'action' => common_local_url('deletenotice')));
-        $this->elementStart('fieldset');
-        // TRANS: Fieldset legend for the delete notice form.
-        $this->element('legend', null, _('Delete notice'));
-        $this->hidden('token', common_session_token());
-        $this->hidden('notice', $this->trimmed('notice'));
-        // TRANS: Message for the delete notice form.
-        $this->element('p', null, _('Are you sure you want to delete this notice?'));
-        $this->submit('form_action-no',
-                      // TRANS: Button label on the delete notice form.
-                      _m('BUTTON','No'),
-                      'submit form_action-primary',
-                      'no',
-                      // TRANS: Submit button title for 'No' when deleting a notice.
-                      _('Do not delete this notice.'));
-        $this->submit('form_action-yes',
-                      // TRANS: Button label on the delete notice form.
-                      _m('BUTTON','Yes'),
-                      'submit form_action-secondary',
-                      'yes',
-                      // TRANS: Submit button title for 'Yes' when deleting a notice.
-                      _('Delete this notice.'));
-        $this->elementEnd('fieldset');
-        $this->elementEnd('form');
-    }
-
-    function deleteNotice()
+    protected function doPost()
     {
-        // CSRF protection
-        $token = $this->trimmed('token');
-
-        if (!$token || $token != common_session_token()) {
-            // TRANS: Client error displayed when the session token does not match or is not given.
-            $this->showForm(_('There was a problem with your session token. ' .
-                              'Try again, please.'));
-            return;
-        }
-
         if ($this->arg('yes')) {
-            if (Event::handle('StartDeleteOwnNotice', array($this->user, $this->notice))) {
+            if (Event::handle('StartDeleteOwnNotice', array($this->scoped->getUser(), $this->notice))) {
                 $this->notice->delete();
-                Event::handle('EndDeleteOwnNotice', array($this->user, $this->notice));
+                Event::handle('EndDeleteOwnNotice', array($this->scoped->getUser(), $this->notice));
             }
-        }
-
-        $url = common_get_returnto();
-
-        if ($url) {
-            common_set_returnto(null);
         } else {
-            $url = common_local_url('public');
+            common_redirect(common_get_returnto(), 303);
         }
 
-        common_redirect($url, 303);
+        common_redirect(common_local_url('top'), 303);
     }
 }
index bcdc86d886c97348ce42d74c5280552a389654a9..260388ba447b72819ea0f908e4da35e9ade80391 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 define('LISTENER', 1);
 define('LISTENEE', -1);
 define('BOTH', 0);
 
 // @todo XXX: Documentation missing.
-class FoafAction extends Action
+class FoafAction extends ManagedAction
 {
     function isReadOnly($args)
     {
         return true;
     }
 
-    function prepare($args)
+    protected function doPreparation()
     {
-        parent::prepare($args);
-
         $nickname_arg = $this->arg('nickname');
 
         if (empty($nickname_arg)) {
@@ -69,10 +67,8 @@ class FoafAction extends Action
         return true;
     }
 
-    function handle($args)
+    public function showPage()
     {
-        parent::handle($args);
-
         header('Content-Type: application/rdf+xml');
 
         $this->startXML();
index 87e34d73f80eccb6eb9020bd5ac005a606dea475..14d85d89cd9e5c06a8ceed43e85011289a11620e 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
-
-require_once INSTALLDIR.'/lib/rssaction.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 define('MEMBERS_PER_SECTION', 27);
 
@@ -45,10 +41,10 @@ define('MEMBERS_PER_SECTION', 27);
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  */
-class groupRssAction extends Rss10Action
+class GroupRssAction extends TargetedRss10Action
 {
     /** group we're viewing. */
-    var $group = null;
+    protected $group = null;
 
     /**
      * Is this page read-only?
@@ -60,18 +56,8 @@ class groupRssAction extends Rss10Action
         return true;
     }
 
-    /**
-     * Prepare the action
-     *
-     * Reads and validates arguments and instantiates the attributes.
-     *
-     * @param array $args $_REQUEST args
-     *
-     * @return boolean success flag
-     */
-    function prepare($args)
+    protected function doStreamPreparation()
     {
-        parent::prepare($args);
 
         $nickname_arg = $this->arg('nickname');
         $nickname = common_canonical_nickname($nickname_arg);
@@ -90,52 +76,32 @@ class groupRssAction extends Rss10Action
 
         $local = Local_group::getKV('nickname', $nickname);
 
-        if (!$local) {
+        if (!$local instanceof Local_group) {
             // TRANS: Client error displayed when requesting a group RSS feed for group that does not exist.
             $this->clientError(_('No such group.'), 404);
         }
 
-        $this->group = User_group::getKV('id', $local->group_id);
-
-        if (!$this->group) {
-            // TRANS: Client error displayed when requesting a group RSS feed for an object that is not a group.
-            $this->clientError(_('No such group.'), 404);
-        }
-
-        $this->notices = $this->getNotices($this->limit);
-        return true;
+        $this->group = $local->getGroup();
+        $this->target = $this->group->getProfile();
     }
 
-    function getNotices($limit=0)
+    protected function getNotices()
     {
-        $group = $this->group;
-
-        if (is_null($group)) {
-            return null;
-        }
-
-        $notices = array();
-        $notice = $group->getNotices(0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);
-
-        while ($notice->fetch()) {
-            $notices[] = clone($notice);
-        }
-
-        return $notices;
+        $stream = $this->group->getNotices(0, $this->limit);
+        return $stream->fetchAll();
     }
 
     function getChannel()
     {
-        $group = $this->group;
         $c = array('url' => common_local_url('grouprss',
                                              array('nickname' =>
-                                                   $group->nickname)),
+                                                   $this->target->getNickname())),
                    // TRANS: Message is used as link title. %s is a user nickname.
-                   'title' => sprintf(_('%s timeline'), $group->nickname),
-                   'link' => common_local_url('showgroup', array('nickname' => $group->nickname)),
+                   'title' => sprintf(_('%s timeline'), $this->target->getNickname()),
+                   'link' => common_local_url('showgroup', array('nickname' => $this->target->getNickname())),
                    // TRANS: Message is used as link description. %1$s is a group name, %2$s is a site name.
                    'description' => sprintf(_('Updates from members of %1$s on %2$s!'),
-                                            $group->nickname, common_config('site', 'name')));
+                                            $this->target->getNickname(), common_config('site', 'name')));
         return $c;
     }
 
index 60aec3c83a48d37a21bf435fff4d0da2aa513424..5394a38c9fb573684ae8e28ff3ad95c0210f666a 100644 (file)
@@ -63,7 +63,7 @@ class LogoutAction extends ManagedAction
         }
         Event::handle('EndLogout', array($this));
 
-        common_redirect(common_local_url('startpage'));
+        common_redirect(common_local_url('top'));
     }
 
     // Accessed through the action on events
index 14c280f62cfd3f973f5c64703ce0734b16949c6c..2a5187b885dba53f440a1553fb1fc2eb3a261fb0 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
-
-require_once INSTALLDIR.'/lib/rssaction.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * RSS feed for notice search action class.
@@ -48,19 +44,7 @@ require_once INSTALLDIR.'/lib/rssaction.php';
  */
 class NoticesearchrssAction extends Rss10Action
 {
-    function init()
-    {
-        return true;
-    }
-
-    function prepare($args)
-    {
-        parent::prepare($args);
-        $this->notices = $this->getNotices();
-        return true;
-    }
-
-    function getNotices($limit=0)
+    protected function getNotices()
     {
         $q = $this->trimmed('q');
         $notices = array();
@@ -70,8 +54,7 @@ class NoticesearchrssAction extends Rss10Action
         $search_engine = $notice->getSearchEngine('notice');
         $search_engine->set_sort_mode('chron');
 
-        if (!$limit) $limit = 20;
-        $search_engine->limit(0, $limit, true);
+        $search_engine->limit(0, $this->limit, true);
         if (false === $search_engine->query($q)) {
             $cnt = 0;
         } else {
index ec8aed8a22133239226d7be87dc94af36f6ddfd0..26a03cd046e0cd84ce42d39b3fddd584d44b7a8f 100644 (file)
@@ -62,7 +62,7 @@ class PluginsadminpanelAction extends AdminPanelAction
     {
         // TRANS: Instructions at top of plugin admin page.
         return _('Additional plugins can be enabled and configured manually. ' .
-                 'See the <a href="http://status.net/wiki/Plugins">online plugin ' .
+                 'See the <a href="https://git.gnu.io/gnu/gnu-social/blob/master/plugins/README.md">online plugin ' .
                  'documentation</a> for more details.');
     }
 
index 11db3b37a48c57a3252323fa358c670215a8970e..5dcff3ba3d2f973c11118c90ae7e20c7ad9c1678 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
-
-require_once INSTALLDIR.'/lib/rssaction.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * RSS feed for public timeline.
@@ -48,29 +44,6 @@ require_once INSTALLDIR.'/lib/rssaction.php';
  */
 class PublicrssAction extends Rss10Action
 {
-    /**
-     * Read arguments and initialize members
-     *
-     * @param array $args Arguments from $_REQUEST
-     * @return boolean success
-     */
-    function prepare($args)
-    {
-        parent::prepare($args);
-        $this->notices = $this->getNotices($this->limit);
-        return true;
-    }
-
-    /**
-     * Initialization.
-     *
-     * @return boolean true
-     */
-    function init()
-    {
-        return true;
-    }
-
     /**
      * Get notices
      *
@@ -78,15 +51,10 @@ class PublicrssAction extends Rss10Action
      *
      * @return array notices
      */
-    function getNotices($limit=0)
+    protected function getNotices()
     {
-        $notices = array();
-        $notice  = Notice::publicStream(0, ($limit == 0) ? 48 : $limit);
-        while ($notice->fetch()) {
-            $notices[] = clone($notice);
-        }
-
-        return $notices;
+        $stream  = Notice::publicStream(0, $this->limit);
+        return $stream->fetchAll();
     }
 
      /**
index 4befa4ab840c843c014c712f2b4d3e6e611593f1..db3784bf31d70b4bb09f9eb816ec107d5225c863 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    // This check helps protect against security problems;
-    // your code file can't be executed directly from the web.
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Redirect to a given URL
@@ -47,75 +43,27 @@ if (!defined('STATUSNET')) {
  * @link      http://status.net/
  */
 
-class RedirecturlAction extends Action
+class RedirecturlAction extends ManagedAction
 {
-    protected $id   = null;
     protected $file = null;
 
-    /**
-     * For initializing members of the class.
-     *
-     * @param array $argarray misc. arguments
-     *
-     * @return boolean true
-     */
-    function prepare($argarray)
+    protected function doPreparation()
     {
-        parent::prepare($argarray);
-
-        $this->id = $this->trimmed('id');
-
-        if (empty($this->id)) {
-            // TRANS: Client exception thrown when no ID parameter was provided.
-            throw new ClientException(_('No id parameter.'));
-        }
-
-        $this->file = File::getKV('id', $this->id);
-
-        if (empty($this->file)) {
-            // TRANS: Client exception thrown when an invalid ID parameter was provided for a file.
-            // TRANS: %d is the provided ID for which the file is not present (number).
-            throw new ClientException(sprintf(_('No such file "%d".'),
-                                              $this->id),
-                                      404);
-        }
+        $this->file = File::getByID($this->int('id'));
 
         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);
     }
 
-    /**
-     * Return true if read only.
-     *
-     * MAY override
-     *
-     * @param array $args other arguments
-     *
-     * @return boolean is read only action?
-     */
     function isReadOnly($args)
     {
         return true;
     }
 
-    /**
-     * Return last modified, if applicable.
-     *
-     * MAY override
-     *
-     * @return string last modified http header
-     */
     function lastModified()
     {
         // For comparison with If-Last-Modified
@@ -133,9 +81,9 @@ class RedirecturlAction extends Action
      */
     function etag()
     {
-        return 'W/"' . implode(':', array($this->arg('action'),
+        return 'W/"' . implode(':', array($this->getActionName(),
                                           common_user_cache_hash(),
                                           common_language(),
-                                          $this->file->id)) . '"';
+                                          $this->file->getID())) . '"';
     }
 }
index 3c7e950d012e1a8d9c518f3b2e4ee28d790ace93..ae6ec90658dca67272bbbc39d1734012db92deee 100644 (file)
@@ -40,10 +40,7 @@ if (!defined('GNUSOCIAL')) { exit(1); }
  */
 class RepliesAction extends ShowstreamAction
 {
-    var $page = null;
-    var $notice;
-
-    protected function getStream()
+    public function getStream()
     {
         return new ReplyNoticeStream($this->target->getID(), $this->scoped);
     }
@@ -85,7 +82,7 @@ class RepliesAction extends ShowstreamAction
                               // TRANS: Link for feed with replies for a user.
                               // TRANS: %s is a user nickname.
                               sprintf(_('Replies feed for %s (Activity Streams JSON)'),
-                                      $this->user->nickname)),
+                                      $this->target->getNickname())),
                      new Feed(Feed::RSS1,
                               common_local_url('repliesrss',
                                                array('nickname' => $this->target->getNickname())),
index 145b51aaea99dfc58cb252c7c1210897dd773a39..54f83592c0ffa0dc0eca90a44d365c6aa9d38dc5 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
-
-require_once(INSTALLDIR.'/lib/rssaction.php');
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 // Formatting of RSS handled by Rss10Action
 
-class RepliesrssAction extends Rss10Action
+class RepliesrssAction extends TargetedRss10Action
 {
-    var $user = null;
-
-    function prepare($args)
+    protected function getNotices()
     {
-        parent::prepare($args);
-        $nickname = $this->trimmed('nickname');
-        $this->user = User::getKV('nickname', $nickname);
-
-        if (!$this->user) {
-            // TRANS: Client error displayed when providing a non-existing nickname in a RSS 1.0 action.
-            $this->clientError(_('No such user.'));
-        } else {
-            $this->notices = $this->getNotices($this->limit);
-            return true;
-        }
-    }
-
-    function getNotices($limit=0)
-    {
-        $user = $this->user;
-
-        $notice = $user->getReplies(0, ($limit == 0) ? 48 : $limit);
-
-        $notices = array();
-
-        while ($notice->fetch()) {
-            $notices[] = clone($notice);
-        }
-
-        return $notices;
+        $stream = $this->target->getReplies(0, $this->limit);
+        return $stream->fetchAll();
     }
 
     function getChannel()
     {
-        $user = $this->user;
         $c = array('url' => common_local_url('repliesrss',
                                              array('nickname' =>
-                                                   $user->nickname)),
+                                                   $this->target->getNickname())),
                    // TRANS: RSS reply feed title. %s is a user nickname.
-                   'title' => sprintf(_("Replies to %s"), $user->nickname),
+                   'title' => sprintf(_("Replies to %s"), $this->target->getNickname()),
                    'link' => common_local_url('replies',
-                                              array('nickname' =>
-                                                    $user->nickname)),
+                                              array('nickname' => $this->target->getNickname())),
                    // TRANS: RSS reply feed description.
                    // TRANS: %1$s is a user nickname, %2$s is the StatusNet site name.
                    'description' => sprintf(_('Replies to %1$s on %2$s.'),
-                                              $user->nickname, common_config('site', 'name')));
+                                              $this->target->getNickname(), common_config('site', 'name')));
         return $c;
     }
 
-    function getImage()
-    {
-        $profile = $this->user->getProfile();
-        return $profile->avatarUrl(AVATAR_PROFILE_SIZE);
-    }
-
     function isReadOnly($args)
     {
         return true;
index d686042cb12fe8e52a2a74a4fb910c1a57a05582..fdfc2bd1bd650cdee7bbaf76d3c03a3a642619e7 100644 (file)
@@ -27,9 +27,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Prints out a static robots.txt
@@ -40,19 +38,9 @@ if (!defined('STATUSNET')) {
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://status.net/
  */
-class RobotstxtAction extends Action
+class RobotstxtAction extends ManagedAction
 {
-    /**
-     * Handles requests
-     *
-     * Since this is a relatively static document, we
-     * don't do a prepare()
-     *
-     * @param array $args GET, POST, and URL params; unused.
-     *
-     * @return void
-     */
-    function handle($args)
+    public function showPage()
     {
         if (Event::handle('StartRobotsTxt', array($this))) {
 
index 8e8b055b4b4749b3a51ad7248963386bb4aecccc..51384eb487534a5f508fa63b23573018bee3cffe 100644 (file)
@@ -45,18 +45,17 @@ 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 ShowstreamAction extends ProfileAction
+class ShowstreamAction extends NoticestreamAction
 {
-    var $notice;
+    protected $target = null;
 
     protected function doPreparation()
     {
         // showstream requires a nickname
-        $nickname_arg = $this->arg('nickname');
+        $nickname_arg = $this->trimmed('nickname');
         $nickname     = common_canonical_nickname($nickname_arg);
 
         // Permanent redirect on non-canonical nickname
-
         if ($nickname_arg != $nickname) {
             $args = array('nickname' => $nickname);
             if ($this->arg('page') && $this->arg('page') != 1) {
@@ -64,32 +63,23 @@ class ShowstreamAction extends ProfileAction
             }
             common_redirect(common_local_url($this->getActionName(), $args), 301);
         }
-        $this->user = User::getKV('nickname', $nickname);
 
-        if (!$this->user) {
+        try {
+            $user = User::getByNickname($nickname);
+        } catch (NoSuchUserException $e) {
             $group = Local_group::getKV('nickname', $nickname);
             if ($group instanceof Local_group) {
                 common_redirect($group->getProfile()->getUrl());
             }
-            // TRANS: Client error displayed when calling a profile action without specifying a user.
-            $this->clientError(_('No such user.'), 404);
-        }
-
-        $this->target = $this->user->getProfile();
-    }
 
-    protected function profileActionPreparation()
-    {
-        $stream = $this->getStream();
-        $this->notice = $stream->getNotices(($this->page-1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
-
-        if ($this->page > 1 && $this->notice->N == 0) {
-            // TRANS: Client error when page not found (404).
-            $this->clientError(_('No such page.'), 404);
+            // No user nor group found, throw the NoSuchUserException again
+            throw $e;
         }
+
+        $this->target = $user->getProfile();
     }
 
-    protected function getStream()
+    public function getStream()
     {
         if (empty($this->tag)) {
             $stream = new ProfileNoticeStream($this->target, $this->scoped);
@@ -300,7 +290,7 @@ class ShowstreamAction extends ProfileAction
     {
         parent::showSections();
         if (!common_config('performance', 'high')) {
-            $cloud = new PersonalTagCloudSection($this, $this->user);
+            $cloud = new PersonalTagCloudSection($this->target, $this);
             $cloud->show();
         }
     }
@@ -309,7 +299,7 @@ class ShowstreamAction extends ProfileAction
     {
         $options = parent::noticeFormOptions();
 
-        if (!$this->scoped instanceof Profile || $this->scoped->id != $this->target->id) {
+        if (!$this->scoped instanceof Profile || !$this->scoped->sameAs($this->target)) {
             $options['to_profile'] =  $this->target;
         }
 
diff --git a/actions/startpage.php b/actions/startpage.php
deleted file mode 100644 (file)
index 9ce00d9..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Startpage action. Decides what to show on the first page.
- */
-
-if (!defined('GNUSOCIAL')) { exit(1); }
-
-class StartpageAction extends ManagedAction
-{
-    function isReadOnly($args)
-    {
-        return true;
-    }
-
-    function showPage()
-    {
-        if (common_config('singleuser', 'enabled')) {
-            $user = User::singleUser();
-            common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)), 303);
-        } elseif (common_config('public', 'localonly')) {
-            common_redirect(common_local_url('public'), 303);
-        } else {
-            common_redirect(common_local_url('networkpublic'), 303);
-        }
-    }
-}
index 231a697230601822f3eaf3c4ff2f28fad80de05e..b5734b3747ee38900339a480fc2858b25190a1c7 100644 (file)
@@ -28,9 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * A list of the user's subscriptions
@@ -60,7 +58,7 @@ class SubscriptionsAction extends GalleryAction
 
     function showPageNotice()
     {
-        if ($this->scoped instanceof Profile && $this->scoped->id === $this->target->id) {
+        if ($this->scoped instanceof Profile && $this->scoped->sameAs($this->getTarget())) {
             $this->element('p', null,
                            // TRANS: Page notice for page with an overview of all subscriptions
                            // TRANS: of the logged in user's own profile.
index 09de8b3c25638973434ced16539b2c5e78716c42..751e8dcec52e92ef65c5a5bdce6ba4ce1159109b 100644 (file)
@@ -46,7 +46,8 @@ class TagAction extends ManagedAction
 
         common_set_returnto($this->selfUrl());
 
-        $this->notice = Notice_tag::getStream($this->tag, (($this->page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1);
+        $this->notice = Notice_tag::getStream($this->tag)->getNotices(($this->page-1)*NOTICES_PER_PAGE,
+                                                                       NOTICES_PER_PAGE + 1);
 
         if($this->page > 1 && $this->notice->N == 0){
             // TRANS: Client error when page not found (404).
index 468944d11f117a99c4819c693e99dc57bb367bec..0d4d68ffba1c4c7594ab12b90a75eb6b0c38ac52 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
-
-require_once(INSTALLDIR.'/lib/rssaction.php');
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 // Formatting of RSS handled by Rss10Action
+
 class TagrssAction extends Rss10Action
 {
-    var $tag;
+    protected $tag;
 
-    function prepare($args) {
-        parent::prepare($args);
+    protected function doStreamPreparation()
+    {
         $tag = common_canonical_tag($this->trimmed('tag'));
         $this->tag = Notice_tag::getKV('tag', $tag);
-        if (!$this->tag) {
+        if (!$this->tag instanceof Notice_tag) {
             // TRANS: Client error when requesting a tag feed for a non-existing tag.
             $this->clientError(_('No such tag.'));
-        } else {
-            $this->notices = $this->getNotices($this->limit);
-            return true;
         }
     }
 
-    function getNotices($limit=0)
+    protected function getNotices()
     {
-        $tag = $this->tag;
-
-        if (is_null($tag)) {
-            return null;
-        }
-
-        $notice = Notice_tag::getStream($tag->tag, 0, ($limit == 0) ? NOTICES_PER_PAGE : $limit);
-        while ($notice->fetch()) {
-            $notices[] = clone($notice);
-        }
-
-        return $notices;
+        $stream = Notice_tag::getStream($this->tag->tag)->getNotices(0, $this->limit);
+        return $stream->fetchAll();
     }
 
     function getChannel()
index 39abe3df26ff772e597a859eca0e5361f1214094..d30a40bafeebe5cf7e26d8570d785f11467b5789 100644 (file)
  * 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/>.
  *
- * @category  Top
- * @package   StatusNet
- * @author    Evan Prodromou <evan@status.net>
- * @copyright 2010 StatusNet, Inc.
- * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
- * @link      http://status.net/
- */
-
-if (!defined('STATUSNET')) {
-    // This check helps protect against security problems;
-    // your code file can't be executed directly from the web.
-    exit(1);
-}
-
-/**
- * An action to redirect to the top of the site
- *
  * @category  Action
- * @package   StatusNet
+ * @package   GNUsocial
  * @author    Evan Prodromou <evan@status.net>
+ * @author    Mikael Nordfeldth <mmn@hethane.se>
  * @copyright 2010 StatusNet, Inc.
- * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
- * @link      http://status.net/
+ * @copyright 2015 Free Software Foundation, Inc.
+ * @license   https://www.gnu.org/licenses/agpl-3.0.html AGPL 3.0
+ * @link      https://gnu.io/social
  */
 
-class TopAction extends Action
-{
-    /**
-     * For initializing members of the class.
-     *
-     * @param array $argarray misc. arguments
-     *
-     * @return boolean true
-     */
+if (!defined('GNUSOCIAL')) { exit(1); }
 
-    function prepare($argarray)
-    {
-        parent::prepare($argarray);
-        return true;
-    }
-
-    /**
-     * Handler method
-     *
-     * @param array $argarray is ignored since it's now passed in in prepare()
-     *
-     * @return void
-     */
-
-    function handle($argarray=null)
+class TopAction extends ManagedAction
+{
+    public function showPage()
     {
         if (common_config('singleuser', 'enabled')) {
-            $url = common_local_url('showstream', array('nickname' => User::singleUserNickname()));
+            $user = User::singleUser();
+            common_redirect(common_local_url('showstream', array('nickname' => $user->getNickname())), 303);
+        } elseif (common_config('public', 'localonly')) {
+            common_redirect(common_local_url('public'), 303);
         } else {
-            $url = common_local_url('public');
+            common_redirect(common_local_url('networkpublic'), 303);
         }
-
-        // XXX: Permanent? I think so.
-
-        common_redirect($url, 301);
-
-        return;
     }
 }
index fd112ba8ecba7af85d714077deee3dbce97beee9..d4756dffb5914a995eaa0feac300b48a3ab86eb3 100644 (file)
@@ -52,12 +52,12 @@ class UsergroupsAction extends GalleryAction
         if ($this->page == 1) {
             // TRANS: Page title for first page of groups for a user.
             // TRANS: %s is a nickname.
-            return sprintf(_('%s groups'), $this->user->nickname);
+            return sprintf(_('%s groups'), $this->getTarget()->getNickname());
         } else {
             // TRANS: Page title for all but the first page of groups for a user.
             // TRANS: %1$s is a nickname, %2$d is a page number.
             return sprintf(_('%1$s groups, page %2$d'),
-                           $this->user->nickname,
+                           $this->getTarget()->getNickname(),
                            $this->page);
         }
     }
@@ -82,14 +82,14 @@ class UsergroupsAction extends GalleryAction
             $offset = ($this->page-1) * GROUPS_PER_PAGE;
             $limit =  GROUPS_PER_PAGE + 1;
 
-            $groups = $this->user->getGroups($offset, $limit);
+            $groups = $this->getTarget()->getGroups($offset, $limit);
 
             if ($groups instanceof User_group) {
-                $gl = new GroupList($groups, $this->user, $this);
+                $gl = new GroupList($groups, $this->getTarget(), $this);
                 $cnt = $gl->show();
                 $this->pagination($this->page > 1, $cnt > GROUPS_PER_PAGE,
                               $this->page, 'usergroups',
-                              array('nickname' => $this->user->nickname));
+                              array('nickname' => $this->getTarget()->getNickname()));
             } else {
                 $this->showEmptyListMessage();
             }
@@ -102,11 +102,11 @@ class UsergroupsAction extends GalleryAction
     {
         // TRANS: Text on group page for a user that is not a member of any group.
         // TRANS: %s is a user nickname.
-        $message = sprintf(_('%s is not a member of any group.'), $this->user->nickname) . ' ';
+        $message = sprintf(_('%s is not a member of any group.'), $this->getTarget()->getNickname()) . ' ';
 
         if (common_logged_in()) {
             $current_user = common_current_user();
-            if ($this->user->id === $current_user->id) {
+            if ($this->scoped->sameAs($this->getTarget())) {
                 // TRANS: Text on group page for a user that is not a member of any group. This message contains
                 // TRANS: a Markdown link in the form [link text](link) and a variable that should not be changed.
                 $message .= _('Try [searching for groups](%%action.groupsearch%%) and joining them.');
@@ -119,7 +119,7 @@ class UsergroupsAction extends GalleryAction
 
     function showProfileBlock()
     {
-        $block = new AccountProfileBlock($this, $this->profile);
+        $block = new AccountProfileBlock($this, $this->getTarget());
         $block->show();
     }
 }
index 308db948918c079a9d4a1ce63463840c3b564a82..fd49a0e89904df6eff0605d3430f279005090937 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
-
-require_once(INSTALLDIR.'/lib/rssaction.php');
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 // Formatting of RSS handled by Rss10Action
 
-class UserrssAction extends Rss10Action
+class UserrssAction extends TargetedRss10Action
 {
-    var $tag  = null;
+    protected $tag = null;
 
-    function prepare($args)
+    protected function doStreamPreparation()
     {
-        parent::prepare($args);
-        $nickname   = $this->trimmed('nickname');
-        $this->user = User::getKV('nickname', $nickname);
         $this->tag  = $this->trimmed('tag');
-
-        if (!$this->user) {
-            // TRANS: Client error displayed when user not found for an action.
-            $this->clientError(_('No such user.'));
-        }
-
-        if (!empty($this->tag)) {
-            $this->notices = $this->getTaggedNotices();
-        } else {
-            $this->notices = $this->getNotices();
-        }
-
-        return true;
-    }
-
-    function getTaggedNotices()
-    {
-        $notice = $this->user->getTaggedNotices(
-            $this->tag,
-            0,
-            ($this->limit == 0) ? NOTICES_PER_PAGE : $this->limit,
-            0,
-            0
-        );
-
-        $notices = array();
-        while ($notice->fetch()) {
-            $notices[] = clone($notice);
-        }
-
-        return $notices;
     }
 
-
-    function getNotices()
+    protected function getNotices()
     {
-        $notice = $this->user->getNotices(
-            0,
-            ($this->limit == 0) ? NOTICES_PER_PAGE : $this->limit
-        );
-
-        $notices = array();
-        while ($notice->fetch()) {
-            $notices[] = clone($notice);
+        if (!empty($this->tag)) {
+            $stream = $this->target->getTaggedNotices($this->tag, 0, $this->limit);
+            return $stream->fetchAll();
         }
+        // otherwise we fetch a normal user stream
 
-        return $notices;
+        $stream = $this->target->getNotices(0, $this->limit);
+        return $stream->fetchAll();
     }
 
     function getChannel()
     {
-        $user = $this->user;
-        $profile = $user->getProfile();
         $c = array('url' => common_local_url('userrss',
                                              array('nickname' =>
-                                                   $user->nickname)),
+                                                   $this->target->getNickname())),
                    // TRANS: Message is used as link title. %s is a user nickname.
-                   'title' => sprintf(_('%s timeline'), $user->nickname),
-                   'link' => $profile->profileurl,
+                   'title' => sprintf(_('%s timeline'), $this->target->getNickname()),
+                   'link' => $this->target->getUrl(),
                    // TRANS: Message is used as link description. %1$s is a username, %2$s is a site name.
                    'description' => sprintf(_('Updates from %1$s on %2$s!'),
-                                            $user->nickname, common_config('site', 'name')));
+                                            $this->target->getNickname(), common_config('site', 'name')));
         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)
index ba516e462325698847294a89cf965bb7f395b214..2b6f86ed2728beb507d8a63bc09d7fec98de224f 100644 (file)
@@ -166,7 +166,7 @@ class File_redirection extends Managed_DataObject
      *                size (optional): byte size from Content-Length header
      *                time (optional): timestamp from Last-Modified header
      */
-    public function where($in_url, $discover=true) {
+    static function where($in_url, $discover=true) {
         // let's see if we know this...
         try {
             $a = File::getByUrl($in_url);
@@ -176,7 +176,7 @@ class File_redirection extends Managed_DataObject
             try {
                 $b = File_redirection::getByUrl($in_url);
                 // this is a redirect to $b->file_id
-                $a = File::getKV('id', $b->file_id);
+                $a = File::getByID($b->file_id);
                 return $a->url;
             } catch (NoResultException $e) {
                 // Oh well, let's keep going
@@ -186,10 +186,10 @@ class File_redirection extends Managed_DataObject
         if ($discover) {
             $ret = File_redirection::lookupWhere($in_url);
             return $ret;
-        } else {
-            // No manual dereferencing; leave the unknown URL as is.
-            return $in_url;
         }
+
+        // No manual dereferencing; leave the unknown URL as is.
+        return $in_url;
     }
 
     /**
@@ -206,7 +206,7 @@ class File_redirection extends Managed_DataObject
      * @param User $user whose shortening options to use; defaults to the current web session user
      * @return string
      */
-    function makeShort($long_url, $user=null)
+    static function makeShort($long_url, $user=null)
     {
         $canon = File_redirection::_canonUrl($long_url);
 
@@ -214,11 +214,7 @@ class File_redirection extends Managed_DataObject
 
         // Did we get one? Is it shorter?
 
-        if (!empty($short_url)) {
-            return $short_url;
-        } else {
-            return $long_url;
-        }
+        return !empty($short_url) ? $short_url : $long_url;
     }
 
     /**
@@ -235,18 +231,14 @@ class File_redirection extends Managed_DataObject
      * @return string
      */
 
-    function forceShort($long_url, $user)
+    static function forceShort($long_url, $user)
     {
         $canon = File_redirection::_canonUrl($long_url);
 
         $short_url = File_redirection::_userMakeShort($canon, $user, true);
 
         // Did we get one? Is it shorter?
-        if (!empty($short_url)) {
-            return $short_url;
-        } else {
-            return $long_url;
-        }
+        return !empty($short_url) ? $short_url : $long_url;
     }
 
     static function _userMakeShort($long_url, User $user=null, $force = false) {
index 9e95102d8503753a034bc28ee9fd53da391436cd..1cebd4c40c3a777bbb31b95ab8dcf3230485c0f2 100644 (file)
@@ -50,7 +50,7 @@ class Local_group extends Managed_DataObject
         $group->find(true);
         if (!$group instanceof User_group) {
             common_log(LOG_ERR, 'User_group does not exist for Local_group: '.$this->group_id);
-            throw new NoResultException($group);
+            throw new NoSuchGroupException(array('id' => $this->group_id));
         }
         return $group;
     }
index 8c9957958b943a9ef9cac8a8c289549a520e9df8..ae722138b33b91b4a7652dfed5ecb6330c104d55 100644 (file)
@@ -1203,17 +1203,15 @@ class Notice extends Managed_DataObject
            $this->_attachments[$this->id] = $attachments;
        }
 
-    function publicStream($offset=0, $limit=20, $since_id=0, $max_id=0)
+    static function publicStream($offset=0, $limit=20, $since_id=null, $max_id=null)
     {
         $stream = new PublicNoticeStream();
         return $stream->getNotices($offset, $limit, $since_id, $max_id);
     }
 
-
-    function conversationStream($id, $offset=0, $limit=20, $since_id=0, $max_id=0)
+    static function conversationStream($id, $offset=0, $limit=20, $since_id=null, $max_id=null)
     {
         $stream = new ConversationNoticeStream($id);
-
         return $stream->getNotices($offset, $limit, $since_id, $max_id);
     }
 
@@ -1225,18 +1223,17 @@ class Notice extends Managed_DataObject
      */
     function hasConversation()
     {
-        if (!empty($this->conversation)) {
-            $conversation = Notice::conversationStream(
-                $this->conversation,
-                1,
-                1
-            );
-
-            if ($conversation->N > 0) {
-                return true;
-            }
+        if (empty($this->conversation)) {
+            // this notice is not part of a conversation apparently
+            // FIXME: all notices should have a conversation value, right?
+            return false;
         }
-        return false;
+
+        $stream = new ConversationNoticeStream($this->conversation);
+        $notice = $stream->getNotices(/*offset*/ 1, /*limit*/ 1);
+
+        // if our "offset 1, limit 1" query got a result, return true else false
+        return $notice->N > 0;
     }
 
     /**
@@ -1271,8 +1268,7 @@ class Notice extends Managed_DataObject
             $root = new Notice;
             $root->conversation = $this->conversation;
             $root->orderBy('notice.created ASC');
-            $root->find();
-            $root->fetch();
+            $root->find(true);  // true means "fetch first result"
             $root->free();
             return $root;
         }
@@ -2193,7 +2189,7 @@ class Notice extends Managed_DataObject
         return $notice->fetchAll('id');
     }
 
-    function locationOptions($lat, $lon, $location_id, $location_ns, $profile = null)
+    static function locationOptions($lat, $lon, $location_id, $location_ns, $profile = null)
     {
         $options = array();
 
index 3d7658a1acfe19ed64e08f2c0d6ee152f43c2e4c..b864de80092b31001b03a8048519b0ab97b6e5ee 100644 (file)
@@ -56,8 +56,7 @@ class Notice_tag extends Managed_DataObject
     static function getStream($tag, $offset=0, $limit=20, $sinceId=0, $maxId=0)
     {
         $stream = new TagNoticeStream($tag);
-        
-        return $stream->getNotices($offset, $limit, $sinceId, $maxId);
+        return $stream;
     }
 
     function blowCache($blowLast=false)
index b5ba00caa9e24dc625e61efb88ab85e5962baedf..f628965a7482a1be41b054e76fdf3def1e16651a 100644 (file)
@@ -242,6 +242,11 @@ class Profile extends Managed_DataObject
         return null;
     }
 
+    function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0)
+    {
+        return Reply::stream($this->getID(), $offset, $limit, $since_id, $before_id);
+    }
+
     function getTaggedNotices($tag, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0)
     {
         $stream = new TaggedProfileNoticeStream($this, $tag);
@@ -1566,6 +1571,11 @@ class Profile extends Managed_DataObject
         return $this;
     }
 
+    public function sameAs(Profile $other)
+    {
+        return $this->getID() === $other->getID();
+    }
+
     /**
      * This will perform shortenLinks with the connected User object.
      *
index 36686d0c76d6cb579edebba1af0eb72bca3b27d4..d3405e6581c26213a9d658e5e8408ef9c2912a71 100644 (file)
@@ -55,10 +55,9 @@ class Reply extends Managed_DataObject
         return $result;
     }
 
-    function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0)
+    static function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $max_id=0)
     {
         $stream = new ReplyNoticeStream($user_id);
-
         return $stream->getNotices($offset, $limit, $since_id, $max_id);
     }
 }
index 878fcf5796968028b7464b441a00aeb9e1eaf2a2..a60293e2158e9bf8b42ff6f01ff079b1a9056c1b 100644 (file)
@@ -47,10 +47,10 @@ class Subscription_queue extends Managed_DataObject
         return $rq;
     }
 
-    public function exists(Profile $subscriber, Profile $other)
+    static function exists(Profile $subscriber, Profile $other)
     {
-        $sub = Subscription_queue::pkeyGet(array('subscriber' => $subscriber->id,
-                                                 'subscribed' => $other->id));
+        $sub = Subscription_queue::pkeyGet(array('subscriber' => $subscriber->getID(),
+                                                 'subscribed' => $other->getID()));
         return ($sub instanceof Subscription_queue);
     }
 
index 3efaa5e72131b5ba7cda2262ba4e4879d0277b1d..ec6ceccf1244c79e6c48f608b4b274488274dc4a 100644 (file)
@@ -132,6 +132,11 @@ class User extends Managed_DataObject
         return $this->_profile[$this->id];
     }
 
+    public function sameAs(Profile $other)
+    {
+        return $this->getProfile()->sameAs($other);
+    }
+
     public function getUri()
     {
         return $this->uri;
@@ -142,6 +147,16 @@ class User extends Managed_DataObject
         return $this->getProfile()->getNickname();
     }
 
+    static function getByNickname($nickname)
+    {
+        $user = User::getKV('nickname', $nickname);
+        if (!$user instanceof User) {
+            throw new NoSuchUserException(array('nickname' => $nickname));
+        }
+
+        return $user;
+    }
+
     function isSubscribed(Profile $other)
     {
         return $this->getProfile()->isSubscribed($other);
@@ -439,7 +454,7 @@ class User extends Managed_DataObject
 
     function getReplies($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0)
     {
-        return Reply::stream($this->id, $offset, $limit, $since_id, $before_id);
+        return $this->getProfile()->getReplies($offset, $limit, $since_id, $before_id);
     }
 
     function getTaggedNotices($tag, $offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0) {
index d562e33f354823498e55109b8670256e92672093..9ac0c500e8c02523716fdc7f56142895694fa3f6 100644 (file)
@@ -29,7 +29,7 @@
  * identity check.
  *
  * LIBRARY DESIGN
- * 
+ *
  * This consumer library is designed with that flow in mind.  The goal
  * is to make it as easy as possible to perform the above steps
  * securely.
@@ -427,7 +427,7 @@ class Auth_OpenID_Consumer {
             $loader->fromSession($endpoint_data);
 
         $message = Auth_OpenID_Message::fromPostArgs($query);
-        $response = $this->consumer->complete($message, $endpoint, 
+        $response = $this->consumer->complete($message, $endpoint,
                                               $current_url);
         $this->session->del($this->_token_key);
 
@@ -616,6 +616,9 @@ class Auth_OpenID_GenericConsumer {
         $this->store = $store;
         $this->negotiator = Auth_OpenID_getDefaultNegotiator();
         $this->_use_assocs = (is_null($this->store) ? false : true);
+        if (get_class($this->store) == "Auth_OpenID_DumbStore") {
+            $this->_use_assocs = false;
+        }
 
         $this->fetcher = Auth_Yadis_Yadis::getHTTPFetcher();
 
@@ -666,7 +669,7 @@ class Auth_OpenID_GenericConsumer {
                                         '_completeInvalid');
 
         return call_user_func_array(array($this, $method),
-                                    array($message, &$endpoint, $return_to));
+                                    array($message, $endpoint, $return_to));
     }
 
     /**
@@ -1186,7 +1189,7 @@ class Auth_OpenID_GenericConsumer {
         list($unused, $services) = call_user_func_array($this->discoverMethod,
                                                         array(
                                                             $claimed_id,
-                                                            &$this->fetcher,
+                                                            $this->fetcher,
                                                         ));
 
         if (!$services) {
@@ -1202,7 +1205,7 @@ class Auth_OpenID_GenericConsumer {
     /**
      * @access private
      */
-    function _verifyDiscoveryServices($claimed_id, 
+    function _verifyDiscoveryServices($claimed_id,
                                       $services, $to_match_endpoints)
     {
         // Search the services resulting from discovery to find one
@@ -1210,7 +1213,7 @@ class Auth_OpenID_GenericConsumer {
 
         foreach ($services as $endpoint) {
             foreach ($to_match_endpoints as $to_match_endpoint) {
-                $result = $this->_verifyDiscoverySingle($endpoint, 
+                $result = $this->_verifyDiscoverySingle($endpoint,
                                                         $to_match_endpoint);
 
                 if (!Auth_OpenID::isFailure($result)) {
@@ -1368,7 +1371,7 @@ class Auth_OpenID_GenericConsumer {
             }
         }
         $ca_message = $message->copy();
-        $ca_message->setArg(Auth_OpenID_OPENID_NS, 'mode', 
+        $ca_message->setArg(Auth_OpenID_OPENID_NS, 'mode',
                             'check_authentication');
         return $ca_message;
     }
@@ -1606,7 +1609,7 @@ class Auth_OpenID_GenericConsumer {
 
         $expires_in = Auth_OpenID::intval($expires_in_str);
         if ($expires_in === false) {
-            
+
             $err = sprintf("Could not parse expires_in from association ".
                            "response %s", print_r($assoc_response, true));
             return new Auth_OpenID_FailureResponse(null, $err);
@@ -1953,7 +1956,7 @@ class Auth_OpenID_AuthRequest {
     function htmlMarkup($realm, $return_to=null, $immediate=false,
                         $form_tag_attrs=null)
     {
-        $form = $this->formMarkup($realm, $return_to, $immediate, 
+        $form = $this->formMarkup($realm, $return_to, $immediate,
                                   $form_tag_attrs);
 
         if (Auth_OpenID::isFailure($form)) {
index 7eec791d24c29d846d48c94f9487b88868b07797..d74f83dcb4e12b2c5a0bed27377ab6417124dedf 100644 (file)
@@ -482,7 +482,7 @@ class Auth_OpenID_FileStore extends Auth_OpenID_OpenIDStore {
         }
 
         if ($handle = opendir($dir)) {
-            while ($item = readdir($handle)) {
+            while (false !== ($item = readdir($handle))) {
                 if (!in_array($item, array('.', '..'))) {
                     if (is_dir($dir . $item)) {
 
index 7108c2faf99cf2b0e793365f40ddd565be2ce2fd..14ecbbd6f8fc619f0f80d571992b966e90d93655 100644 (file)
@@ -104,8 +104,11 @@ class Auth_OpenID_PredisStore extends Auth_OpenID_OpenIDStore {
         
         // no handle given, receiving the latest issued
         $serverKey = $this->associationServerKey($server_url);
-        $lastKey = $this->redis->lpop($serverKey);
-        if (!$lastKey) { return null; }
+        $lastKey = $this->redis->lindex($serverKey, -1);
+        if (!$lastKey) { 
+            // no previous association with this server
+            return null; 
+        }
 
         // get association, return null if failed
         return $this->getAssociationFromServer($lastKey);
@@ -156,10 +159,10 @@ class Auth_OpenID_PredisStore extends Auth_OpenID_OpenIDStore {
         
         // SETNX will set the value only of the key doesn't exist yet.
         $nonceKey = $this->nonceKey($server_url, $salt);
-        $added = $this->predis->setnx($nonceKey);
+        $added = $this->redis->setnx($nonceKey, "1");
         if ($added) {
             // Will set expiration
-            $this->predis->expire($nonceKey, $Auth_OpenID_SKEW);
+            $this->redis->expire($nonceKey, $Auth_OpenID_SKEW);
             return true;
         } else {
             return false;
index 000440b5888649b75f7b3d81f8b29eb283b06450..5e69490788ea020dfc7e05601fb61ec4e5cd9908 100644 (file)
@@ -210,7 +210,7 @@ class Auth_OpenID_TrustRoot {
         if ($parts['host'] == 'localhost') {
             return true;
         }
-        
+
         $host_parts = explode('.', $parts['host']);
         if ($parts['wildcard']) {
             // Remove the empty string from the beginning of the array
@@ -413,7 +413,7 @@ function Auth_OpenID_getAllowedReturnURLs($relying_party_url, $fetcher,
     }
 
     call_user_func_array($discover_function,
-                         array($relying_party_url, &$fetcher));
+                         array($relying_party_url, $fetcher));
 
     $return_to_urls = array();
     $matching_endpoints = Auth_OpenID_extractReturnURL($endpoints);
index 15e69079bb7cb48e7324922601c7097a3d9062b0..664521c9ceba2de255edd9bc2bb7bfde264e47bf 100644 (file)
@@ -414,7 +414,7 @@ class Auth_Yadis_Discovery {
             list($yadis_url, $services) = call_user_func_array($discover_cb,
                                                                array(
                                                                 $this->url,
-                                                                &$fetcher,
+                                                                $fetcher,
                                                                ));
 
             $manager = $this->createManager($services, $yadis_url);
index 125029c4cb9f114cb896fd24955e4ed22df0da34..627ea9a8a2a09233cd3fca7fd3e25dfe560d2db5 100644 (file)
@@ -90,6 +90,15 @@ class Auth_Yadis_ParanoidHTTPFetcher extends Auth_Yadis_HTTPFetcher {
             $this->reset();
 
             $c = curl_init();
+            if (defined('Auth_OpenID_DISABLE_SSL_VERIFYPEER')
+                    && Auth_OpenID_DISABLE_SSL_VERIFYPEER === true) {
+                trigger_error(
+                    'You have disabled SSL verifcation, this is a TERRIBLE ' .
+                    'idea in almost all cases. Set Auth_OpenID_DISABLE_SSL_' .
+                    'VERIFYPEER to false if you want to be safe again',
+                    E_USER_WARNING);
+                curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
+            }
 
             if ($c === false) {
                 Auth_OpenID::log(
index 6f0f8b7e282574a62b651a5f470bab923b40d324..255d7cd27c813e25049ab443337d3e21a3b3b3dd 100644 (file)
@@ -65,29 +65,6 @@ class Auth_Yadis_ParseHTML {
                                       $this->_entity_replacements));
     }
 
-    /**
-     * Replace HTML entities (amp, lt, gt, and quot) as well as
-     * numeric entities (e.g. #x9f;) with their actual values and
-     * return the new string.
-     *
-     * @access private
-     * @param string $str The string in which to look for entities
-     * @return string $new_str The new string entities decoded
-     */
-    function replaceEntities($str)
-    {
-        foreach ($this->_entity_replacements as $old => $new) {
-            $str = preg_replace(sprintf("/&%s;/", $old), $new, $str);
-        }
-
-        // Replace numeric entities because html_entity_decode doesn't
-        // do it for us.
-        $str = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $str);
-        $str = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $str);
-
-        return $str;
-    }
-
     /**
      * Strip single and double quotes off of a string, if they are
      * present.
@@ -216,7 +193,7 @@ class Auth_Yadis_ParseHTML {
             $link_attrs = array();
             foreach ($attr_matches[0] as $index => $full_match) {
                 $name = $attr_matches[1][$index];
-                $value = $this->replaceEntities(
+                $value = html_entity_decode(
                               $this->removeQuotes($attr_matches[2][$index]));
 
                 $link_attrs[strtolower($name)] = $value;
index 39a9942220cadf1f9268d3f52e510f845f1c556a..2b8a20eb311287450cd0d44a7a28c7e3c96af518 100644 (file)
@@ -250,6 +250,10 @@ class Auth_Yadis_dom extends Auth_Yadis_XMLParser {
             return false;
         }
 
+        if (isset($this->doc->doctype)) {
+            return false;
+        }
+
         $this->xpath = new DOMXPath($this->doc);
 
         if ($this->xpath) {
@@ -343,11 +347,11 @@ function Auth_Yadis_getSupportedExtensions()
 function Auth_Yadis_getXMLParser()
 {
     global $__Auth_Yadis_defaultParser;
-    
+
     if (isset($__Auth_Yadis_defaultParser)) {
         return $__Auth_Yadis_defaultParser;
     }
-    
+
     foreach(Auth_Yadis_getSupportedExtensions() as $extension => $classname)
     {
       if (extension_loaded($extension))
@@ -357,7 +361,7 @@ function Auth_Yadis_getXMLParser()
         return $p;
       }
     }
-    
+
     return false;
 }
 
index 1f5af96fb21a69c0dcc0641fde44567eb72e9a24..044d1e761cb0776c7b1e75c8c24ce2f11ab9aeee 100644 (file)
@@ -429,7 +429,7 @@ class Auth_Yadis_XRDS {
 
                 foreach ($filters as $filter) {
 
-                    if (call_user_func_array($filter, array(&$service))) {
+                    if (call_user_func_array($filter, array($service))) {
                         $matches++;
 
                         if ($filter_mode == SERVICES_YADIS_MATCH_ANY) {
index 9ea2db7f91f5c9aa626912235d6d239a0afa4577..f8853671e207b1ca292a3ee04ad441a03e59651b 100644 (file)
@@ -141,7 +141,7 @@ function Auth_Yadis_getServiceEndpoints($input_url, $xrds_parse_func,
     }
 
     $yadis_result = call_user_func_array($discover_func,
-                                         array($input_url, &$fetcher));
+                                         array($input_url, $fetcher));
 
     if ($yadis_result === null) {
         return array($input_url, array());
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index aaa870c509ca7d5e0a968dbb20518c00c1aaf2a6..a0d06942f4b5f417408ebc11a678913916432904 100644 (file)
@@ -52,7 +52,7 @@
  * @author     Sean Coates <sean@php.net>
  * @copyright  2003-2006 PEAR <pear-group@php.net>
  * @license    http://www.opensource.org/licenses/bsd-license.php BSD License
- * @version    CVS: $Id: mimeDecode.php,v 1.48 2006/12/03 13:43:33 cipri Exp $
+ * @version    CVS: $Id: mimeDecode.php 305875 2010-12-01 07:17:10Z alan_k $
  * @link       http://pear.php.net/package/Mail_mime
  */
 
@@ -147,6 +147,15 @@ class Mail_mimeDecode extends PEAR
      */
     var $_decode_headers;
 
+    /**
+     * Flag to determine whether to include attached messages
+     * as body in the returned object. Depends on $_include_bodies
+     *
+     * @var    boolean
+     * @access private
+     */
+    var $_rfc822_bodies;
+
     /**
      * Constructor.
      *
@@ -165,6 +174,7 @@ class Mail_mimeDecode extends PEAR
         $this->_body           = $body;
         $this->_decode_bodies  = false;
         $this->_include_bodies = true;
+        $this->_rfc822_bodies  = false;
     }
 
     /**
@@ -187,7 +197,7 @@ class Mail_mimeDecode extends PEAR
     function decode($params = null)
     {
         // determine if this method has been called statically
-        $isStatic = !(isset($this) && get_class($this) == __CLASS__);
+        $isStatic = empty($this) || !is_a($this, __CLASS__);
 
         // Have we been called statically?
        // If so, create an object and pass details to that.
@@ -208,6 +218,8 @@ class Mail_mimeDecode extends PEAR
                                     $params['decode_bodies']  : false;
             $this->_decode_headers = isset($params['decode_headers']) ?
                                     $params['decode_headers'] : false;
+            $this->_rfc822_bodies  = isset($params['rfc_822bodies']) ?
+                                    $params['rfc_822bodies']  : false;
 
             $structure = $this->_decode($this->_header, $this->_body);
             if ($structure === false) {
@@ -235,6 +247,7 @@ class Mail_mimeDecode extends PEAR
         $headers = $this->_parseHeaders($headers);
 
         foreach ($headers as $value) {
+            $value['value'] = $this->_decode_headers ? $this->_decodeHeader($value['value']) : $value['value'];
             if (isset($return->headers[strtolower($value['name'])]) AND !is_array($return->headers[strtolower($value['name'])])) {
                 $return->headers[strtolower($value['name'])]   = array($return->headers[strtolower($value['name'])]);
                 $return->headers[strtolower($value['name'])][] = $value['value'];
@@ -247,8 +260,8 @@ class Mail_mimeDecode extends PEAR
             }
         }
 
-        reset($headers);
-        while (list($key, $value) = each($headers)) {
+
+        foreach ($headers as $key => $value) {
             $headers[$key]['name'] = strtolower($headers[$key]['name']);
             switch ($headers[$key]['name']) {
 
@@ -261,7 +274,7 @@ class Mail_mimeDecode extends PEAR
                     }
 
                     if (isset($content_type['other'])) {
-                        while (list($p_name, $p_value) = each($content_type['other'])) {
+                        foreach($content_type['other'] as $p_name => $p_value) {
                             $return->ctype_parameters[$p_name] = $p_value;
                         }
                     }
@@ -271,7 +284,7 @@ class Mail_mimeDecode extends PEAR
                     $content_disposition = $this->_parseHeaderValue($headers[$key]['value']);
                     $return->disposition   = $content_disposition['value'];
                     if (isset($content_disposition['other'])) {
-                        while (list($p_name, $p_value) = each($content_disposition['other'])) {
+                        foreach($content_disposition['other'] as $p_name => $p_value) {
                             $return->d_parameters[$p_name] = $p_value;
                         }
                     }
@@ -303,6 +316,7 @@ class Mail_mimeDecode extends PEAR
                 case 'multipart/alternative':
                 case 'multipart/related':
                 case 'multipart/mixed':
+                case 'application/vnd.wap.multipart.related':
                     if(!isset($content_type['other']['boundary'])){
                         $this->_error = 'No boundary found for ' . $content_type['value'] . ' part';
                         return false;
@@ -321,7 +335,11 @@ class Mail_mimeDecode extends PEAR
                     break;
 
                 case 'message/rfc822':
-                    $obj = &new Mail_mimeDecode($body);
+                                       if ($this->_rfc822_bodies) {
+                                               $encoding = isset($content_transfer_encoding) ? $content_transfer_encoding['value'] : '7bit';
+                                               $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $encoding) : $body);
+                                       }
+                    $obj = new Mail_mimeDecode($body);
                     $return->parts[] = $obj->decode(array('include_bodies' => $this->_include_bodies,
                                                                              'decode_bodies'  => $this->_decode_bodies,
                                                                                                                  'decode_headers' => $this->_decode_headers));
@@ -401,6 +419,11 @@ class Mail_mimeDecode extends PEAR
         if (preg_match("/^(.*?)\r?\n\r?\n(.*)/s", $input, $match)) {
             return array($match[1], $match[2]);
         }
+        // bug #17325 - empty bodies are allowed. - we just check that at least one line 
+        // of headers exist..
+        if (count(explode("\n",$input))) {
+            return array($input, '');
+        }
         $this->_error = 'Could not split header and body';
         return false;
     }
@@ -419,7 +442,12 @@ class Mail_mimeDecode extends PEAR
         if ($input !== '') {
             // Unfold the input
             $input   = preg_replace("/\r?\n/", "\r\n", $input);
+            //#7065 - wrapping.. with encoded stuff.. - probably not needed,
+            // wrapping space should only get removed if the trailing item on previous line is a 
+            // encoded character
+            $input   = preg_replace("/=\r\n(\t| )+/", '=', $input);
             $input   = preg_replace("/\r\n(\t| )+/", ' ', $input);
+            
             $headers = explode("\r\n", trim($input));
 
             foreach ($headers as $value) {
@@ -430,7 +458,7 @@ class Mail_mimeDecode extends PEAR
 
                 $return[] = array(
                                   'name'  => $hdr_name,
-                                  'value' => $this->_decode_headers ? $this->_decodeHeader($hdr_value) : $hdr_value
+                                  'value' =>  $hdr_value
                                  );
             }
         } else {
@@ -454,41 +482,161 @@ class Mail_mimeDecode extends PEAR
     function _parseHeaderValue($input)
     {
 
-        if (($pos = strpos($input, ';')) !== false) {
+        if (($pos = strpos($input, ';')) === false) {
+            $input = $this->_decode_headers ? $this->_decodeHeader($input) : $input;
+            $return['value'] = trim($input);
+            return $return;
+        }
+
+
 
-            $return['value'] = trim(substr($input, 0, $pos));
-            $input = trim(substr($input, $pos+1));
+        $value = substr($input, 0, $pos);
+        $value = $this->_decode_headers ? $this->_decodeHeader($value) : $value;
+        $return['value'] = trim($value);
+        $input = trim(substr($input, $pos+1));
 
-            if (strlen($input) > 0) {
+        if (!strlen($input) > 0) {
+            return $return;
+        }
+        // at this point input contains xxxx=".....";zzzz="...."
+        // since we are dealing with quoted strings, we need to handle this properly..
+        $i = 0;
+        $l = strlen($input);
+        $key = '';
+        $val = false; // our string - including quotes..
+        $q = false; // in quote..
+        $lq = ''; // last quote..
+
+        while ($i < $l) {
+            
+            $c = $input[$i];
+            //var_dump(array('i'=>$i,'c'=>$c,'q'=>$q, 'lq'=>$lq, 'key'=>$key, 'val' =>$val));
 
-                // This splits on a semi-colon, if there's no preceeding backslash
-                // Now works with quoted values; had to glue the \; breaks in PHP
-                // the regex is already bordering on incomprehensible
-                $splitRegex = '/([^;\'"]*[\'"]([^\'"]*([^\'"]*)*)[\'"][^;\'"]*|([^;]+))(;|$)/';
-                preg_match_all($splitRegex, $input, $matches);
-                $parameters = array();
-                for ($i=0; $i<count($matches[0]); $i++) {
-                    $param = $matches[0][$i];
-                    while (substr($param, -2) == '\;') {
-                        $param .= $matches[0][++$i];
+            $escaped = false;
+            if ($c == '\\') {
+                $i++;
+                if ($i == $l-1) { // end of string.
+                    break;
+                }
+                $escaped = true;
+                $c = $input[$i];
+            }            
+
+
+            // state - in key..
+            if ($val === false) {
+                if (!$escaped && $c == '=') {
+                    $val = '';
+                    $key = trim($key);
+                    $i++;
+                    continue;
+                }
+                if (!$escaped && $c == ';') {
+                    if ($key) { // a key without a value..
+                        $key= trim($key);
+                        $return['other'][$key] = '';
+                        $return['other'][strtolower($key)] = '';
+                    }
+                    $key = '';
+                }
+                $key .= $c;
+                $i++;
+                continue;
+            }
+                     
+            // state - in value.. (as $val is set..)
+
+            if ($q === false) {
+                // not in quote yet.
+                if ((!strlen($val) || $lq !== false) && $c == ' ' ||  $c == "\t") {
+                    $i++;
+                    continue; // skip leading spaces after '=' or after '"'
+                }
+                if (!$escaped && ($c == '"' || $c == "'")) {
+                    // start quoted area..
+                    $q = $c;
+                    // in theory should not happen raw text in value part..
+                    // but we will handle it as a merged part of the string..
+                    $val = !strlen(trim($val)) ? '' : trim($val);
+                    $i++;
+                    continue;
+                }
+                // got end....
+                if (!$escaped && $c == ';') {
+
+                    $val = trim($val);
+                    $added = false;
+                    if (preg_match('/\*[0-9]+$/', $key)) {
+                        // this is the extended aaa*0=...;aaa*1=.... code
+                        // it assumes the pieces arrive in order, and are valid...
+                        $key = preg_replace('/\*[0-9]+$/', '', $key);
+                        if (isset($return['other'][$key])) {
+                            $return['other'][$key] .= $val;
+                            if (strtolower($key) != $key) {
+                                $return['other'][strtolower($key)] .= $val;
+                            }
+                            $added = true;
+                        }
+                        // continue and use standard setters..
+                    }
+                    if (!$added) {
+                        $return['other'][$key] = $val;
+                        $return['other'][strtolower($key)] = $val;
                     }
-                    $parameters[] = $param;
+                    $val = false;
+                    $key = '';
+                    $lq = false;
+                    $i++;
+                    continue;
                 }
 
-                for ($i = 0; $i < count($parameters); $i++) {
-                    $param_name  = trim(substr($parameters[$i], 0, $pos = strpos($parameters[$i], '=')), "'\";\t\\ ");
-                    $param_value = trim(str_replace('\;', ';', substr($parameters[$i], $pos + 1)), "'\";\t\\ ");
-                    if ($param_value[0] == '"') {
-                        $param_value = substr($param_value, 1, -1);
+                $val .= $c;
+                $i++;
+                continue;
+            }
+            
+            // state - in quote..
+            if (!$escaped && $c == $q) {  // potential exit state..
+
+                // end of quoted string..
+                $lq = $q;
+                $q = false;
+                $i++;
+                continue;
+            }
+                
+            // normal char inside of quoted string..
+            $val.= $c;
+            $i++;
+        }
+        
+        // do we have anything left..
+        if (strlen(trim($key)) || $val !== false) {
+           
+            $val = trim($val);
+            $added = false;
+            if ($val !== false && preg_match('/\*[0-9]+$/', $key)) {
+                // no dupes due to our crazy regexp.
+                $key = preg_replace('/\*[0-9]+$/', '', $key);
+                if (isset($return['other'][$key])) {
+                    $return['other'][$key] .= $val;
+                    if (strtolower($key) != $key) {
+                        $return['other'][strtolower($key)] .= $val;
                     }
-                    $return['other'][$param_name] = $param_value;
-                    $return['other'][strtolower($param_name)] = $param_value;
+                    $added = true;
                 }
+                // continue and use standard setters..
+            }
+            if (!$added) {
+                $return['other'][$key] = $val;
+                $return['other'][strtolower($key)] = $val;
             }
-        } else {
-            $return['value'] = trim($input);
         }
-
+        // decode values.
+        foreach($return['other'] as $key =>$val) {
+            $return['other'][$key] = $this->_decode_headers ? $this->_decodeHeader($val) : $val;
+        }
+       //print_r($return);
         return $return;
     }
 
@@ -510,13 +658,19 @@ class Mail_mimeDecode extends PEAR
         if ($boundary == $bs_check) {
             $boundary = $bs_possible;
         }
+        $tmp = preg_split("/--".preg_quote($boundary, '/')."((?=\s)|--)/", $input);
 
-        $tmp = explode('--' . $boundary, $input);
-
-        for ($i = 1; $i < count($tmp) - 1; $i++) {
-            $parts[] = $tmp[$i];
+        $len = count($tmp) -1;
+        for ($i = 1; $i < $len; $i++) {
+            if (strlen(trim($tmp[$i]))) {
+                $parts[] = $tmp[$i];
+            }
+        }
+        
+        // add the last part on if it does not end with the 'closing indicator'
+        if (!empty($tmp[$len]) && strlen(trim($tmp[$len])) && $tmp[$len][0] != '-') {
+            $parts[] = $tmp[$len];
         }
-
         return $parts;
     }
 
@@ -719,7 +873,7 @@ class Mail_mimeDecode extends PEAR
                 case "to":
                 case "cc":
                 case "bcc":
-                    $to = ",".$item['value'];
+                    $to .= ",".$item['value'];
                 default:
                    break;
             }
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 3d8bc23f216c5867b0b1107be3a637ae33b344a8..a8f621cdf521076b69bb259c7e194d9a2398c55a 100644 (file)
@@ -2,19 +2,19 @@
 /**
  * Validation class
  *
- * Copyright (c) 1997-2006 Pierre-Alain Joye,Tomas V.V.Cox, Amir Saied  
+ * Copyright (c) 1997-2006 Pierre-Alain Joye,Tomas V.V.Cox, Amir Saied
  *
- * This source file is subject to the New BSD license, That is bundled  
- * with this package in the file LICENSE, and is available through      
- * the world-wide-web at                                                
- * http://www.opensource.org/licenses/bsd-license.php                   
- * If you did not receive a copy of the new BSDlicense and are unable   
- * to obtain it through the world-wide-web, please send a note to       
- * pajoye@php.net so we can mail you a copy immediately.                
+ * This source file is subject to the New BSD license, That is bundled
+ * with this package in the file LICENSE, and is available through
+ * the world-wide-web at
+ * http://www.opensource.org/licenses/bsd-license.php
+ * If you did not receive a copy of the new BSDlicense and are unable
+ * to obtain it through the world-wide-web, please send a note to
+ * pajoye@php.net so we can mail you a copy immediately.
  *
- * Author: Tomas V.V.Cox  <cox@idecnet.com>                             
- *         Pierre-Alain Joye <pajoye@php.net>                           
- *         Amir Mohammad Saied <amir@php.net>                           
+ * Author: Tomas V.V.Cox  <cox@idecnet.com>
+ *         Pierre-Alain Joye <pajoye@php.net>
+ *         Amir Mohammad Saied <amir@php.net>
  *
  *
  * Package to validate various datas. It includes :
  * @author     Amir Mohammad Saied <amir@php.net>
  * @copyright  1997-2006 Pierre-Alain Joye,Tomas V.V.Cox,Amir Mohammad Saied
  * @license    http://www.opensource.org/licenses/bsd-license.php  New BSD License
- * @version    CVS: $Id: Validate.php,v 1.134 2009/01/28 12:27:33 davidc Exp $
+ * @version    CVS: $Id$
  * @link       http://pear.php.net/package/Validate
  */
 
+// {{{ Constants
 /**
  * Methods for common data validations
  */
@@ -44,17 +45,18 @@ define('VALIDATE_SPACE',        '\s');
 define('VALIDATE_ALPHA_LOWER',  'a-z');
 define('VALIDATE_ALPHA_UPPER',  'A-Z');
 define('VALIDATE_ALPHA',        VALIDATE_ALPHA_LOWER . VALIDATE_ALPHA_UPPER);
-define('VALIDATE_EALPHA_LOWER', VALIDATE_ALPHA_LOWER . 'áéíóúýàèìòùäëïöüÿâêîôûãñõ¨åæç½ðøþß');
-define('VALIDATE_EALPHA_UPPER', VALIDATE_ALPHA_UPPER . 'ÁÉÍÓÚÝÀÈÌÒÙÄËÏÖܾÂÊÎÔÛÃÑÕ¦ÅÆǼÐØÞ');
+define('VALIDATE_EALPHA_LOWER', VALIDATE_ALPHA_LOWER . 'áéíóúýàèìòùäëïöüÿâêîôûãñõ¨åæç½ðøþß');
+define('VALIDATE_EALPHA_UPPER', VALIDATE_ALPHA_UPPER . 'ÁÉÍÓÚÝÀÈÌÒÙÄËÏÖܾÂÊÎÔÛÃÑÕ¦ÅÆǼÐØÞ');
 define('VALIDATE_EALPHA',       VALIDATE_EALPHA_LOWER . VALIDATE_EALPHA_UPPER);
 define('VALIDATE_PUNCTUATION',  VALIDATE_SPACE . '\.,;\:&"\'\?\!\(\)');
-define('VALIDATE_NAME',         VALIDATE_EALPHA . VALIDATE_SPACE . "'" . "-");
-define('VALIDATE_STREET',       VALIDATE_NUM . VALIDATE_NAME . "/\\ºª\.");
+define('VALIDATE_NAME',         VALIDATE_EALPHA . VALIDATE_SPACE . "'" . '\-');
+define('VALIDATE_STREET',       VALIDATE_NUM . VALIDATE_NAME . "/\\ºª\.");
 
 define('VALIDATE_ITLD_EMAILS',  1);
 define('VALIDATE_GTLD_EMAILS',  2);
 define('VALIDATE_CCTLD_EMAILS', 4);
 define('VALIDATE_ALL_EMAILS',   8);
+// }}}
 
 /**
  * Validation class
@@ -79,6 +81,7 @@ define('VALIDATE_ALL_EMAILS',   8);
  */
 class Validate
 {
+    // {{{ International, Generic and Country code TLDs
     /**
      * International Top-Level Domain
      *
@@ -202,6 +205,7 @@ class Validate
         'ye','yt','yu','za',
         'zm','zw',
     );
+    // }}}
 
     /**
      * Validate a tag URI (RFC4151)
@@ -445,6 +449,10 @@ class Validate
         if(!empty($options["VALIDATE_GTLD_EMAILS"])) array_push($validate, 'gtld');
         if(!empty($options["VALIDATE_CCTLD_EMAILS"])) array_push($validate, 'cctld');
 
+        if (count($validate) === 0) {
+            array_push($validate, 'itld', 'gtld', 'cctld');
+        }
+
         $self = new Validate;
 
         $toValidate = array();
@@ -459,7 +467,7 @@ class Validate
 
         return $e;
     }
-    
+
     /**
      * Execute the validation
      *
@@ -501,7 +509,7 @@ class Validate
      *      'use_rfc822' => 'true',
      *      'VALIDATE_GTLD_EMAILS' => 'true',
      *      'VALIDATE_CCTLD_EMAILS' => 'true',
-     *      'VALIDATE_ITLD_EMAILS' => 'true',           
+     *      'VALIDATE_ITLD_EMAILS' => 'true',
      *      );
      *
      * @return boolean true if valid email, false if not
@@ -524,15 +532,17 @@ class Validate
          */
         $hasIDNA = false;
 
-        if (@include_once('Net/IDNA.php')) {
+        if (Validate::_includePathFileExists('Net/IDNA.php')) {
+            include_once('Net/IDNA.php');
             $hasIDNA = true;
         }
 
         if ($hasIDNA === true) {
             if (strpos($email, '@') !== false) {
-                list($name, $domain) = explode('@', $email, 2);
+                $tmpEmail = explode('@', $email);
+                $domain = array_pop($tmpEmail);
 
-                // Check if the domain contains characters > 127 which means 
+                // Check if the domain contains characters > 127 which means
                 // it's an idn domain name.
                 $chars = count_chars($domain, 1);
                 if (!empty($chars) && max(array_keys($chars)) > 127) {
@@ -540,10 +550,11 @@ class Validate
                     $domain = $idna->encode($domain);
                 }
 
-                $email = "$name@$domain";
+                array_push($tmpEmail, $domain);
+                $email = implode('@', $tmpEmail);
             }
         }
-        
+
         /**
          * @todo Fix bug here.. even if it passes this, it won't be passing
          *       The regular expression below
@@ -565,14 +576,14 @@ class Validate
          (?:(?:(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:[0-1]?[0-9]?[0-9]))\.){3}
                (?:(?:25[0-5])|(?:2[0-4][0-9])|(?:[0-1]?[0-9]?[0-9]))))(?(5)\])|
          ((?:[a-z0-9](?:[-a-z0-9]*[a-z0-9])?\.)*[a-z0-9](?:[-a-z0-9]*[a-z0-9])?)  #6 domain as hostname
-         \.((?:([^- ])[-a-z]*[-a-z]))) #7 TLD 
+         \.((?:([^- ])[-a-z]*[-a-z]))) #7 TLD
          $&xi';
 
         //checks if exists the domain (MX or A)
         if ($use_rfc822? Validate::__emailRFC822($email, $options) :
                 preg_match($regex, $email)) {
             if ($check_domain && function_exists('checkdnsrr')) {
-                list ($account, $domain) = explode('@', $email);
+                $domain = preg_replace('/[^-a-z.0-9]/i', '', array_pop(explode('@', $email)));
                 if (checkdnsrr($domain, 'MX') || checkdnsrr($domain, 'A')) {
                     return true;
                 }
@@ -913,7 +924,7 @@ class Validate
      *
      * @param string &$date Date
      * @param string $num   Length
-     * @param string $opt   Unknown   
+     * @param string $opt   Unknown
      *
      * @access private
      * @return string
@@ -1086,8 +1097,10 @@ class Validate
                 $class        = implode('_', $validateType);
                 $classPath    = str_replace('_', DIRECTORY_SEPARATOR, $class);
                 $class        = 'Validate_' . $class;
-                if (!@include_once "Validate/$classPath.php") {
-                    trigger_error("$class isn't installed or you may have some permissoin issues", E_USER_ERROR);
+                if (Validate::_includePathFileExists("Validate/$classPath.php")) {
+                    include_once "Validate/$classPath.php";
+                } else {
+                    trigger_error("$class isn't installed or you may have some permission issues", E_USER_ERROR);
                 }
 
                 $ce = substr(phpversion(), 0, 1) > 4 ?
@@ -1112,5 +1125,25 @@ class Validate
         }
         return $valid;
     }
+
+    /**
+     * Determine whether specified file exists along the include path.
+     *
+     * @param string $filename file to search for
+     *
+     * @access private
+     *
+     * @return bool true if file exists
+     */
+    function _includePathFileExists($filename)
+    {
+        $paths = explode(":", ini_get("include_path"));
+        $result = false;
+
+        while ((!($result)) && (list($key,$val) = each($paths))) {
+            $result = file_exists($val . "/" . $filename);
+        }
+        return $result;
+    }
 }
 
index 190c1e4f43647724d313ddc417cce8851bcc7bff..cd982bbb179c279d50fe28945e23654a011b459d 100644 (file)
@@ -60,6 +60,13 @@ var SN = { // StatusNet
     V: {    // Variables
     },
 
+    /**
+     * list of callbacks, categorized into _callbacks['event_name'] = [ callback_function_1, callback_function_2 ]
+     *
+     * @access private
+     */
+    _callbacks: {},
+
     /**
      * Map of localized message strings exported to script from the PHP
      * side via Action::getScriptMessages().
@@ -343,21 +350,6 @@ var SN = { // StatusNet
             // Make sure we don't have a mixed HTTP/HTTPS submission...
             form.attr('action', SN.U.RewriteAjaxAction(form.attr('action')));
 
-            /**
-             * Show a response feedback bit under the new-notice dialog.
-             *
-             * @param {String} cls: CSS class name to use ('error' or 'success')
-             * @param {String} text
-             * @access private
-             */
-            var showFeedback = function (cls, text) {
-                form.append(
-                    $('<p class="form_response"></p>')
-                        .addClass(cls)
-                        .text(text)
-                );
-            };
-
             /**
              * Hide the previous response feedback, if any.
              */
@@ -392,7 +384,7 @@ var SN = { // StatusNet
                     removeFeedback();
                     if (textStatus == 'timeout') {
                         // @fixme i18n
-                        showFeedback('error', 'Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists.');
+                        SN.U.showFeedback(form, 'error', 'Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists.');
                     } else {
                         var response = SN.U.GetResponseXML(xhr);
                         if ($('.' + SN.C.S.Error, response).length > 0) {
@@ -405,7 +397,7 @@ var SN = { // StatusNet
                                 SN.U.FormNoticeEnhancements(form);
                             } else {
                                 // @fixme i18n
-                                showFeedback('error', '(Sorry! We had trouble sending your notice (' + xhr.status + ' ' + xhr.statusText + '). Please report the problem to the site administrator if this happens again.');
+                                SN.U.showFeedback(form, 'error', '(Sorry! We had trouble sending your notice (' + xhr.status + ' ' + xhr.statusText + '). Please report the problem to the site administrator if this happens again.');
                             }
                         }
                     }
@@ -414,59 +406,9 @@ var SN = { // StatusNet
                     removeFeedback();
                     var errorResult = $('#' + SN.C.S.Error, data);
                     if (errorResult.length > 0) {
-                        showFeedback('error', errorResult.text());
+                        SN.U.showFeedback(form, 'error', errorResult.text());
                     } else {
-                        var commandResult = $('#' + SN.C.S.CommandResult, data);
-                        if (commandResult.length > 0) {
-                            showFeedback('success', commandResult.text());
-                        } else {
-                            // New notice post was successful. If on our timeline, show it!
-                            var notice = document._importNode($('li', data)[0], true);
-                            var notices = $('#notices_primary .notices:first');
-                            var replyItem = form.closest('li.notice-reply');
-
-                            if (replyItem.length > 0) {
-                                // If this is an inline reply, remove the form...
-                                var list = form.closest('.threaded-replies');
-
-                                var id = $(notice).attr('id');
-                                if ($('#' + id).length == 0) {
-                                    $(notice).insertBefore(replyItem);
-                                } // else Realtime came through before us...
-
-                                replyItem.remove();
-
-                            } else if (notices.length > 0 && SN.U.belongsOnTimeline(notice)) {
-                                // Not a reply. If on our timeline, show it at the top!
-
-                                if ($('#' + notice.id).length === 0) {
-                                    var notice_irt_value = form.find('[name=inreplyto]').val();
-                                    var notice_irt = '#notices_primary #notice-' + notice_irt_value;
-                                    if ($('body')[0].id == 'conversation') {
-                                        if (notice_irt_value.length > 0 && $(notice_irt + ' .notices').length < 1) {
-                                            $(notice_irt).append('<ul class="notices"></ul>');
-                                        }
-                                        $($(notice_irt + ' .notices')[0]).append(notice);
-                                    } else {
-                                        notices.prepend(notice);
-                                    }
-                                    $('#' + notice.id)
-                                        .css({display: 'none'})
-                                        .fadeIn(2500);
-                                    SN.U.NoticeWithAttachment($('#' + notice.id));
-                                    SN.U.switchInputFormTab(null);
-                                }
-                            } else {
-                                // Not on a timeline that this belongs on?
-                                // Just show a success message.
-                                // @fixme inline
-                                showFeedback('success', $('title', data).text());
-                            }
-                        }
-                        form.resetForm();
-                        form.find('[name=inreplyto]').val('');
-                        form.find('.attach-status').remove();
-                        SN.U.FormNoticeEnhancements(form);
+                        SN.E.ajaxNoticePosted(form, data, textStatus);
                     }
                 },
                 complete: function (xhr, textStatus) {
@@ -1139,12 +1081,12 @@ var SN = { // StatusNet
                 label.attr('title', label.text());
 
                 check.change(function () {
-                    if (check.prop('checked') === true || $.cookie(SN.C.S.NoticeDataGeoCookie) === null) {
+                    if (check.prop('checked') === true || $.cookie(SN.C.S.NoticeDataGeoCookie) === undefined) {
                         label
                             .attr('title', NoticeDataGeo_text.ShareDisable)
                             .addClass('checked');
 
-                        if ($.cookie(SN.C.S.NoticeDataGeoCookie) === null || $.cookie(SN.C.S.NoticeDataGeoCookie) == 'disabled') {
+                        if ($.cookie(SN.C.S.NoticeDataGeoCookie) === undefined || $.cookie(SN.C.S.NoticeDataGeoCookie) == 'disabled') {
                             if (navigator.geolocation) {
                                 SN.U.NoticeGeoStatus(form, 'Requesting location from browser...');
                                 navigator.geolocation.getCurrentPosition(
@@ -1355,7 +1297,7 @@ var SN = { // StatusNet
              * @fixme what is this?
              */
             Delete: function () {
-                $.cookie(SN.C.S.StatusNetInstance, null);
+                $.removeCookie(SN.C.S.StatusNetInstance);
             }
         },
 
@@ -1442,9 +1384,106 @@ var SN = { // StatusNet
             var extended = $(selector);
             extended.removeClass('extended_menu');
             return void(0);
+        },
+
+        /**
+         * Show a response feedback bit under a form.
+         *
+         * @param {Element} form: the new-notice form usually
+         * @param {String}  cls: CSS class name to use ('error' or 'success')
+         * @param {String}  text
+         * @access public
+         */
+        showFeedback: function (form, cls, text) {
+            form.append(
+                $('<p class="form_response"></p>')
+                    .addClass(cls)
+                    .text(text)
+            );
+        },
+
+        addCallback: function (ename, callback) {
+            // initialize to array if it's undefined
+            if (typeof SN._callbacks[ename] === 'undefined') {
+                SN._callbacks[ename] = [];
+            }
+            SN._callbacks[ename].push(callback);
+        },
+
+        runCallbacks: function (ename, data) {
+            if (typeof SN._callbacks[ename] === 'undefined') {
+                return;
+            }
+            for (cbname in SN._callbacks[ename]) {
+                SN._callbacks[ename][cbname](data);
+            }
         }
     },
 
+    E: {    /* Events */
+        /* SN.E.ajaxNoticePosted, called when a notice has been posted successfully via an AJAX form
+            @param  form        the originating form element
+            @param  data        data from success() callback
+            @param  textStatus  textStatus from success() callback
+        */
+        ajaxNoticePosted: function (form, data, textStatus) {
+            var commandResult = $('#' + SN.C.S.CommandResult, data);
+            if (commandResult.length > 0) {
+                SN.U.showFeedback(form, 'success', commandResult.text());
+            } else {
+                // New notice post was successful. If on our timeline, show it!
+                var notice = document._importNode($('li', data)[0], true);
+                var notices = $('#notices_primary .notices:first');
+                var replyItem = form.closest('li.notice-reply');
+
+                if (replyItem.length > 0) {
+                    // If this is an inline reply, remove the form...
+                    var list = form.closest('.threaded-replies');
+
+                    var id = $(notice).attr('id');
+                    if ($('#' + id).length == 0) {
+                        $(notice).insertBefore(replyItem);
+                    } // else Realtime came through before us...
+
+                    replyItem.remove();
+
+                } else if (notices.length > 0 && SN.U.belongsOnTimeline(notice)) {
+                    // Not a reply. If on our timeline, show it at the top!
+
+                    if ($('#' + notice.id).length === 0) {
+                        var notice_irt_value = form.find('[name=inreplyto]').val();
+                        var notice_irt = '#notices_primary #notice-' + notice_irt_value;
+                        if ($('body')[0].id == 'conversation') {
+                            if (notice_irt_value.length > 0 && $(notice_irt + ' .notices').length < 1) {
+                                $(notice_irt).append('<ul class="notices"></ul>');
+                            }
+                            $($(notice_irt + ' .notices')[0]).append(notice);
+                        } else {
+                            notices.prepend(notice);
+                        }
+                        $('#' + notice.id)
+                            .css({display: 'none'})
+                            .fadeIn(2500);
+                        SN.U.NoticeWithAttachment($('#' + notice.id));
+                        SN.U.switchInputFormTab(null);
+                    }
+                } else {
+                    // Not on a timeline that this belongs on?
+                    // Just show a success message.
+                    // @fixme inline
+                    SN.U.showFeedback(form, 'success', $('title', data).text());
+                }
+            }
+            form.resetForm();
+            form.find('[name=inreplyto]').val('');
+            form.find('.attach-status').remove();
+            SN.U.FormNoticeEnhancements(form);
+
+            SN.U.runCallbacks('notice_posted', {"notice": notice});
+        }, 
+    },
+
+
     Init: {
         /**
          * If user is logged in, run setup code for the new notice form:
index fa91d46726c572fddd52ee4303a10b8b26c3e6f8..7f3aea9c1a74115d2bbaccf4787faff1ad1ac4fc 100644 (file)
@@ -205,7 +205,7 @@ class Action extends HTMLOutputter // lawsuit
      *
      * @return nothing
      */
-    function showPage()
+    public function showPage()
     {
         if (GNUsocial::isAjax()) {
             self::showAjax();
@@ -534,15 +534,11 @@ class Action extends HTMLOutputter // lawsuit
      */
     function showFeeds()
     {
-        $feeds = $this->getFeeds();
-
-        if ($feeds) {
-            foreach ($feeds as $feed) {
-                $this->element('link', array('rel' => $feed->rel(),
-                                             'href' => $feed->url,
-                                             'type' => $feed->mimeType(),
-                                             'title' => $feed->title));
-            }
+        foreach ($this->getFeeds() as $feed) {
+            $this->element('link', array('rel' => $feed->rel(),
+                                         'href' => $feed->url,
+                                         'type' => $feed->mimeType(),
+                                         'title' => $feed->title));
         }
     }
 
@@ -1035,9 +1031,9 @@ class Action extends HTMLOutputter // lawsuit
     function showExportData()
     {
         $feeds = $this->getFeeds();
-        if ($feeds) {
-            $fl = new FeedList($this);
-            $fl->show($feeds);
+        if (!empty($feeds)) {
+            $fl = new FeedList($this, $feeds);
+            $fl->show();
         }
     }
 
@@ -1658,7 +1654,7 @@ class Action extends HTMLOutputter // lawsuit
      */
     function getFeeds()
     {
-        return null;
+        return array();
     }
 
     /**
index d4c01232ec283e8e97ae5d54dcb96040de37df60..f3383efda5b4db936a75e8611a09147aa9a0cfc9 100644 (file)
@@ -281,19 +281,20 @@ class ActivityUtils
     static function validateUri($uri)
     {
         // Check mailto: URIs first
+        $validate = new Validate();
 
         if (preg_match('/^mailto:(.*)$/', $uri, $match)) {
-            return Validate::email($match[1], common_config('email', 'check_domain'));
+            return $validate->email($match[1], common_config('email', 'check_domain'));
         }
 
-        if (Validate::uri($uri)) {
+        if ($validate->uri($uri)) {
             return true;
         }
 
         // Possibly an upstream bug; tag: URIs aren't validated properly
         // unless you explicitly ask for them. All other schemes are accepted
         // for basic URI validation without asking.
-        if (Validate::uri($uri, array('allowed_scheme' => array('tag')))) {
+        if ($validate->uri($uri, array('allowed_scheme' => array('tag')))) {
             return true;
         }
 
old mode 100755 (executable)
new mode 100644 (file)
index 724447f..cd2207b
@@ -248,7 +248,7 @@ class ApiAction extends Action
 
         $twitter_user['friends_count'] = $profile->subscriptionCount();
 
-        $twitter_user['created_at'] = $this->dateTwitter($profile->created);
+        $twitter_user['created_at'] = self::dateTwitter($profile->created);
 
         $timezone = 'UTC';
 
@@ -322,7 +322,7 @@ class ApiAction extends Action
         $twitter_status = array();
         $twitter_status['text'] = $notice->content;
         $twitter_status['truncated'] = false; # Not possible on StatusNet
-        $twitter_status['created_at'] = $this->dateTwitter($notice->created);
+        $twitter_status['created_at'] = self::dateTwitter($notice->created);
         try {
             // We could just do $notice->reply_to but maybe the future holds a
             // different story for parenting.
@@ -440,8 +440,8 @@ class ApiAction extends Action
         $twitter_group['homepage'] = $group->homepage;
         $twitter_group['description'] = $group->description;
         $twitter_group['location'] = $group->location;
-        $twitter_group['created'] = $this->dateTwitter($group->created);
-        $twitter_group['modified'] = $this->dateTwitter($group->modified);
+        $twitter_group['created'] = self::dateTwitter($group->created);
+        $twitter_group['modified'] = self::dateTwitter($group->modified);
 
         return $twitter_group;
     }
@@ -1196,7 +1196,7 @@ class ApiAction extends Action
         $this->endDocument('xml');
     }
 
-    function dateTwitter($dt)
+    static function dateTwitter($dt)
     {
         $dateStr = date('d F Y H:i:s', strtotime($dt));
         $d = new DateTime($dateStr, new DateTimeZone('UTC'));
index 292bc97e8584ccfe0819bb93522d175051a5451d..b7e1ed1b41c1178cb8b1ff1f44c4b670f3f06f19 100644 (file)
@@ -113,10 +113,12 @@ class AtomNoticeFeed extends Atom10Feed
             foreach ($notices as $notice) {
                 $this->addEntryFromNotice($notice);
             }
-        } else {
+        } elseif ($notices instanceof Notice) {
             while ($notices->fetch()) {
                 $this->addEntryFromNotice($notices);
             }
+        } else {
+            throw new ServerException('addEntryFromNotices got neither an array nor a Notice object');
         }
     }
 
@@ -125,7 +127,7 @@ class AtomNoticeFeed extends Atom10Feed
      *
      * @param Notice $notice a Notice to add
      */
-    function addEntryFromNotice($notice)
+    function addEntryFromNotice(Notice $notice)
     {
         try {
             $source = $this->showSource();
index 6e3f050960a7f054520c442bd04fc7a6d6aaea8f..8bb29855a3a59c66196189e7c070bdfe8933d4f2 100644 (file)
@@ -85,7 +85,8 @@ class AvatarLink
 
     // yuck!
     static function mediatype($filename) {
-        $ext = strtolower(end(explode('.', $filename)));
+        $parts = explode('.', $filename);
+        $ext = strtolower(end($parts));
         if ($ext == 'jpeg') {
             $ext = 'jpg';
         }
index 0ec9fc4e14d1cc5a67c2f9b7316b17b526797733..cf40f678ed017b4a375f71876e50d5b0b0e189d8 100644 (file)
@@ -327,7 +327,6 @@ $default =
                             'OpportunisticQM' => array(),
                             'OStatus' => array(),
                             'Poll' => array(),
-                            'QnA' => array(),
                             'SearchSub' => array(),
                             'TagSub' => array(),
                             'WebFinger' => array(),
diff --git a/lib/deletenoticeform.php b/lib/deletenoticeform.php
new file mode 100644 (file)
index 0000000..d060046
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+
+if (!defined('GNUSOCIAL')) { exit(1); }
+
+class DeletenoticeForm extends Form
+{
+    protected $notice = null;
+
+    function __construct(HTMLOutputter $out=null, array $formOpts=array())
+    {
+        if (!array_key_exists('notice', $formOpts) || !$formOpts['notice'] instanceof Notice) {
+            throw new ServerException('No notice provided to DeletenoticeForm');
+        }
+
+        parent::__construct($out);
+
+        $this->notice = $formOpts['notice'];
+    }
+
+    function id()
+    {
+        return 'form_notice_delete-' . $this->notice->getID();
+    }
+
+    function formClass()
+    {
+        return 'form_settings';
+    }
+
+    function action()
+    {
+        return common_local_url('deletenotice', array('notice' => $this->notice->getID()));
+    }
+
+    function formLegend()
+    {
+        $this->out->element('legend', null, _('Delete notice'));
+    }
+
+    function formData()
+    {
+        $this->out->element('p', null, _('Are you sure you want to delete this notice?'));
+    }
+
+    /**
+     * Action elements
+     *
+     * @return void
+     */
+    function formActions()
+    {
+        $this->out->submit('form_action-no',
+                      // TRANS: Button label on the delete notice form.
+                      _m('BUTTON','No'),
+                      'submit form_action-primary',
+                      'no',
+                      // TRANS: Submit button title for 'No' when deleting a notice.
+                      _('Do not delete this notice.'));
+        $this->out->submit('form_action-yes',
+                      // TRANS: Button label on the delete notice form.
+                      _m('BUTTON','Yes'),
+                      'submit form_action-secondary',
+                      'yes',
+                      // TRANS: Submit button title for 'Yes' when deleting a notice.
+                      _('Delete this notice.'));
+    }
+}
index c57f377238f6b981d32c6517faa7d87225d08e25..cc0f55249394352268c6bb869a711500163dc16b 100644 (file)
@@ -28,9 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Widget for showing a list of feeds
@@ -50,30 +48,33 @@ class FeedList extends Widget
 {
     var $action = null;
 
-    function __construct($action=null)
+    protected $feeds = null;
+
+    public function __construct(Action $action=null, array $feeds=array())
     {
-       parent::__construct($action);
-       $this->action = $action;
+        parent::__construct($action);
+        $this->action = $action;
+        $this->feeds  = $feeds;
     }
 
-    function show($feeds)
+    public function show()
     {
-        if (Event::handle('StartShowFeedLinkList', array($this->action, &$feeds))) {
-            if (!empty($feeds)) {
+        if (Event::handle('StartShowFeedLinkList', array($this->action, &$this->feeds))) {
+            if (!empty($this->feeds)) {
                 $this->out->elementStart('div', array('id' => 'export_data',
                                                       'class' => 'section'));
                 // TRANS: Header for feed links (h2).
                 $this->out->element('h2', null, _('Feeds'));
                 $this->out->elementStart('ul', array('class' => 'xoxo'));
 
-                foreach ($feeds as $feed) {
+                foreach ($this->feeds as $feed) {
                     $this->feedItem($feed);
                 }
 
                 $this->out->elementEnd('ul');
                 $this->out->elementEnd('div');
             }
-            Event::handle('EndShowFeedLinkList', array($this->action, &$feeds));
+            Event::handle('EndShowFeedLinkList', array($this->action, &$this->feeds));
         }
     }
 
index 5cf05d4a324fede134e48eb9f0024a979f80b6f8..7d74fc47130eaf20f6bb23b116e21eab8f9d6664 100644 (file)
@@ -50,7 +50,7 @@ class FormAction extends ManagedAction
     protected function prepare(array $args=array()) {
         parent::prepare($args);
 
-        $this->form = $this->form ?: $this->action;
+        $this->form = $this->form ?: ucfirst($this->action);
         $this->args['form'] = $this->form;
 
         $this->type = !is_null($this->type) ? $this->type : $this->trimmed('type');
index da43297d1050222d0ec1b42f10ee33d601b44663..fec265fd1effd6ca81d52077de8fd60fedb505ed 100644 (file)
@@ -23,7 +23,7 @@ define('GNUSOCIAL_ENGINE', 'GNU social');
 define('GNUSOCIAL_ENGINE_URL', 'https://www.gnu.org/software/social/');
 
 define('GNUSOCIAL_BASE_VERSION', '1.2.0');
-define('GNUSOCIAL_LIFECYCLE', 'alpha1'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
+define('GNUSOCIAL_LIFECYCLE', 'alpha2'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
 
 define('GNUSOCIAL_VERSION', GNUSOCIAL_BASE_VERSION . '-' . GNUSOCIAL_LIFECYCLE);
 
index 8e5d1a39fb60584f29b001103c74f5fb8ce0ca24..f047e16a60e4a916111d8e07a00cf345192149fd 100644 (file)
@@ -91,7 +91,7 @@ class GroupsNav extends MoreMenu
                      _('See all groups you belong to.'));
     }
 
-    function item($actionName, $args, $label, $description, $id=null, $cls=null)
+    function item($actionName, array $args, $label, $description, $id=null, $cls=null)
     {
         if ($actionName != 'placeholder') {
             return parent::item($actionName, $args, $label, $description, $id, $cls);
index 2da4fa961a6cf4962a1dafbdcbb80b72235334b4..87ca03716089dc4c06f5b7f419d964d8c47fde27 100644 (file)
@@ -563,14 +563,12 @@ abstract class ImPlugin extends Plugin
         return true;
     }
 
-    function onEndShowHeadElements($action)
+    function onEndShowHeadElements(Action $action)
     {
-        $aname = $action->trimmed('action');
-
-        if ($aname == 'shownotice') {
+        if ($action instanceof ShownoticeAction) {
 
             $user_im_prefs = new User_im_prefs();
-            $user_im_prefs->user_id = $action->profile->id;
+            $user_im_prefs->user_id = $action->notice->getProfile()->getID();
             $user_im_prefs->transport = $this->transport;
 
             if ($user_im_prefs->find() && $user_im_prefs->fetch() && $user_im_prefs->microid && $action->notice->uri) {
@@ -580,13 +578,13 @@ abstract class ImPlugin extends Plugin
                                              'content' => $id->toString()));
             }
 
-        } else if ($aname == 'showstream') {
+        } elseif ($action instanceof ShowstreamAction) {
 
             $user_im_prefs = new User_im_prefs();
-            $user_im_prefs->user_id = $action->user->id;
+            $user_im_prefs->user_id = $action->getTarget()->getID();
             $user_im_prefs->transport = $this->transport;
 
-            if ($user_im_prefs->find() && $user_im_prefs->fetch() && $user_im_prefs->microid && $action->profile->profileurl) {
+            if ($user_im_prefs->find() && $user_im_prefs->fetch() && $user_im_prefs->microid && $action->getTarget()->getUrl()) {
                 $id = new Microid($this->microiduri($user_im_prefs->screenname),
                                   $action->selfUrl());
                 $action->element('meta', array('name' => 'microid',
index 57e204cf861cfc1b6c2af3ba0ebe4087739f9fd6..37bbfe92a2bd3d22462c4d8440249a8567fa3a6c 100644 (file)
@@ -53,7 +53,7 @@ class InviteButtonSection extends Section
         $this->out = $out;
         if (empty($buttonText)) {
             // TRANS: Default button text for inviting more users to the StatusNet instance.
-            $this->buttonText = _m('BUTTON', 'Invite more colleagues');
+            $this->buttonText = _m('BUTTON', 'Invite more people');
         } else {
             $this->buttonText = $buttonText;
         }
index 188792d02a0511fab7493318435a05604a8bb50a..7ac743bfee8d58fa9dae64de2bf3a0af0cfae725 100644 (file)
@@ -47,11 +47,13 @@ require_once 'Mail.php';
 function mail_backend()
 {
     static $backend = null;
+    global $_PEAR;
 
     if (!$backend) {
-        $backend = Mail::factory(common_config('mail', 'backend'),
+        $mail = new Mail();
+        $backend = $mail->factory(common_config('mail', 'backend'),
                                  common_config('mail', 'params') ?: array());
-        if (PEAR::isError($backend)) {
+        if ($_PEAR->isError($backend)) {
             common_server_error($backend->getMessage(), 500);
         }
     }
diff --git a/lib/noticestreamaction.php b/lib/noticestreamaction.php
new file mode 100644 (file)
index 0000000..ed89218
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+if (!defined('GNUSOCIAL')) { exit(1); }
+
+abstract class NoticestreamAction extends ProfileAction
+{
+    protected $notice = null;   // holds the stream result
+
+    protected function prepare(array $args=array()) {
+        parent::prepare($args);
+
+        // fetch the actual stream stuff
+        $stream = $this->getStream();
+        $this->notice = $stream->getNotices(($this->page-1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
+
+        if ($this->page > 1 && $this->notice->N == 0) {
+            // TRANS: Client error when page not found (404).
+            $this->clientError(_('No such page.'), 404);
+        }
+
+        return true;
+    }
+
+    // this fetches the NoticeStream
+    abstract public function getStream();
+}
index 1da153c85f2d40206ff63d3b1edd64b0015ae10e..31c279cbff6850bb5d9469bc28c84abaa96760b5 100644 (file)
@@ -103,8 +103,8 @@ class PeopletagsWidget extends Widget
             $this->out->elementStart('li', 'hashptag mode-' . $mode);
             // Avoid space by using raw output.
             $pt = '<span class="mark_hash">#</span><a rel="tag" href="' .
-              $this->url($this->tag->tag) .
-              '">' . $this->tag->tag . '</a>';
+              htmlspecialchars($this->url()) .
+              '">' . htmlspecialchars($this->tag->tag) . '</a>';
             $this->out->raw($pt);
             $this->out->elementEnd('li');
         }
index c861c4f57f90fb6ceee594b719d2be842cc34acc..46b4661e897ec1f8242f1185d5d7a885c6b493e9 100644 (file)
@@ -27,9 +27,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Personal tag cloud section
@@ -42,12 +40,12 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
  */
 class PersonalTagCloudSection extends TagCloudSection
 {
-    var $user = null;
+    protected $profile = null;
 
-    function __construct($out=null, $user=null)
+    function __construct(Profile $profile, HTMLOutputter $out=null)
     {
         parent::__construct($out);
-        $this->user = $user;
+        $this->profile = $profile;
     }
 
     function title()
@@ -80,7 +78,7 @@ class PersonalTagCloudSection extends TagCloudSection
 
         $tag = Memcached_DataObject::cachedQuery('Notice_tag',
                                                  sprintf($qry,
-                                                         $this->user->id),
+                                                         $this->profile->getID()),
                                                  3600);
         return $tag;
     }
index 08e03bac5a62625888a4357346b90109b6bfddde..5a5d526e42065f6bd5974c535e4c0e516000c644 100644 (file)
@@ -50,7 +50,7 @@ abstract class ProfileAction extends ManagedAction
 
     protected function prepare(array $args=array())
     {
-        // this will call ->doPreparation() which lower classes can use
+        // this will call ->doPreparation() which child classes use to set $this->target
         parent::prepare($args);
 
         if ($this->target->hasRole(Profile_role::SILENCED)
@@ -58,16 +58,10 @@ abstract class ProfileAction extends ManagedAction
             throw new ClientException(_('This profile has been silenced by site moderators'), 403);
         }
 
-        // backwards compatibility until all actions are fixed to use $this->target
-        $this->profile = $this->target;
-
         $this->tag = $this->trimmed('tag');
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
         common_set_returnto($this->selfUrl());
 
-        // fetch the actual stream stuff
-        $this->profileActionPreparation();
-
         return true;
     }
 
@@ -78,6 +72,9 @@ abstract class ProfileAction extends ManagedAction
 
     public function getTarget()
     {
+        if (!$this->target instanceof Profile) {
+            throw new ServerException('No target profile in ProfileAction class');
+        }
         return $this->target;
     }
 
index e0b94ac76a67b07985f6f08a5ec7be4d49b4c593..6fe7b99c7b3a967515815df5a3e1bde0c425fa04 100644 (file)
@@ -32,18 +32,26 @@ if (!defined('GNUSOCIAL')) { exit(1); }
 class ProfileListItem extends Widget
 {
     /** Current profile. */
+    protected $target = null;
     var $profile = null;
     /** Action object using us. */
     var $action = null;
 
-    function __construct($profile, $action)
+    // FIXME: Directory plugin sends a User_group here, but should send a Profile and handle User_group specifics itself
+    function __construct($target, HTMLOutputter $action)
     {
         parent::__construct($action);
 
-        $this->profile = $profile;
+        $this->target = $target;
+        $this->profile = $this->target;
         $this->action  = $action;
     }
 
+    function getTarget()
+    {
+        return $this->target;
+    }
+
     function show()
     {
         if (Event::handle('StartProfileListItem', array($this))) {
index 1d9dd0e75124900db1e57067a2ccac01af4420f6..bf88091a9020ab2324f018edb6e15c36ffa60af5 100644 (file)
@@ -50,7 +50,7 @@ class PublicTagCloudSection extends TagCloudSection
     function title()
     {
         // TRANS: Title for inbox tag cloud section.
-        return _m('TITLE', 'Trending topics');
+        return _m('TITLE', 'Trends');
     }
 
     function getTags()
index ca8daf5a906f65744ace2d77d8bbea7c1850e5c3..b13c51c32834c92fb24facdbfeccc59454699871 100644 (file)
@@ -108,6 +108,11 @@ class Router
 
         if (Event::handle('StartInitializeRouter', array(&$m))) {
 
+            // top of the menu hierarchy, sometimes "Home"
+            $m->connect('', array('action' => 'top'));
+
+            // public endpoints
+
             $m->connect('robots.txt', array('action' => 'robotstxt'));
 
             $m->connect('opensearch/people', array('action' => 'opensearch',
@@ -156,13 +161,13 @@ class Router
                           'deleteaccount',
                           'restoreaccount',
                           'top',
+                          'public',
             );
 
             foreach ($main as $a) {
                 $m->connect('main/'.$a, array('action' => $a));
             }
 
-            $m->connect('main/public', array('action' => 'public'));
             $m->connect('main/all', array('action' => 'networkpublic'));
 
             $m->connect('main/tagprofile/:id', array('action' => 'tagprofile'),
@@ -239,12 +244,10 @@ class Router
                         array('action' => 'shownotice'),
                         array('notice' => '[0-9]+'));
 
-            $m->connect('notice/delete/:notice',
+            $m->connect('notice/:notice/delete',
                         array('action' => 'deletenotice'),
                         array('notice' => '[0-9]+'));
 
-            $m->connect('notice/delete', array('action' => 'deletenotice'));
-
             // conversation
 
             $m->connect('conversation/:id',
@@ -875,9 +878,6 @@ class Router
                             array('action' => 'rsd',
                                   'nickname' => $nickname));
 
-                $m->connect('',
-                            array('action' => 'startpage'));
-
                 // peopletags
 
                 $m->connect('peopletags',
@@ -930,9 +930,6 @@ class Router
                 }
             }
 
-            $m->connect('', array('action' => 'startpage'));
-            $m->connect('main/public', array('action' => 'public'));
-            $m->connect('main/all', array('action' => 'networkpublic'));
             $m->connect('rss', array('action' => 'publicrss'));
             $m->connect('featuredrss', array('action' => 'featuredrss'));
             $m->connect('featured/', array('action' => 'featured'));
@@ -950,6 +947,13 @@ class Router
                         array('action' => 'subqueue'),
                         array('nickname' => Nickname::DISPLAY_FMT));
 
+            // some targeted RSS 1.0 actions (extends TargetedRss10Action)
+            foreach (array('all', 'replies') as $a) {
+                $m->connect(':nickname/'.$a.'/rss',
+                            array('action' => $a.'rss'),
+                            array('nickname' => Nickname::DISPLAY_FMT));
+            }
+
             // people tags
 
             $m->connect(':nickname/peopletags',
@@ -1017,12 +1021,6 @@ class Router
                             array('nickname' => Nickname::DISPLAY_FMT));
             }
 
-            foreach (array('all', 'replies') as $a) {
-                $m->connect(':nickname/'.$a.'/rss',
-                            array('action' => $a.'rss'),
-                            array('nickname' => Nickname::DISPLAY_FMT));
-            }
-
             $m->connect(':nickname/avatar',
                         array('action' => 'avatarbynickname'),
                         array('nickname' => Nickname::DISPLAY_FMT));
diff --git a/lib/rss10action.php b/lib/rss10action.php
new file mode 100644 (file)
index 0000000..744d1e4
--- /dev/null
@@ -0,0 +1,375 @@
+<?php
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Base class for RSS 1.0 feed actions
+ *
+ * PHP version 5
+ *
+ * LICENCE: 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/>.
+ *
+ * @category  Mail
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @author    Earle Martin <earle@downlode.org>
+ * @copyright 2008-9 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link      http://status.net/
+ */
+
+if (!defined('GNUSOCIAL')) { exit(1); }
+
+define('DEFAULT_RSS_LIMIT', 48);
+
+class Rss10Action extends ManagedAction
+{
+    // This will contain the details of each feed item's author and be used to generate SIOC data.
+
+    var $creators = array();
+    var $limit = DEFAULT_RSS_LIMIT;
+    var $notices = null;
+    var $tags_already_output = array();
+
+    public function isReadOnly($args)
+    {
+        return true;
+    }
+
+    protected function doPreparation()
+    {
+        $this->limit = $this->int('limit');
+
+        if (empty($this->limit)) {
+            $this->limit = DEFAULT_RSS_LIMIT;
+        }
+
+        if (common_config('site', 'private')) {
+            if (!isset($_SERVER['PHP_AUTH_USER'])) {
+
+                // This header makes basic auth go
+                header('WWW-Authenticate: Basic realm="GNU social RSS"');
+
+                // If the user hits cancel -- bam!
+                $this->show_basic_auth_error();
+                // the above calls 'exit'
+            } else {
+                $nickname = $_SERVER['PHP_AUTH_USER'];
+                $password = $_SERVER['PHP_AUTH_PW'];
+
+                if (!common_check_user($nickname, $password)) {
+                    // basic authentication failed
+                    list($proxy, $ip) = common_client_ip();
+
+                    common_log(LOG_WARNING, "Failed RSS auth attempt, nickname = $nickname, proxy = $proxy, ip = $ip.");
+                    $this->show_basic_auth_error();
+                    // the above calls 'exit'
+                }
+            }
+        }
+
+        $this->doStreamPreparation();
+
+        $this->notices = $this->getNotices($this->limit);
+    }
+
+    protected function doStreamPreparation()
+    {
+        // for example if we need to set $this->target or something
+    }
+
+    function show_basic_auth_error()
+    {
+        header('HTTP/1.1 401 Unauthorized');
+        header('Content-Type: application/xml; charset=utf-8');
+        $this->startXML();
+        $this->elementStart('hash');
+        $this->element('error', null, 'Could not authenticate you.');
+        $this->element('request', null, $_SERVER['REQUEST_URI']);
+        $this->elementEnd('hash');
+        $this->endXML();
+        exit;
+    }
+
+    /**
+     * Get the notices to output in this stream.
+     *
+     * @return array an array of Notice objects sorted in reverse chron
+     */
+
+    protected function getNotices()
+    {
+        return array();
+    }
+
+    /**
+     * Get a description of the channel
+     *
+     * Returns an array with the following
+     * @return array
+     */
+
+    function getChannel()
+    {
+        return array('url' => '',
+                     'title' => '',
+                     'link' => '',
+                     'description' => '');
+    }
+
+    function getImage()
+    {
+        return null;
+    }
+
+    function showPage()
+    {
+        $this->initRss();
+        $this->showChannel();
+        $this->showImage();
+
+        if (count($this->notices)) {
+            foreach ($this->notices as $n) {
+                try {
+                    $this->showItem($n);
+                } catch (Exception $e) {
+                    // log exceptions and continue
+                    common_log(LOG_ERR, $e->getMessage());
+                    continue;
+                }
+            }
+        }
+
+        $this->showCreators();
+        $this->endRss();
+    }
+
+    function showChannel()
+    {
+
+        $channel = $this->getChannel();
+        $image = $this->getImage();
+
+        $this->elementStart('channel', array('rdf:about' => $channel['url']));
+        $this->element('title', null, $channel['title']);
+        $this->element('link', null, $channel['link']);
+        $this->element('description', null, $channel['description']);
+        $this->element('cc:licence', array('rdf:resource' => common_config('license','url')));
+
+        if ($image) {
+            $this->element('image', array('rdf:resource' => $image));
+        }
+
+        $this->elementStart('items');
+        $this->elementStart('rdf:Seq');
+
+        if (count($this->notices)) {
+            foreach ($this->notices as $notice) {
+                $this->element('rdf:li', array('rdf:resource' => $notice->uri));
+            }
+        }
+
+        $this->elementEnd('rdf:Seq');
+        $this->elementEnd('items');
+
+        $this->elementEnd('channel');
+    }
+
+    function showImage()
+    {
+        $image = $this->getImage();
+        if ($image) {
+            $channel = $this->getChannel();
+            $this->elementStart('image', array('rdf:about' => $image));
+            $this->element('title', null, $channel['title']);
+            $this->element('link', null, $channel['link']);
+            $this->element('url', null, $image);
+            $this->elementEnd('image');
+        }
+    }
+
+    function showItem($notice)
+    {
+        $profile = $notice->getProfile();
+        $nurl = common_local_url('shownotice', array('notice' => $notice->id));
+        $creator_uri = common_profile_uri($profile);
+        $this->elementStart('item', array('rdf:about' => $notice->uri,
+                            'rdf:type' => 'http://rdfs.org/sioc/types#MicroblogPost'));
+        $title = $profile->nickname . ': ' . common_xml_safe_str(trim($notice->content));
+        $this->element('title', null, $title);
+        $this->element('link', null, $nurl);
+        $this->element('description', null, $profile->nickname."'s status on ".common_exact_date($notice->created));
+        if ($notice->rendered) {
+            $this->element('content:encoded', null, common_xml_safe_str($notice->rendered));
+        }
+        $this->element('dc:date', null, common_date_w3dtf($notice->created));
+        $this->element('dc:creator', null, ($profile->fullname) ? $profile->fullname : $profile->nickname);
+        $this->element('foaf:maker', array('rdf:resource' => $creator_uri));
+        $this->element('sioc:has_creator', array('rdf:resource' => $creator_uri.'#acct'));
+        $location = $notice->getLocation();
+        if ($location && isset($location->lat) && isset($location->lon)) {
+            $location_uri = $location->getRdfURL();
+            $attrs = array('geo:lat' => $location->lat,
+                'geo:long' => $location->lon);
+            if (strlen($location_uri)) {
+                $attrs['rdf:resource'] = $location_uri;
+            }
+            $this->element('statusnet:origin', $attrs);
+        }
+        $this->element('statusnet:postIcon', array('rdf:resource' => $profile->avatarUrl()));
+        $this->element('cc:licence', array('rdf:resource' => common_config('license', 'url')));
+        if ($notice->reply_to) {
+            $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to));
+            $this->element('sioc:reply_of', array('rdf:resource' => $replyurl));
+        }
+        if (!empty($notice->conversation)) {
+            $conversationurl = common_local_url('conversation',
+                                         array('id' => $notice->conversation));
+            $this->element('sioc:has_discussion', array('rdf:resource' => $conversationurl));
+        }
+        $attachments = $notice->attachments();
+        if($attachments){
+            foreach($attachments as $attachment){
+                try {
+                    $enclosure = $attachment->getEnclosure();
+                    $attribs = array('rdf:resource' => $enclosure->url);
+                    if ($enclosure->title) {
+                        $attribs['dc:title'] = $enclosure->title;
+                    }
+                    if ($enclosure->modified) {
+                        $attribs['dc:date'] = common_date_w3dtf($enclosure->modified);
+                    }
+                    if ($enclosure->size) {
+                        $attribs['enc:length'] = $enclosure->size;
+                    }
+                    if ($enclosure->mimetype) {
+                        $attribs['enc:type'] = $enclosure->mimetype;
+                    }
+                    $this->element('enc:enclosure', $attribs);
+                } catch (ServerException $e) {
+                    // There was not enough metadata available
+                }
+                $this->element('sioc:links_to', array('rdf:resource'=>$attachment->url));
+            }
+        }
+
+        $tag = new Notice_tag();
+        $tag->notice_id = $notice->id;
+        if ($tag->find()) {
+            $entry['tags']=array();
+            while ($tag->fetch()) {
+                $tagpage = common_local_url('tag', array('tag' => $tag->tag));
+
+                if ( in_array($tag, $this->tags_already_output) ) {
+                    $this->element('ctag:tagged', array('rdf:resource'=>$tagpage.'#concept'));
+                    continue;
+                }
+
+                $tagrss  = common_local_url('tagrss', array('tag' => $tag->tag));
+                $this->elementStart('ctag:tagged');
+                $this->elementStart('ctag:Tag', array('rdf:about'=>$tagpage.'#concept', 'ctag:label'=>$tag->tag));
+                $this->element('foaf:page', array('rdf:resource'=>$tagpage));
+                $this->element('rdfs:seeAlso', array('rdf:resource'=>$tagrss));
+                $this->elementEnd('ctag:Tag');
+                $this->elementEnd('ctag:tagged');
+
+                $this->tags_already_output[] = $tag->tag;
+            }
+        }
+        $this->elementEnd('item');
+        $this->creators[$creator_uri] = $profile;
+    }
+
+    function showCreators()
+    {
+        foreach ($this->creators as $uri => $profile) {
+            $id = $profile->id;
+            $nickname = $profile->nickname;
+            $this->elementStart('foaf:Agent', array('rdf:about' => $uri));
+            $this->element('foaf:nick', null, $nickname);
+            if ($profile->fullname) {
+                $this->element('foaf:name', null, $profile->fullname);
+            }
+            $this->element('foaf:holdsAccount', array('rdf:resource' => $uri.'#acct'));
+            $avatar = $profile->avatarUrl();
+            $this->element('foaf:depiction', array('rdf:resource' => $avatar));
+            $this->elementEnd('foaf:Agent');
+        }
+    }
+
+    function initRss()
+    {
+        $channel = $this->getChannel();
+        header('Content-Type: application/rdf+xml');
+
+        $this->startXml();
+        $this->elementStart('rdf:RDF', array('xmlns:rdf' =>
+                                              'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
+                                              'xmlns:dc' =>
+                                              'http://purl.org/dc/elements/1.1/',
+                                              'xmlns:cc' =>
+                                              'http://creativecommons.org/ns#',
+                                              'xmlns:content' =>
+                                              'http://purl.org/rss/1.0/modules/content/',
+                                              'xmlns:ctag' =>
+                                              'http://commontag.org/ns#',
+                                              'xmlns:foaf' =>
+                                              'http://xmlns.com/foaf/0.1/',
+                                              'xmlns:enc' =>
+                                              'http://purl.oclc.org/net/rss_2.0/enc#',
+                                              'xmlns:sioc' =>
+                                              'http://rdfs.org/sioc/ns#',
+                                              'xmlns:sioct' =>
+                                              'http://rdfs.org/sioc/types#',
+                                              'xmlns:rdfs' =>
+                                              'http://www.w3.org/2000/01/rdf-schema#',
+                                              'xmlns:geo' =>
+                                              'http://www.w3.org/2003/01/geo/wgs84_pos#',
+                                              'xmlns:statusnet' =>
+                                              'http://status.net/ont/',
+                                              'xmlns' => 'http://purl.org/rss/1.0/'));
+        $this->elementStart('sioc:Site', array('rdf:about' => common_root_url()));
+        $this->element('sioc:name', null, common_config('site', 'name'));
+        $this->elementStart('sioc:space_of');
+        $this->element('sioc:Container', array('rdf:about' =>
+                                               $channel['url']));
+        $this->elementEnd('sioc:space_of');
+        $this->elementEnd('sioc:Site');
+    }
+
+    function endRss()
+    {
+        $this->elementEnd('rdf:RDF');
+    }
+
+    /**
+     * When was this page last modified?
+     *
+     */
+
+    function lastModified()
+    {
+        if (empty($this->notices)) {
+            return null;
+        }
+
+        if (count($this->notices) == 0) {
+            return null;
+        }
+
+        // FIXME: doesn't handle modified profiles, avatars, deleted notices
+
+        return strtotime($this->notices[0]->created);
+    }
+}
+
diff --git a/lib/rssaction.php b/lib/rssaction.php
deleted file mode 100644 (file)
index c3e1283..0000000
+++ /dev/null
@@ -1,413 +0,0 @@
-<?php
-/**
- * StatusNet, the distributed open-source microblogging tool
- *
- * Base class for RSS 1.0 feed actions
- *
- * PHP version 5
- *
- * LICENCE: 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/>.
- *
- * @category  Mail
- * @package   StatusNet
- * @author    Evan Prodromou <evan@status.net>
- * @author    Earle Martin <earle@downlode.org>
- * @copyright 2008-9 StatusNet, Inc.
- * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link      http://status.net/
- */
-
-if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
-
-define('DEFAULT_RSS_LIMIT', 48);
-
-class Rss10Action extends Action
-{
-    // This will contain the details of each feed item's author and be used to generate SIOC data.
-
-    var $creators = array();
-    var $limit = DEFAULT_RSS_LIMIT;
-    var $notices = null;
-    var $tags_already_output = array();
-
-    /**
-     * Constructor
-     *
-     * Just wraps the Action constructor.
-     *
-     * @param string  $output URI to output to, default = stdout
-     * @param boolean $indent Whether to indent output, default true
-     *
-     * @see Action::__construct
-     */
-
-    function __construct($output='php://output', $indent=null)
-    {
-        parent::__construct($output, $indent);
-    }
-
-    /**
-     * Do we need to write to the database?
-     *
-     * @return boolean true
-     */
-
-    function isReadonly()
-    {
-        return true;
-    }
-
-    /**
-     * Read arguments and initialize members
-     *
-     * @param array $args Arguments from $_REQUEST
-     * @return boolean success
-     */
-
-    function prepare($args)
-    {
-        parent::prepare($args);
-
-        $this->limit = (int) $this->trimmed('limit');
-
-        if ($this->limit == 0) {
-            $this->limit = DEFAULT_RSS_LIMIT;
-        }
-
-        if (common_config('site', 'private')) {
-            if (!isset($_SERVER['PHP_AUTH_USER'])) {
-
-                // This header makes basic auth go
-                header('WWW-Authenticate: Basic realm="GNU social RSS"');
-
-                // If the user hits cancel -- bam!
-                $this->show_basic_auth_error();
-                return;
-            } else {
-                $nickname = $_SERVER['PHP_AUTH_USER'];
-                $password = $_SERVER['PHP_AUTH_PW'];
-
-                if (!common_check_user($nickname, $password)) {
-                    // basic authentication failed
-                    list($proxy, $ip) = common_client_ip();
-
-                    common_log(LOG_WARNING, "Failed RSS auth attempt, nickname = $nickname, proxy = $proxy, ip = $ip.");
-                    $this->show_basic_auth_error();
-                    return;
-                }
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Handle a request
-     *
-     * @param array $args Arguments from $_REQUEST
-     *
-     * @return void
-     */
-
-    function handle($args)
-    {
-        // Parent handling, including cache check
-        parent::handle($args);
-        $this->showRss();
-    }
-
-    function show_basic_auth_error()
-    {
-        header('HTTP/1.1 401 Unauthorized');
-        header('Content-Type: application/xml; charset=utf-8');
-        $this->startXML();
-        $this->elementStart('hash');
-        $this->element('error', null, 'Could not authenticate you.');
-        $this->element('request', null, $_SERVER['REQUEST_URI']);
-        $this->elementEnd('hash');
-        $this->endXML();
-    }
-
-    /**
-     * Get the notices to output in this stream.
-     *
-     * @return array an array of Notice objects sorted in reverse chron
-     */
-
-    function getNotices()
-    {
-        return array();
-    }
-
-    /**
-     * Get a description of the channel
-     *
-     * Returns an array with the following
-     * @return array
-     */
-
-    function getChannel()
-    {
-        return array('url' => '',
-                     'title' => '',
-                     'link' => '',
-                     'description' => '');
-    }
-
-    function getImage()
-    {
-        return null;
-    }
-
-    function showRss()
-    {
-        $this->initRss();
-        $this->showChannel();
-        $this->showImage();
-
-        if (count($this->notices)) {
-            foreach ($this->notices as $n) {
-                try {
-                    $this->showItem($n);
-                } catch (Exception $e) {
-                    // log exceptions and continue
-                    common_log(LOG_ERR, $e->getMessage());
-                    continue;
-                }
-            }
-        }
-
-        $this->showCreators();
-        $this->endRss();
-    }
-
-    function showChannel()
-    {
-
-        $channel = $this->getChannel();
-        $image = $this->getImage();
-
-        $this->elementStart('channel', array('rdf:about' => $channel['url']));
-        $this->element('title', null, $channel['title']);
-        $this->element('link', null, $channel['link']);
-        $this->element('description', null, $channel['description']);
-        $this->element('cc:licence', array('rdf:resource' => common_config('license','url')));
-
-        if ($image) {
-            $this->element('image', array('rdf:resource' => $image));
-        }
-
-        $this->elementStart('items');
-        $this->elementStart('rdf:Seq');
-
-        if (count($this->notices)) {
-            foreach ($this->notices as $notice) {
-                $this->element('rdf:li', array('rdf:resource' => $notice->uri));
-            }
-        }
-
-        $this->elementEnd('rdf:Seq');
-        $this->elementEnd('items');
-
-        $this->elementEnd('channel');
-    }
-
-    function showImage()
-    {
-        $image = $this->getImage();
-        if ($image) {
-            $channel = $this->getChannel();
-            $this->elementStart('image', array('rdf:about' => $image));
-            $this->element('title', null, $channel['title']);
-            $this->element('link', null, $channel['link']);
-            $this->element('url', null, $image);
-            $this->elementEnd('image');
-        }
-    }
-
-    function showItem($notice)
-    {
-        $profile = $notice->getProfile();
-        $nurl = common_local_url('shownotice', array('notice' => $notice->id));
-        $creator_uri = common_profile_uri($profile);
-        $this->elementStart('item', array('rdf:about' => $notice->uri,
-                            'rdf:type' => 'http://rdfs.org/sioc/types#MicroblogPost'));
-        $title = $profile->nickname . ': ' . common_xml_safe_str(trim($notice->content));
-        $this->element('title', null, $title);
-        $this->element('link', null, $nurl);
-        $this->element('description', null, $profile->nickname."'s status on ".common_exact_date($notice->created));
-        if ($notice->rendered) {
-            $this->element('content:encoded', null, common_xml_safe_str($notice->rendered));
-        }
-        $this->element('dc:date', null, common_date_w3dtf($notice->created));
-        $this->element('dc:creator', null, ($profile->fullname) ? $profile->fullname : $profile->nickname);
-        $this->element('foaf:maker', array('rdf:resource' => $creator_uri));
-        $this->element('sioc:has_creator', array('rdf:resource' => $creator_uri.'#acct'));
-        $location = $notice->getLocation();
-        if ($location && isset($location->lat) && isset($location->lon)) {
-            $location_uri = $location->getRdfURL();
-            $attrs = array('geo:lat' => $location->lat,
-                'geo:long' => $location->lon);
-            if (strlen($location_uri)) {
-                $attrs['rdf:resource'] = $location_uri;
-            }
-            $this->element('statusnet:origin', $attrs);
-        }
-        $this->element('statusnet:postIcon', array('rdf:resource' => $profile->avatarUrl()));
-        $this->element('cc:licence', array('rdf:resource' => common_config('license', 'url')));
-        if ($notice->reply_to) {
-            $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to));
-            $this->element('sioc:reply_of', array('rdf:resource' => $replyurl));
-        }
-        if (!empty($notice->conversation)) {
-            $conversationurl = common_local_url('conversation',
-                                         array('id' => $notice->conversation));
-            $this->element('sioc:has_discussion', array('rdf:resource' => $conversationurl));
-        }
-        $attachments = $notice->attachments();
-        if($attachments){
-            foreach($attachments as $attachment){
-                try {
-                    $enclosure = $attachment->getEnclosure();
-                    $attribs = array('rdf:resource' => $enclosure->url);
-                    if ($enclosure->title) {
-                        $attribs['dc:title'] = $enclosure->title;
-                    }
-                    if ($enclosure->modified) {
-                        $attribs['dc:date'] = common_date_w3dtf($enclosure->modified);
-                    }
-                    if ($enclosure->size) {
-                        $attribs['enc:length'] = $enclosure->size;
-                    }
-                    if ($enclosure->mimetype) {
-                        $attribs['enc:type'] = $enclosure->mimetype;
-                    }
-                    $this->element('enc:enclosure', $attribs);
-                } catch (ServerException $e) {
-                    // There was not enough metadata available
-                }
-                $this->element('sioc:links_to', array('rdf:resource'=>$attachment->url));
-            }
-        }
-
-        $tag = new Notice_tag();
-        $tag->notice_id = $notice->id;
-        if ($tag->find()) {
-            $entry['tags']=array();
-            while ($tag->fetch()) {
-                $tagpage = common_local_url('tag', array('tag' => $tag->tag));
-
-                if ( in_array($tag, $this->tags_already_output) ) {
-                    $this->element('ctag:tagged', array('rdf:resource'=>$tagpage.'#concept'));
-                    continue;
-                }
-
-                $tagrss  = common_local_url('tagrss', array('tag' => $tag->tag));
-                $this->elementStart('ctag:tagged');
-                $this->elementStart('ctag:Tag', array('rdf:about'=>$tagpage.'#concept', 'ctag:label'=>$tag->tag));
-                $this->element('foaf:page', array('rdf:resource'=>$tagpage));
-                $this->element('rdfs:seeAlso', array('rdf:resource'=>$tagrss));
-                $this->elementEnd('ctag:Tag');
-                $this->elementEnd('ctag:tagged');
-
-                $this->tags_already_output[] = $tag->tag;
-            }
-        }
-        $this->elementEnd('item');
-        $this->creators[$creator_uri] = $profile;
-    }
-
-    function showCreators()
-    {
-        foreach ($this->creators as $uri => $profile) {
-            $id = $profile->id;
-            $nickname = $profile->nickname;
-            $this->elementStart('foaf:Agent', array('rdf:about' => $uri));
-            $this->element('foaf:nick', null, $nickname);
-            if ($profile->fullname) {
-                $this->element('foaf:name', null, $profile->fullname);
-            }
-            $this->element('foaf:holdsAccount', array('rdf:resource' => $uri.'#acct'));
-            $avatar = $profile->avatarUrl();
-            $this->element('foaf:depiction', array('rdf:resource' => $avatar));
-            $this->elementEnd('foaf:Agent');
-        }
-    }
-
-    function initRss()
-    {
-        $channel = $this->getChannel();
-        header('Content-Type: application/rdf+xml');
-
-        $this->startXml();
-        $this->elementStart('rdf:RDF', array('xmlns:rdf' =>
-                                              'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
-                                              'xmlns:dc' =>
-                                              'http://purl.org/dc/elements/1.1/',
-                                              'xmlns:cc' =>
-                                              'http://creativecommons.org/ns#',
-                                              'xmlns:content' =>
-                                              'http://purl.org/rss/1.0/modules/content/',
-                                              'xmlns:ctag' =>
-                                              'http://commontag.org/ns#',
-                                              'xmlns:foaf' =>
-                                              'http://xmlns.com/foaf/0.1/',
-                                              'xmlns:enc' =>
-                                              'http://purl.oclc.org/net/rss_2.0/enc#',
-                                              'xmlns:sioc' =>
-                                              'http://rdfs.org/sioc/ns#',
-                                              'xmlns:sioct' =>
-                                              'http://rdfs.org/sioc/types#',
-                                              'xmlns:rdfs' =>
-                                              'http://www.w3.org/2000/01/rdf-schema#',
-                                              'xmlns:geo' =>
-                                              'http://www.w3.org/2003/01/geo/wgs84_pos#',
-                                              'xmlns:statusnet' =>
-                                              'http://status.net/ont/',
-                                              'xmlns' => 'http://purl.org/rss/1.0/'));
-        $this->elementStart('sioc:Site', array('rdf:about' => common_root_url()));
-        $this->element('sioc:name', null, common_config('site', 'name'));
-        $this->elementStart('sioc:space_of');
-        $this->element('sioc:Container', array('rdf:about' =>
-                                               $channel['url']));
-        $this->elementEnd('sioc:space_of');
-        $this->elementEnd('sioc:Site');
-    }
-
-    function endRss()
-    {
-        $this->elementEnd('rdf:RDF');
-    }
-
-    /**
-     * When was this page last modified?
-     *
-     */
-
-    function lastModified()
-    {
-        if (empty($this->notices)) {
-            return null;
-        }
-
-        if (count($this->notices) == 0) {
-            return null;
-        }
-
-        // FIXME: doesn't handle modified profiles, avatars, deleted notices
-
-        return strtotime($this->notices[0]->created);
-    }
-}
-
index e2530769dfc67bfb68f1f681f461dfd8c0fd4a83..aff4544c0d81f8633d3ef426d7a9a426362b38e4 100644 (file)
@@ -29,10 +29,10 @@ if (!defined('GNUSOCIAL')) { exit(1); }
 
 class SelftagsWidget extends PeopletagsWidget
 {
-    function url($tag)
+    public function url()
     {
         // link to self tag page
-        return common_local_url('selftag', array('tag' => $tag));
+        return common_local_url('selftag', array('tag' => $this->tag->tag));
     }
 
     function label()
index 24a3bd98af96bf6c2baac39b53630217efe06a50..80a9042e0f1e0bac68016dabe147b2284b25e7b8 100644 (file)
@@ -115,11 +115,10 @@ class TagCloudSection extends Section
 
     function tagUrl($tag)
     {
-        if ('showstream' === $this->out->trimmed('action')) {
-            return common_local_url('showstream', array('nickname' => $this->out->profile->nickname, 'tag' => $tag));
-        } else {
-            return common_local_url('tag', array('tag' => $tag));
+        if ($this->out instanceof ShowstreamAction) {
+            return common_local_url('showstream', array('nickname' => $this->out->getTarget()->getNickname(), 'tag' => $tag));
         }
+        return common_local_url('tag', array('tag' => $tag));
     }
 
     function divId()
diff --git a/lib/targetedrss10action.php b/lib/targetedrss10action.php
new file mode 100644 (file)
index 0000000..c7615bd
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * StatusNet, the distributed open-source microblogging tool
+ *
+ * Base class for RSS 1.0 feed actions
+ *
+ * PHP version 5
+ *
+ * LICENCE: 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/>.
+ *
+ * @category  Mail
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @author    Earle Martin <earle@downlode.org>
+ * @copyright 2008-9 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link      http://status.net/
+ */
+
+if (!defined('GNUSOCIAL')) { exit(1); }
+
+class TargetedRss10Action extends Rss10Action
+{
+    protected $target = null;
+
+    protected function doStreamPreparation()
+    {
+        $this->target = User::getByNickname($this->trimmed('nickname'))->getProfile();
+    }
+
+    function getImage()
+    {
+        return $this->target->avatarUrl(AVATAR_PROFILE_SIZE);
+    }
+}
index 566b6a0f29accba2aecee3f0ecc757c192316dd2..153d9001b54aef0882e291168083db9882d01638 100644 (file)
@@ -87,10 +87,9 @@ class ToSelector extends Widget
             $choices['public:everyone'] = _m('SENDTO','Everyone');
             $default = 'public:everyone';
         }
-        // XXX: better name...?
         // TRANS: Option in drop-down of potential addressees.
         // TRANS: %s is a StatusNet sitename.
-        $choices['public:site'] = sprintf(_('My colleagues at %s'), common_config('site', 'name'));
+        $choices['public:site'] = sprintf(_('Everyone at %s'), common_config('site', 'name'));
 
         $groups = $this->user->getGroups();
 
old mode 100755 (executable)
new mode 100644 (file)
index fc3331482f9538b752d6d20818f47ad079c433fe..955b78266660bad2ffa3b5d530ef807e71e40d06 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
-
-require_once INSTALLDIR.'/lib/rssaction.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * RSS feed for user bookmarks action class.
@@ -48,54 +44,12 @@ require_once INSTALLDIR.'/lib/rssaction.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://status.net/
  */
-class BookmarksrssAction extends Rss10Action
+class BookmarksrssAction extends TargetedRss10Action
 {
-    /** The user whose bookmarks to display */
-
-    var $user = null;
-
-    /**
-     * Find the user to display by supplied nickname
-     *
-     * @param array $args Arguments from $_REQUEST
-     *
-     * @return boolean success
-     */
-    function prepare($args)
-    {        
-        parent::prepare($args);
-
-        $nickname   = $this->trimmed('nickname');
-        $this->user = User::getKV('nickname', $nickname);
-
-        if (!$this->user) {
-            // TRANS: Client error displayed when trying to get the RSS feed with bookmarks of a user that does not exist.
-            $this->clientError(_('No such user.'));
-        } else {
-            $this->notices = $this->getNotices($this->limit);
-            return true;
-        }
-    }
-
-    /**
-     * Get notices
-     *
-     * @param integer $limit max number of notices to return
-     *
-     * @return array notices
-     */
-    function getNotices($limit=0)
+    protected function getNotices()
     {
-        $user    = $this->user;
-
-        $notice = new BookmarksNoticeStream($this->user->id, true);
-        $notice = $notice->getNotices(0, NOTICES_PER_PAGE);
-
-        $notices = array();
-        while ($notice->fetch()) {
-            $notices[] = clone($notice);
-        }
-        return $notices;
+        $stream = new BookmarksNoticeStream($this->target->getID(), true);
+        return $stream->getNotices(0, $this->limit)->fetchAll();
     }
 
      /**
@@ -105,31 +59,19 @@ class BookmarksrssAction extends Rss10Action
      */
     function getChannel()
     {
-        $user = $this->user;
         $c    = array('url' => common_local_url('bookmarksrss',
                                         array('nickname' =>
-                                        $user->nickname)),
+                                        $this->target->getNickname())),
                    // TRANS: Title of RSS feed with bookmarks of a user.
                    // TRANS: %s is a user's nickname.
-                   'title' => sprintf(_("%s's bookmarks"), $user->nickname),
+                   'title' => sprintf(_("%s's bookmarks"), $this->target->getNickname()),
                    'link' => common_local_url('bookmarks',
                                         array('nickname' =>
-                                        $user->nickname)),
+                                        $this->target->getNickname())),
                    // TRANS: Desciption of RSS feed with bookmarks of a user.
                    // TRANS: %1$s is a user's nickname, %2$s is the name of the StatusNet site.
                    'description' => sprintf(_('Bookmarks posted by %1$s on %2$s!'),
-                                        $user->nickname, common_config('site', 'name')));
+                                        $this->target->getNickname(), common_config('site', 'name')));
         return $c;
     }
-
-    /**
-     * Get image.
-     *
-     * @return void
-    */
-    function getImage()
-    {
-        return null;
-    }
-
 }
index c18559f49daaf1a4419e7ff53923c1b9e11f99cb..8e7f6f806152cb03e9b88e4ea6927614b1701650 100644 (file)
@@ -30,9 +30,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Show a list of direct messages from or to the authenticating user
@@ -62,13 +60,11 @@ class ApiDirectMessageAction extends ApiAuthAction
      *
      * @return boolean success flag
      */
-    function prepare($args)
+    protected function prepare(array $args=array())
     {
         parent::prepare($args);
 
-        $this->user = $this->auth_user;
-
-        if (empty($this->user)) {
+        if (!$this->scoped instanceof Profile) {
             // TRANS: Client error given when a user was not found (404).
             $this->clientError(_('No such user.'), 404);
         }
@@ -83,30 +79,30 @@ class ApiDirectMessageAction extends ApiAuthAction
             $this->title = sprintf(
                 // TRANS: Title. %s is a user nickname.
                 _("Direct messages from %s"),
-                $this->user->nickname
+                $this->scoped->getNickname()
             );
             $this->subtitle = sprintf(
                 // TRANS: Subtitle. %s is a user nickname.
                 _("All the direct messages sent from %s"),
-                $this->user->nickname
+                $this->scoped->getNickname()
             );
-            $this->link = $server . $this->user->nickname . '/outbox';
+            $this->link = $server . $this->scoped->getNickname() . '/outbox';
             $this->selfuri_base = common_root_url() . 'api/direct_messages/sent';
-            $this->id = "tag:$taguribase:SentDirectMessages:" . $this->user->id;
+            $this->id = "tag:$taguribase:SentDirectMessages:" . $this->scoped->getID();
         } else {
             $this->title = sprintf(
                 // TRANS: Title. %s is a user nickname.
                 _("Direct messages to %s"),
-                $this->user->nickname
+                $this->scoped->getNickname()
             );
             $this->subtitle = sprintf(
                 // TRANS: Subtitle. %s is a user nickname.
                 _("All the direct messages sent to %s"),
-                $this->user->nickname
+                $this->scoped->getNickname()
             );
-            $this->link = $server . $this->user->nickname . '/inbox';
+            $this->link = $server . $this->scoped->getNickname() . '/inbox';
             $this->selfuri_base = common_root_url() . 'api/direct_messages';
-            $this->id = "tag:$taguribase:DirectMessages:" . $this->user->id;
+            $this->id = "tag:$taguribase:DirectMessages:" . $this->scoped->getID();
         }
 
         $this->messages = $this->getMessages();
@@ -114,18 +110,9 @@ class ApiDirectMessageAction extends ApiAuthAction
         return true;
     }
 
-    /**
-     * Handle the request
-     *
-     * Show the messages
-     *
-     * @param array $args $_REQUEST data (unused)
-     *
-     * @return void
-     */
-    function handle($args)
+    protected function handle()
     {
-        parent::handle($args);
+        parent::handle();
         $this->showMessages();
     }
 
@@ -166,9 +153,9 @@ class ApiDirectMessageAction extends ApiAuthAction
         $message  = new Message();
 
         if ($this->arg('sent')) {
-            $message->from_profile = $this->user->id;
+            $message->from_profile = $this->scoped->getID();
         } else {
-            $message->to_profile = $this->user->id;
+            $message->to_profile = $this->scoped->getID();
         }
 
         if (!empty($this->max_id)) {
index 653fa3a9ed0ce88c045d996d509393a5fd64faa7..e2c7ab5ca726ba7bdf8acd4162a4e44a2129e744 100644 (file)
@@ -30,9 +30,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Creates a new direct message from the authenticating user to
@@ -65,7 +63,7 @@ class ApiDirectMessageNewAction extends ApiAuthAction
     {
         parent::prepare($args);
 
-        if (empty($this->user)) {
+        if (!$this->scoped instanceof Profile) {
             // TRANS: Client error when user not found for an API direct message action.
             $this->clientError(_('No such user.'), 404);
         }
@@ -111,10 +109,10 @@ class ApiDirectMessageNewAction extends ApiAuthAction
         if (!$this->other instanceof Profile) {
             // TRANS: Client error displayed if a recipient user could not be found (403).
             $this->clientError(_('Recipient user not found.'), 403);
-        } else if (!$this->user->mutuallySubscribed($this->other)) {
+        } else if (!$this->scoped->mutuallySubscribed($this->other)) {
             // TRANS: Client error displayed trying to direct message another user who's not a friend (403).
             $this->clientError(_('Cannot send direct messages to users who aren\'t your friend.'), 403);
-        } else if ($this->user->id == $this->other->id) {
+        } else if ($this->scoped->getID() === $this->other->getID()) {
 
             // Note: sending msgs to yourself is allowed by Twitter
 
@@ -123,8 +121,8 @@ class ApiDirectMessageNewAction extends ApiAuthAction
         }
 
         $message = Message::saveNew(
-            $this->user->id,
-            $this->other->id,
+            $this->scoped->getID(),
+            $this->other->getID(),
             html_entity_decode($this->content, ENT_NOQUOTES, 'UTF-8'),
             $this->source
         );
index cae94e3427f668c33d46ed534ad67a53c3df485f..e06c1c7271c5b64a1cd42d510d77b2d9faf8722e 100644 (file)
@@ -238,9 +238,9 @@ class DirectoryPlugin extends Plugin
         $nav->out->menuItem(
             common_local_url('userdirectory'),
             // TRANS: Menu item text for user directory.
-            _m('MENU','Directory'),
+            _m('MENU','People'),
             // TRANS: Menu item title for user directory.
-            _m('User Directory.'),
+            _m('People.'),
             $actionName == 'userdirectory',
             'nav_directory'
         );
index d49c28fe559cb73dbad001a16de656d140770c57..b4fe68d4cc202695536ed20a46742e5ebe2bd85e 100644 (file)
@@ -41,10 +41,6 @@ table.profile_list tr {
     float: none;
 }
 
-table.profile_list tr.alt {
-    background-color: #def; /* zebra stripe */
-}
-
 table.profie_list td {
     width: 100%;
     padding: 0;
@@ -61,4 +57,4 @@ th.current.reverse {
     background-image: url(../images/control_arrow_up.gif);
     background-repeat: no-repeat;
     background-position: 60% 2px;
-}
\ No newline at end of file
+}
index 7474d0daa608f9cfa9a037a8da1b4f71bf11e13a..ab00068f6d20a5f438794e1986dc3d07a98db8b8 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
-
-require_once INSTALLDIR . '/lib/subscriptionlist.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Widget to show a sortable list of subscriptions
@@ -44,16 +40,6 @@ require_once INSTALLDIR . '/lib/subscriptionlist.php';
  */
 class SortableGroupList extends SortableSubscriptionList
 {
-    /** Owner of this list */
-    var $owner = null;
-
-    function __construct($profile, $owner=null, $action=null)
-    {
-        parent::__construct($profile, $owner, $action);
-
-        $this->owner = $owner;
-    }
-
     function startList()
     {
         $this->out->elementStart('table', array('class' => 'profile_list xoxo'));
@@ -119,25 +105,14 @@ class SortableGroupList extends SortableSubscriptionList
         $this->out->elementStart('tbody');
     }
 
-    function newListItem($profile, $odd)
+    function newListItem($profile)
     {
-        return new SortableGroupListItem($profile, $this->owner, $this->action, $odd);
+        return new SortableGroupListItem($profile, $this->owner, $this->action);
     }
 }
 
 class SortableGroupListItem extends SortableSubscriptionListItem
 {
-    /** Owner of this list */
-    var $owner = null;
-
-    function __construct($profile, $owner, $action, $alt)
-    {
-        parent::__construct($profile, $owner, $action, $alt);
-
-        $this->alt   = $alt; // is this row alternate?
-        $this->owner = $owner;
-    }
-
     function showHomepage()
     {
         if (!empty($this->profile->homepage)) {
index 75c42a5fdfc06fd254d6aca69b482295d0822dcc..719834bc917d3aa9c5e17a74c0e63e9470646725 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
-
-require_once INSTALLDIR . '/lib/subscriptionlist.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Widget to show a sortable list of subscriptions
@@ -44,16 +40,6 @@ require_once INSTALLDIR . '/lib/subscriptionlist.php';
  */
 class SortableSubscriptionList extends SubscriptionList
 {
-    /** Owner of this list */
-    var $owner = null;
-
-    function __construct($profile, $owner=null, $action=null)
-    {
-        parent::__construct($profile, $owner, $action);
-
-        $this->owner = $owner;
-    }
-
     function startList()
     {
         $this->out->elementStart('table', array('class' => 'profile_list xoxo'));
@@ -128,48 +114,14 @@ class SortableSubscriptionList extends SubscriptionList
         $this->out->elementEnd('table');
     }
 
-    function showProfiles()
+    function newListItem($profile)
     {
-        // Note: we don't use fetchAll() because it's borked with query()
-
-        $profiles = array();
-
-        while ($this->profile->fetch()) {
-            $profiles[] = clone($this->profile);
-        }
-
-        $cnt = count($profiles);
-
-        $max = min($cnt, $this->maxProfiles());
-
-        for ($i = 0; $i < $max; $i++) {
-            $odd = ($i % 2 == 0); // for zebra striping
-            $pli = $this->newListItem($profiles[$i], $odd);
-            $pli->show();
-        }
-
-        return $cnt;
-    }
-
-    function newListItem($profile, $odd)
-    {
-        return new SortableSubscriptionListItem($profile, $this->owner, $this->action, $odd);
+        return new SortableSubscriptionListItem($profile, $this->owner, $this->action);
     }
 }
 
 class SortableSubscriptionListItem extends SubscriptionListItem
 {
-    /** Owner of this list */
-    var $owner = null;
-
-    function __construct($profile, $owner, $action, $alt)
-    {
-        parent::__construct($profile, $owner, $action);
-
-        $this->alt   = $alt; // is this row alternate?
-        $this->owner = $owner;
-    }
-
     function startItem()
     {
         $attr = array(
@@ -177,10 +129,6 @@ class SortableSubscriptionListItem extends SubscriptionListItem
             'id'    => 'profile-' . $this->profile->id
         );
 
-        if ($this->alt) {
-            $attr['class'] .= ' alt';
-        }
-
         $this->out->elementStart('tr', $attr);
     }
 
index a777a28e031cacbab9a47b2335fc97ad12c689da..ea0b8ad6309ef263131b4e91835414dd1700da8f 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 class ProfileDetailAction extends ShowstreamAction
 {
-
     function isReadOnly($args)
     {
         return true;
@@ -31,7 +28,7 @@ class ProfileDetailAction extends ShowstreamAction
 
     function title()
     {
-        return $this->profile->getFancyName();
+        return $this->target->getFancyName();
     }
 
     function showStylesheets() {
@@ -43,7 +40,7 @@ class ProfileDetailAction extends ShowstreamAction
     function showContent()
     {
         $cur = common_current_user();
-        if ($cur && $cur->id == $this->profile->id) { // your own page
+        if ($this->scoped instanceof Profile && $this->scoped->sameAs($this->target)) {
             $this->elementStart('div', 'entity_actions');
             $this->elementStart('ul');
             $this->elementStart('li', 'entity_edit');
@@ -57,7 +54,7 @@ class ProfileDetailAction extends ShowstreamAction
             $this->elementEnd('div');
         }
 
-        $widget = new ExtendedProfileWidget($this, $this->profile);
+        $widget = new ExtendedProfileWidget($this, $this->target);
         $widget->show();
     }
 }
index 0cbebd723cf6ad430818134bb601119f3ce05af1..ca5602d5ec16ba1616ab8a818a02039d4b91847c 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
-
-require_once INSTALLDIR.'/lib/rssaction.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * RSS feed for user favorites action class.
@@ -47,50 +43,15 @@ require_once INSTALLDIR.'/lib/rssaction.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://status.net/
  */
-class FavoritesrssAction extends Rss10Action
+class FavoritesrssAction extends TargetedRss10Action
 {
-    /** The user whose favorites to display */
-
-    var $user = null;
-
-    /**
-     * Find the user to display by supplied nickname
-     *
-     * @param array $args Arguments from $_REQUEST
-     *
-     * @return boolean success
-     */
-    function prepare($args)
+    protected function getNotices()
     {
-        parent::prepare($args);
-
-        $nickname   = $this->trimmed('nickname');
-        $this->user = User::getKV('nickname', $nickname);
+        // is this our own stream?
+        $own = $this->scoped instanceof Profile ? $this->target->getID() === $this->scoped->getID() : false;
 
-        if (!$this->user) {
-            // TRANS: Client error displayed when trying to get the RSS feed with favorites of a user that does not exist.
-            $this->clientError(_('No such user.'));
-        } else {
-            $this->notices = $this->getNotices($this->limit);
-            return true;
-        }
-    }
-
-    /**
-     * Get notices
-     *
-     * @param integer $limit max number of notices to return
-     *
-     * @return array notices
-     */
-    function getNotices($limit=0)
-    {
-        $notice  = Fave::stream($this->user->id, 0, $limit, $false);
-        $notices = array();
-        while ($notice->fetch()) {
-            $notices[] = clone($notice);
-        }
-        return $notices;
+        $stream = Fave::stream($this->target->getID(), 0, $this->limit, $own);
+        return $stream->fetchAll();
     }
 
      /**
@@ -116,15 +77,4 @@ class FavoritesrssAction extends Rss10Action
                                         $user->nickname, common_config('site', 'name')));
         return $c;
     }
-
-    /**
-     * Get image.
-     *
-     * @return void
-    */
-    function getImage()
-    {
-        return null;
-    }
-
 }
index 98a6bfc5bfbe30dfb7a7e05903b0c446792fa470..cba29063c28b2de8787890db5c0920ac98ac5c8b 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
-
-require_once INSTALLDIR.'/lib/personalgroupnav.php';
-require_once INSTALLDIR.'/lib/noticelist.php';
-require_once INSTALLDIR.'/lib/feedlist.php';
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * List of replies
@@ -44,119 +38,29 @@ require_once INSTALLDIR.'/lib/feedlist.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  */
-class ShowfavoritesAction extends Action
+class ShowfavoritesAction extends ShowstreamAction
 {
-    /** User we're getting the faves of */
-    var $user = null;
-    /** Page of the faves we're on */
-    var $page = null;
-
-    /**
-     * Is this a read-only page?
-     *
-     * @return boolean true
-     */
-    function isReadOnly($args)
-    {
-        return true;
-    }
-
-    /**
-     * Title of the page
-     *
-     * Includes name of user and page number.
-     *
-     * @return string title of page
-     */
     function title()
     {
         if ($this->page == 1) {
             // TRANS: Title for first page of favourite notices of a user.
             // TRANS: %s is the user for whom the favourite notices are displayed.
-            return sprintf(_('%s\'s favorite notices'), $this->user->nickname);
+            return sprintf(_('%s\'s favorite notices'), $this->getTarget()->getNickname());
         } else {
             // TRANS: Title for all but the first page of favourite notices of a user.
             // TRANS: %1$s is the user for whom the favourite notices are displayed, %2$d is the page number.
             return sprintf(_('%1$s\'s favorite notices, page %2$d'),
-                           $this->user->nickname,
+                           $this->getTarget()->getNickname(),
                            $this->page);
         }
     }
 
-    /**
-     * Prepare the object
-     *
-     * Check the input values and initialize the object.
-     * Shows an error page on bad input.
-     *
-     * @param array $args $_REQUEST data
-     *
-     * @return boolean success flag
-     */
-    function prepare($args)
+    public function getStream()
     {
-        parent::prepare($args);
-
-        $nickname = common_canonical_nickname($this->arg('nickname'));
-
-        $this->user = User::getKV('nickname', $nickname);
-
-        if (!$this->user) {
-            // TRANS: Client error displayed when trying to display favourite notices for a non-existing user.
-            $this->clientError(_('No such user.'));
-        }
-
-        $this->page = $this->trimmed('page');
-
-        if (!$this->page) {
-            $this->page = 1;
-        }
-
-        common_set_returnto($this->selfUrl());
-
-        $cur = common_current_user();
-
-        // Show imported/gateway notices as well as local if
-        // the user is looking at their own favorites, otherwise not.
-        $this->notice = Fave::stream($this->user->id,
-                                     ($this->page-1)*NOTICES_PER_PAGE,  // offset
-                                     NOTICES_PER_PAGE + 1,              // limit
-                                     (!empty($cur) && $cur->id == $this->user->id)  // own feed?
-                                    );
-
-        if (empty($this->notice)) {
-            // TRANS: Server error displayed when favourite notices could not be retrieved from the database.
-            $this->serverError(_('Could not retrieve favorite notices.'));
-        }
-
-        if($this->page > 1 && $this->notice->N == 0){
-            // TRANS: Client error when page not found (404)
-            $this->clientError(_('No such page.'), 404);
-        }
-
-        return true;
-    }
-
-    /**
-     * Handle a request
-     *
-     * Just show the page. All args already handled.
-     *
-     * @param array $args $_REQUEST data
-     *
-     * @return void
-     */
-    function handle($args)
-    {
-        parent::handle($args);
-        $this->showPage();
+        $own = $this->scoped instanceof Profile ? $this->scoped->sameAs($this->getTarget()) : false;
+        return new FaveNoticeStream($this->getTarget()->getID(), $own);
     }
 
-    /**
-     * Feeds for the <head> section
-     *
-     * @return array Feed objects to show
-     */
     function getFeeds()
     {
         return array(new Feed(Feed::JSON,
@@ -223,7 +127,7 @@ class ShowfavoritesAction extends Action
      *
      * @return void
      */
-    function showContent()
+    function showNotices()
     {
         $nl = new FavoritesNoticeList($this->notice, $this);
 
@@ -234,7 +138,7 @@ class ShowfavoritesAction extends Action
 
         $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE,
                           $this->page, 'showfavorites',
-                          array('nickname' => $this->user->nickname));
+                          array('nickname' => $this->getTarget()->getNickname()));
     }
 
     function showPageNotice() {
index 48ed3ba93bcb3d4a8accae430e4c054e2a0ef9f2..ab78478db5e43f237a2e4c7ec1964acd42970b2e 100644 (file)
@@ -135,7 +135,7 @@ class Fave extends Managed_DataObject
         return $result;
     }
 
-    function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $own=false, $since_id=0, $max_id=0)
+    static function stream($user_id, $offset=0, $limit=NOTICES_PER_PAGE, $own=false, $since_id=0, $max_id=0)
     {
         $stream = new FaveNoticeStream($user_id, $own);
 
old mode 100644 (file)
new mode 100755 (executable)
index caad8fde11f0a77da6e6ee9441791c93cbda560e..a8e2546c4f846b05b1eb22b97f98c1a0fab7cee9 100644 (file)
@@ -57,25 +57,27 @@ class GeoURLPlugin extends Plugin
      *
      * @return boolean event handler flag
      */
-    function onEndShowHeadElements($action)
+    function onEndShowHeadElements(Action $action)
     {
         $name = $action->trimmed('action');
 
         $location = null;
 
-        if ($name == 'showstream') {
-            $profile = $action->profile;
-            if (!empty($profile) && !empty($profile->lat) && !empty($profile->lon)) {
+        if ($action instanceof ShowstreamAction) {
+            $profile = $action->getTarget();
+            if (!empty($profile->lat) && !empty($profile->lon)) {
                 $location = $profile->lat . ', ' . $profile->lon;
             }
-        } else if ($name == 'shownotice') {
-            $notice = $action->profile;
-            if (!empty($notice) && !empty($notice->lat) && !empty($notice->lon)) {
+        } elseif ($action instanceof ShownoticeAction) {
+            // FIXME: getNotice in ShownoticeAction will do a new lookup, we should fix those classes
+            // so they can reliably just get a pre-stored notice object which was fetched in Shownotice prepare()...
+            $notice = $action->notice;
+            if ($notice instanceof Notice && !empty($notice->lat) && !empty($notice->lon)) {
                 $location = $notice->lat . ', ' . $notice->lon;
             }
         }
 
-        if (!empty($location)) {
+        if (!is_null($location)) {
             $action->element('meta', array('name' => 'ICBM',
                                            'content' => $location));
             $action->element('meta', array('name' => 'DC.title',
diff --git a/plugins/Gravatar/GravatarPlugin.php b/plugins/Gravatar/GravatarPlugin.php
deleted file mode 100644 (file)
index cf9e3a0..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-/*
- * StatusNet - the distributed open-source microblogging tool
- * Copyright (C) 2009,2011 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/>.
- */
-
-/**
- * @package GravatarPlugin
- * @maintainer Eric Helgeson <erichelgeson@gmail.com>
- */
-
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    // This check helps protect against security problems;
-    // your code file can't be executed directly from the web.
-    exit(1);
-}
-
-class GravatarPlugin extends Plugin
-{
-    function onEndProfileGetAvatar($profile, $size, &$avatar)
-    {
-        if (empty($avatar)) {
-            try {
-                $user = $profile->getUser();
-                if (!empty($user->email)) {
-                    // Fake one!
-                    $avatar = new Avatar();
-                    $avatar->width = $avatar->height = $size;
-                    $avatar->url = $this->gravatar_url($user->email, $size);
-                    return false;
-                }
-            } catch (NoSuchUserException $e) {
-                return true;
-            }
-        }
-
-        return true;
-    }
-
-    function gravatar_url($email, $size)
-    {
-        $url = "https://secure.gravatar.com/avatar.php?gravatar_id=".
-                md5(strtolower($email)).
-                "&default=".urlencode(Avatar::defaultImage($size)).
-                "&size=".$size;
-            return $url;
-    }
-
-    function onPluginVersion(array &$versions)
-    {
-        $versions[] = array('name' => 'Gravatar',
-                            'version' => GNUSOCIAL_VERSION,
-                            'author' => 'Eric Helgeson, Evan Prodromou',
-                            'homepage' => 'http://status.net/wiki/Plugin:Gravatar',
-                            'rawdescription' =>
-                            // TRANS: Plugin decsription.
-                            _m('The Gravatar plugin allows users to use their <a href="http://www.gravatar.com/">Gravatar</a> with StatusNet.'));
-
-        return true;
-    }
-}
diff --git a/plugins/Gravatar/README b/plugins/Gravatar/README
deleted file mode 100644 (file)
index 0f6c728..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-GravatarPlugin 0.1
-
-About:
-This will allow users to use their Gravatar Avatar with your StatusNet install.
-
-Configuration:
-add this to your config.php:
-addPlugin('Gravatar', array());
-
-To do:
-Site default all on for gravatar by default
-Migration Script
diff --git a/plugins/Gravatar/locale/Gravatar.pot b/plugins/Gravatar/locale/Gravatar.pot
deleted file mode 100644 (file)
index 01bcc5d..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-27 16:31+0100\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a href=\"http://www.gravatar."
-"com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/af/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/af/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 0f97b86..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Afrikaans (http://www.transifex.com/projects/p/gnu-social/language/af/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: af\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/ar/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ar/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 0ffd7f7..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Arabic (http://www.transifex.com/projects/p/gnu-social/language/ar/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ar\n"
-"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/arz/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/arz/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 86ede50..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Arabic (Egypt) (http://www.transifex.com/projects/p/gnu-social/language/ar_EG/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ar_EG\n"
-"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/ast/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ast/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index fe73afa..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Asturian (http://www.transifex.com/projects/p/gnu-social/language/ast/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ast\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/be-tarask/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/be-tarask/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index b495ade..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Belarusian (Tarask) (http://www.transifex.com/projects/p/gnu-social/language/be@tarask/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: be@tarask\n"
-"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/bg/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/bg/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 7cd09ef..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Bulgarian (http://www.transifex.com/projects/p/gnu-social/language/bg/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: bg\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/br/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/br/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 92ab60a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Breton (http://www.transifex.com/projects/p/gnu-social/language/br/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: br\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/ca/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ca/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 1191b68..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Catalan (http://www.transifex.com/projects/p/gnu-social/language/ca/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ca\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "El connector del Gravatar permet als usuaris fer servir llur <a href=\"http://www.gravatar.com/\">Gravatar</a> amb l'StatusNet."
diff --git a/plugins/Gravatar/locale/cs/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/cs/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 2ce5576..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Czech (http://www.transifex.com/projects/p/gnu-social/language/cs/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: cs\n"
-"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/da/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/da/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index d47b755..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Danish (http://www.transifex.com/projects/p/gnu-social/language/da/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: da\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/de/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/de/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 625c20c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: German (http://www.transifex.com/projects/p/gnu-social/language/de/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: de\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "Das Gravatar-Plugin erlaubt es Benutzern, ihr <a href=\"http://www.gravatar.com/\">Gravatar</a> mit StatusNet zu verwenden."
diff --git a/plugins/Gravatar/locale/el/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/el/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 021657d..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Greek (http://www.transifex.com/projects/p/gnu-social/language/el/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: el\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/en_GB/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/en_GB/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 7bc45a1..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: English (United Kingdom) (http://www.transifex.com/projects/p/gnu-social/language/en_GB/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: en_GB\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/eo/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/eo/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index a955db7..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Esperanto (http://www.transifex.com/projects/p/gnu-social/language/eo/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: eo\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/es/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/es/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index b289d4f..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-# Juan Riquelme González <soulchainer@gmail.com>, 2015
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-27 12:21+0000\n"
-"Last-Translator: Juan Riquelme González <soulchainer@gmail.com>\n"
-"Language-Team: Spanish (http://www.transifex.com/projects/p/gnu-social/language/es/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: es\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "El complemento Gravatar permite a los usuarios utilizar su <a href=\"http://www.gravatar.com/\">Gravatar</a> en GNU social."
diff --git a/plugins/Gravatar/locale/eu/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/eu/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index bb87408..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Basque (http://www.transifex.com/projects/p/gnu-social/language/eu/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: eu\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "Gravatar pluginak erabiltzaileei heuren <a href=\"http://www.gravatar.com/\">Gravatar</a>ra StatusNet-en erabiltzen uzten die."
diff --git a/plugins/Gravatar/locale/fa/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/fa/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index c7ee433..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Persian (http://www.transifex.com/projects/p/gnu-social/language/fa/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: fa\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/fi/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/fi/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 7b0e4e1..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Finnish (http://www.transifex.com/projects/p/gnu-social/language/fi/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: fi\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/fr/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/fr/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index c24e581..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: French (http://www.transifex.com/projects/p/gnu-social/language/fr/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: fr\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "Le greffon Gravatar permet aux utilisateurs d’utiliser leur image <a href=\"http://www.gravatar.com/\">Gravatar</a> avec StatusNet."
diff --git a/plugins/Gravatar/locale/fur/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/fur/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 3cd3fdf..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Friulian (http://www.transifex.com/projects/p/gnu-social/language/fur/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: fur\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/gl/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/gl/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 629918e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Galician (http://www.transifex.com/projects/p/gnu-social/language/gl/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: gl\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "O complemento Gravatar permite aos usuarios usar o seu <a href=\"http://www.gravatar.com/\">Gravatar</a> co StatusNet."
diff --git a/plugins/Gravatar/locale/he/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/he/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 475f35c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Hebrew (http://www.transifex.com/projects/p/gnu-social/language/he/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: he\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "תוסף Gravatar מאפשר למשתמשים להציג את ה־<a href=\"http://www.gravatar.com/\">Gravatar</a> שלהם בסטטוסנט."
diff --git a/plugins/Gravatar/locale/hsb/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/hsb/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 63410e7..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Upper Sorbian (http://www.transifex.com/projects/p/gnu-social/language/hsb/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: hsb\n"
-"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/hu/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/hu/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 16c5f1b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Hungarian (http://www.transifex.com/projects/p/gnu-social/language/hu/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: hu\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/ia/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ia/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 63ffdb9..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Interlingua (http://www.transifex.com/projects/p/gnu-social/language/ia/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ia\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "Le plug-in Gravatar permitte al usatores de usar lor <a href=\"http://www.gravatar.com/\">Gravatar</a> con StatusNet."
diff --git a/plugins/Gravatar/locale/id/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/id/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 3c2b453..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Indonesian (http://www.transifex.com/projects/p/gnu-social/language/id/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: id\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/is/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/is/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 3da39d3..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Icelandic (http://www.transifex.com/projects/p/gnu-social/language/is/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: is\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/it/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/it/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 5793afc..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Italian (http://www.transifex.com/projects/p/gnu-social/language/it/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: it\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "Il plugin Gravatar consente agli utenti di utilizzare i loro <a href=\"http://www.gravatar.com/\">Gravatar</a> con StatusNet."
diff --git a/plugins/Gravatar/locale/ja/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ja/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 53263e5..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Japanese (http://www.transifex.com/projects/p/gnu-social/language/ja/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ja\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/ka/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ka/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 1951146..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Georgian (http://www.transifex.com/projects/p/gnu-social/language/ka/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ka\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/ko/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ko/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index cde819b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Korean (http://www.transifex.com/projects/p/gnu-social/language/ko/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ko\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/ksh/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ksh/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 2212303..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Colognian (http://www.transifex.com/projects/p/gnu-social/language/ksh/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ksh\n"
-"Plural-Forms: nplurals=3; plural=(n==0) ? 0 : (n==1) ? 1 : 2;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/lb/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/lb/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index dd0a27f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Luxembourgish (http://www.transifex.com/projects/p/gnu-social/language/lb/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: lb\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/lt/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/lt/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index be4f887..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Lithuanian (http://www.transifex.com/projects/p/gnu-social/language/lt/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: lt\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/lv/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/lv/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 370e8f7..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:39+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Latvian (http://www.transifex.com/projects/p/gnu-social/language/lv/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: lv\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/mg/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/mg/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 1f3889e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Malagasy (http://www.transifex.com/projects/p/gnu-social/language/mg/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: mg\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/mk/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/mk/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 14015f3..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Macedonian (http://www.transifex.com/projects/p/gnu-social/language/mk/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: mk\n"
-"Plural-Forms: nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "Приклучокот Gravatar им овозможува на корисниците да го користат својот <a href=\"http://www.gravatar.com/\">Gravatar</a> со StatusNet."
diff --git a/plugins/Gravatar/locale/ml/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ml/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 71920fd..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Malayalam (http://www.transifex.com/projects/p/gnu-social/language/ml/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ml\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/ms/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ms/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 2bcaa63..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Malay (http://www.transifex.com/projects/p/gnu-social/language/ms/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ms\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/my/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/my/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 2bd1d77..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Burmese (http://www.transifex.com/projects/p/gnu-social/language/my/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: my\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/nb/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/nb/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 5bfca90..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Norwegian Bokmål (http://www.transifex.com/projects/p/gnu-social/language/nb/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: nb\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/ne/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ne/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 0a8a3f5..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 09:30+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Nepali (http://www.transifex.com/projects/p/gnu-social/language/ne/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ne\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/nl/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/nl/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 39339a3..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Dutch (http://www.transifex.com/projects/p/gnu-social/language/nl/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: nl\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "De plug-in Gravatar maak het mogelijk dat gebruikers hun <a href=\"http://www.gravatar.com/\">Gravatar</a> gebruiken in StatusNet."
diff --git a/plugins/Gravatar/locale/nn/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/nn/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 6c7a1ec..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Norwegian Nynorsk (http://www.transifex.com/projects/p/gnu-social/language/nn/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: nn\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/pl/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/pl/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 4bf9e1a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Polish (http://www.transifex.com/projects/p/gnu-social/language/pl/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: pl\n"
-"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "Wtyczka Gravatar umożliwia użytkownikom używanie obrazów <a href=\"http://www.gravatar.com/\">Gravatar</a> w StatusNet."
diff --git a/plugins/Gravatar/locale/pt/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/pt/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 50b36f6..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Portuguese (http://www.transifex.com/projects/p/gnu-social/language/pt/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: pt\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "O plugin Gravatar permite que os utilizadores usem o seu <a href=\"http://www.gravatar.com/\">Gravatar</a> com o StatusNet."
diff --git a/plugins/Gravatar/locale/pt_BR/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/pt_BR/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 3bd93e4..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/gnu-social/language/pt_BR/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: pt_BR\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/ru/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ru/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 1f304ef..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Russian (http://www.transifex.com/projects/p/gnu-social/language/ru/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ru\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/sr-ec/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/sr-ec/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 32a78b6..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Serbian (http://www.transifex.com/projects/p/gnu-social/language/sr/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: sr\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/sv/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/sv/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index a3f459f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Swedish (http://www.transifex.com/projects/p/gnu-social/language/sv/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: sv\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "Gravatar-tillägget låter användare använda deras <a href=\"http://www.gravatar.com/\">Gravatar</a> med StatusNet."
diff --git a/plugins/Gravatar/locale/ta/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ta/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index c5b0596..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-07 08:48+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Tamil (http://www.transifex.com/projects/p/gnu-social/language/ta/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ta\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/te/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/te/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index f842abd..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Telugu (http://www.transifex.com/projects/p/gnu-social/language/te/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: te\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/tl/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/tl/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 76efd0d..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Tagalog (http://www.transifex.com/projects/p/gnu-social/language/tl/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: tl\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "Ang pamasak na Gravatar ay nagpapahintulot sa mga tagagamit na gamitin ang kanilang <a href=\"http://www.gravatar.com/\">Gravatar</a> na may StatusNet."
diff --git a/plugins/Gravatar/locale/tr/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/tr/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index afd8152..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Turkish (http://www.transifex.com/projects/p/gnu-social/language/tr/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: tr\n"
-"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/uk/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/uk/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index c84ec1d..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Ukrainian (http://www.transifex.com/projects/p/gnu-social/language/uk/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: uk\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "Додаток Gravatar дозволяє користувачам встановлювати аватарки з <a href=\"http://www.gravatar.com/\">Gravatar</a> для сайту StatusNet."
diff --git a/plugins/Gravatar/locale/ur_PK/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/ur_PK/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index f7de61f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Urdu (Pakistan) (http://www.transifex.com/projects/p/gnu-social/language/ur_PK/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: ur_PK\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/vi/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/vi/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 0cdfdcc..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Vietnamese (http://www.transifex.com/projects/p/gnu-social/language/vi/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: vi\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
diff --git a/plugins/Gravatar/locale/zh_CN/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/zh_CN/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 8a2a5c6..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:43+0000\n"
-"Last-Translator: digitaldreamer <digitaldreamer@email.cz>\n"
-"Language-Team: Chinese (China) (http://www.transifex.com/projects/p/gnu-social/language/zh_CN/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: zh_CN\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr "Gravatar 插件可以让用户在 StatusNet 站点使用自己的 <a href=\"http://www.gravatar.com/\">Gravatar</a>。"
diff --git a/plugins/Gravatar/locale/zh_TW/LC_MESSAGES/Gravatar.po b/plugins/Gravatar/locale/zh_TW/LC_MESSAGES/Gravatar.po
deleted file mode 100644 (file)
index 2a603ff..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# 
-# Translators:
-msgid ""
-msgstr ""
-"Project-Id-Version: GNU social\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-02 17:47+0100\n"
-"PO-Revision-Date: 2015-02-06 16:27+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: Chinese (Taiwan) (http://www.transifex.com/projects/p/gnu-social/language/zh_TW/)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Language: zh_TW\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
-
-#. TRANS: Plugin decsription.
-#: GravatarPlugin.php:70
-msgid ""
-"The Gravatar plugin allows users to use their <a "
-"href=\"http://www.gravatar.com/\">Gravatar</a> with StatusNet."
-msgstr ""
index 32c96be0e8c0722b5d7249adc0012beacc7455d6..d1e01ca8496da938607e3d414ed2c2f734298121 100644 (file)
@@ -101,10 +101,10 @@ class ModLogPlugin extends Plugin
 
         $modlog->profile_id = $profile->id;
 
-        $cur = common_current_user();
+        $scoped = Profile::current();
         
-        if (!empty($cur)) {
-            $modlog->moderator_id = $cur->id;
+        if ($scoped instanceof Profile) {
+            $modlog->moderator_id = $scoped->getID();
         }
 
         $modlog->role     = $role;
@@ -118,21 +118,22 @@ class ModLogPlugin extends Plugin
 
     function onEndShowSections(Action $action)
     {
-        if ($action->arg('action') != 'showstream') {
+        if (!$action instanceof ShowstreamAction) {
+            // early return for actions we're not interested in
             return true;
         }
 
-        $cur = common_current_user();
-
-        if (empty($cur) || !$cur->hasRight(self::VIEWMODLOG)) {
+        $scoped = $action->getScoped();
+        if (!$scoped instanceof Profile || !$scoped->hasRight(self::VIEWMODLOG)) {
+            // only continue if we are allowed to VIEWMODLOG
             return true;
         }
 
-        $profile = $action->profile;
+        $profile = $action->getTarget();
 
         $ml = new ModLog();
 
-        $ml->profile_id = $profile->id;
+        $ml->profile_id = $profile->getID();
         $ml->orderBy("created");
 
         $cnt = $ml->find();
@@ -152,13 +153,13 @@ class ModLogPlugin extends Plugin
                 $action->element('td', null, sprintf(($ml->is_grant) ? _('+%s') : _('-%s'), $ml->role));
                 $action->elementStart('td');
                 if ($ml->moderator_id) {
-                    $mod = Profile::getKV('id', $ml->moderator_id);
+                    $mod = Profile::getByID($ml->moderator_id);
                     if (empty($mod)) {
                         $action->text(_('[unknown]'));
                     } else {
-                        $action->element('a', array('href' => $mod->profileurl,
-                                                    'title' => $mod->fullname),
-                                         $mod->nickname);
+                        $action->element('a', array('href' => $mod->getUrl(),
+                                                    'title' => $mod->getFullname()),
+                                         $mod->getNickname());
                     }
                 } else {
                     $action->text(_('[unknown]'));
index 630031fdde06916a44d0238a6d71e2be61c7db2b..0dace39db0a542da1031df2f40de0abe0560ee61 100644 (file)
@@ -1063,8 +1063,12 @@ class OStatusPlugin extends Plugin
 
     function showEntityRemoteSubscribe($action, $target='ostatussub')
     {
-        $user = common_current_user();
-        if ($user && ($user->id == $action->profile->id)) {
+        if (!$action->getScoped() instanceof Profile) {
+            // early return if we're not logged in
+            return true;
+        }
+
+        if ($action->getScoped()->sameAs($action->getTarget())) {
             $action->elementStart('div', 'entity_actions');
             $action->elementStart('p', array('id' => 'entity_remote_subscribe',
                                              'class' => 'entity_subscribe'));
@@ -1127,42 +1131,45 @@ class OStatusPlugin extends Plugin
         return true;
     }
 
-    function onStartProfileListItemActionElements($item, $profile=null)
+    // FIXME: This one can accept both an Action and a Widget. Confusing! Refactor to (HTMLOutputter $out, Profile $target)!
+    function onStartProfileListItemActionElements($item)
     {
-        if (!common_logged_in()) {
-
-            $profileUser = User::getKV('id', $item->profile->id);
-
-            if (!empty($profileUser)) {
-
-                if ($item instanceof Action) {
-                    $output = $item;
-                    $profile = $item->profile;
-                } else {
-                    $output = $item->out;
-                }
+        if (common_logged_in()) {
+            // only non-logged in users get to see the "remote subscribe" form
+            return true;
+        } elseif (!$item->getTarget()->isLocal()) {
+            // we can (for now) only provide remote subscribe forms for local users
+            return true;
+        }
 
-                // Add an OStatus subscribe
-                $output->elementStart('li', 'entity_subscribe');
-                $url = common_local_url('ostatusinit',
-                                        array('nickname' => $profileUser->nickname));
-                $output->element('a', array('href' => $url,
-                                            'class' => 'entity_remote_subscribe'),
-                                  // TRANS: Link text for a user to subscribe to an OStatus user.
-                                 _m('Subscribe'));
-                $output->elementEnd('li');
-
-                $output->elementStart('li', 'entity_tag');
-                $url = common_local_url('ostatustag',
-                                        array('nickname' => $profileUser->nickname));
-                $output->element('a', array('href' => $url,
-                                            'class' => 'entity_remote_tag'),
-                                  // TRANS: Link text for a user to list an OStatus user.
-                                 _m('List'));
-                $output->elementEnd('li');
-            }
+        if ($item instanceof ProfileAction) {
+            $output = $item;
+        } elseif ($item instanceof Widget) {
+            $output = $item->out;
+        } else {
+            // Bad $item class, don't know how to use this for outputting!
+            throw new ServerException('Bad item type for onStartProfileListItemActionElements');
         }
 
+        // Add an OStatus subscribe
+        $output->elementStart('li', 'entity_subscribe');
+        $url = common_local_url('ostatusinit',
+                                array('nickname' => $item->getTarget()->getNickname()));
+        $output->element('a', array('href' => $url,
+                                    'class' => 'entity_remote_subscribe'),
+                          // TRANS: Link text for a user to subscribe to an OStatus user.
+                         _m('Subscribe'));
+        $output->elementEnd('li');
+
+        $output->elementStart('li', 'entity_tag');
+        $url = common_local_url('ostatustag',
+                                array('nickname' => $item->getTarget()->getNickname()));
+        $output->element('a', array('href' => $url,
+                                    'class' => 'entity_remote_tag'),
+                          // TRANS: Link text for a user to list an OStatus user.
+                         _m('List'));
+        $output->elementEnd('li');
+
         return true;
     }
 
old mode 100755 (executable)
new mode 100644 (file)
index 9e02f5eab5e3f8963ae7020bb3223058a86f8498..dfd3abaeabd401cc6852e6721b59474a19eddc17 100644 (file)
@@ -50,8 +50,8 @@ class MagicEnvelope
      */
     public function __construct($xml=null) {
         if (!empty($xml)) {
-            $dom = DOMDocument::loadXML($xml);
-            if (!$dom instanceof DOMDocument) {
+            $dom = new DOMDocument();
+            if (!$dom->loadXML($xml)) {
                 throw new ServerException('Tried to load malformed XML as DOM');
             } elseif (!$this->fromDom($dom)) {
                 throw new ServerException('Could not load MagicEnvelope from DOM');
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index 710a34410ac6e81551fb94068a26bae84e022463..2e9ada98064e3b36ae0d7457d98bfd3322c59488 100644 (file)
@@ -390,11 +390,11 @@ class OpenIDPlugin extends Plugin
             $action->element('link', array('rel' => 'openid2.provider',
                                            'href' => common_local_url('openidserver')));
             $action->element('link', array('rel' => 'openid2.local_id',
-                                           'href' => $action->profile->profileurl));
+                                           'href' => $action->getTarget()->getUrl()));
             $action->element('link', array('rel' => 'openid.server',
                                            'href' => common_local_url('openidserver')));
             $action->element('link', array('rel' => 'openid.delegate',
-                                           'href' => $action->profile->profileurl));
+                                           'href' => $action->getTarget()->getUrl()));
         }
 
         if ($action instanceof SitestreamAction) {
diff --git a/plugins/README-plugins b/plugins/README-plugins
deleted file mode 100644 (file)
index cdce7eb..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-Several example plugins are included in the plugins/ directory. You
-can enable a plugin with the following line in config.php:
-
-    addPlugin('Example', array('param1' => 'value1',
-                               'param2' => 'value2'));
-
-This will look for and load files named 'ExamplePlugin.php' or
-'Example/ExamplePlugin.php' either in the plugins/ directory (for
-plugins that ship with StatusNet) or in the local/ directory (for
-plugins you write yourself or that you get from somewhere else) or
-local/plugins/.
-
-Plugins are documented in their own directories.
-
-
-Additional information on using and developing plugins can be found
-on the StatusNet wiki:
-
-http://status.net/wiki/Plugins
-http://status.net/wiki/Plugin_development
-
diff --git a/plugins/README.md b/plugins/README.md
new file mode 100644 (file)
index 0000000..0db97e0
--- /dev/null
@@ -0,0 +1,22 @@
+Several example plugins are included in the plugins/ directory. You
+can enable a plugin with the following line in config.php:
+
+```php
+    addPlugin('Example', array('param1' => 'value1',
+                               'param2' => 'value2'));
+```
+
+This will look for and load files named 'ExamplePlugin.php' or
+'Example/ExamplePlugin.php' either in the plugins/ directory (for
+plugins that ship with StatusNet) or in the local/ directory (for
+plugins you write yourself or that you get from somewhere else) or
+local/plugins/.
+
+Plugins are documented in their own directories.
+
+Additional information on using and developing plugins can be found
+at the following locations:
+
+* [Plugin Development](doc/Plugin_development.md)
+* [Community Plugins](http://www.skilledtests.com/wiki/GNU_social_plugins)
+
old mode 100644 (file)
new mode 100755 (executable)
index a37a3918f69c4f868899c70fb394f842e3c2c8ff..734cabbcd5182169b5eee61086637bb55e9e0f79 100644 (file)
@@ -80,7 +80,7 @@ class RequireValidatedEmailPlugin extends Plugin
      */
     public $disallowLogin = false;
 
-    function onRouterInitialized($m)
+    public function onRouterInitialized(URLMapper $m)
     {
         $m->connect('main/confirmfirst/:code',
                     array('action' => 'confirmfirstemail'));
@@ -95,15 +95,18 @@ class RequireValidatedEmailPlugin extends Plugin
      *
      * @return bool hook result code
      */
-    function onStartNoticeSave($notice)
+    public function onStartNoticeSave(Notice $notice)
     {
-        $user = User::getKV('id', $notice->profile_id);
-        if (!empty($user)) { // it's a remote notice
-            if (!$this->validated($user)) {
-                // TRANS: Client exception thrown when trying to post notices before validating an e-mail address.
-                $msg = _m('You must validate your email address before posting.');
-                throw new ClientException($msg);
-            }
+        $author = $notice->getProfile();
+        if (!$author->isLocal()) {
+            // remote notice
+            return true;
+        }
+        $user = $author->getUser();
+        if (!$this->validated($user)) {
+            // TRANS: Client exception thrown when trying to post notices before validating an e-mail address.
+            $msg = _m('You must validate your email address before posting.');
+            throw new ClientException($msg);
         }
         return true;
     }
@@ -136,7 +139,7 @@ class RequireValidatedEmailPlugin extends Plugin
      *
      * @return bool
      */
-    protected function validated($user)
+    protected function validated(User $user)
     {
         // The email field is only stored after validation...
         // Until then you'll find them in confirm_address.
@@ -162,7 +165,7 @@ class RequireValidatedEmailPlugin extends Plugin
      *
      * @return bool true if user is grandfathered
      */
-    protected function grandfathered($user)
+    protected function grandfathered(User $user)
     {
         if ($this->grandfatherCutoff) {
             $created = strtotime($user->created . " GMT");
@@ -183,7 +186,7 @@ class RequireValidatedEmailPlugin extends Plugin
      *
      * @return bool true if user has a trusted OpenID.
      */
-    function hasTrustedOpenID($user)
+    function hasTrustedOpenID(User $user)
     {
         if ($this->trustedOpenIDs && class_exists('User_openid')) {
             foreach ($this->trustedOpenIDs as $regex) {
index 54563ed0e7162c862092d9fd3fb004e081cbe9b8..fd89075032eedbe862499e173baa5fd2a81e7c78 100644 (file)
@@ -28,9 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * A list of the user's subscriptions
@@ -48,20 +46,19 @@ class SearchSubsAction extends GalleryAction
         if ($this->page == 1) {
             // TRANS: Header for subscriptions overview for a user (first page).
             // TRANS: %s is a user nickname.
-            return sprintf(_m('%s\'s search subscriptions'), $this->user->nickname);
+            return sprintf(_m('%s\'s search subscriptions'), $this->getTarget()->getNickname());
         } else {
             // TRANS: Header for subscriptions overview for a user (not first page).
             // TRANS: %1$s is a user nickname, %2$d is the page number.
             return sprintf(_m('%1$s\'s search subscriptions, page %2$d'),
-                           $this->user->nickname,
+                           $this->getTarget()->getNickname(),
                            $this->page);
         }
     }
 
     function showPageNotice()
     {
-        $user = common_current_user();
-        if ($user && ($user->id == $this->profile->id)) {
+        if ($this->scoped instanceof Profile && $this->scoped->sameAs($this->getTarget())) {
             $this->element('p', null,
                            // TRANS: Page notice for page with an overview of all search subscriptions
                            // TRANS: of the logged in user's own profile.
@@ -71,7 +68,7 @@ class SearchSubsAction extends GalleryAction
                            // TRANS: Page notice for page with an overview of all subscriptions of a user other
                            // TRANS: than the logged in user. %s is the user nickname.
                            sprintf(_m('%s has subscribed to receive all notices on this site matching the following searches:'),
-                                   $this->profile->nickname));
+                                   $this->getTarget()->getNickname()));
         }
     }
 
@@ -86,12 +83,12 @@ class SearchSubsAction extends GalleryAction
             $cnt = 0;
 
             $searchsub = new SearchSub();
-            $searchsub->profile_id = $this->user->id;
+            $searchsub->profile_id = $this->getTarget()->getID();
             $searchsub->limit($limit, $offset);
             $searchsub->find();
 
             if ($searchsub->N) {
-                $list = new SearchSubscriptionsList($searchsub, $this->user, $this);
+                $list = new SearchSubscriptionsList($searchsub, $this->getTarget(), $this);
                 $cnt = $list->show();
                 if (0 == $cnt) {
                     $this->showEmptyListMessage();
@@ -102,7 +99,7 @@ class SearchSubsAction extends GalleryAction
 
             $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
                               $this->page, 'searchsubs',
-                              array('nickname' => $this->user->nickname));
+                              array('nickname' => $this->getTarget()->getNickname()));
 
 
             Event::handle('EndShowTagSubscriptionsContent', array($this));
@@ -112,8 +109,7 @@ class SearchSubsAction extends GalleryAction
     function showEmptyListMessage()
     {
         if (common_logged_in()) {
-            $current_user = common_current_user();
-            if ($this->user->id === $current_user->id) {
+            if ($this->scoped->sameAs($this->getTarget())) {
                 // TRANS: Search subscription list text when the logged in user has no search subscriptions.
                 $message = _m('You are not subscribed to any text searches right now. You can push the "Subscribe" button ' .
                              'on any notice text search to automatically receive any public messages on this site that match that ' .
@@ -121,13 +117,13 @@ class SearchSubsAction extends GalleryAction
             } else {
                 // TRANS: Search subscription list text when looking at the subscriptions for a of a user other
                 // TRANS: than the logged in user that has no search subscriptions. %s is the user nickname.
-                $message = sprintf(_m('%s is not subscribed to any searches.'), $this->user->nickname);
+                $message = sprintf(_m('%s is not subscribed to any searches.'), $this->getTarget()->getNickname());
             }
         }
         else {
             // TRANS: Subscription list text when looking at the subscriptions for a of a user that has none
             // TRANS: as an anonymous user. %s is the user nickname.
-            $message = sprintf(_m('%s is not subscribed to any searches.'), $this->user->nickname);
+            $message = sprintf(_m('%s is not subscribed to any searches.'), $this->getTarget()->getNickname());
         }
 
         $this->elementStart('div', 'guide');
index fa5b34942b00694183806c8ef8202636b2692207..434ed8982c838d2cd2b59f8567c51d80eae2cffc 100644 (file)
@@ -86,7 +86,7 @@ class SearchSubMenu extends MoreMenu
         return $items;
     } 
 
-    function item($actionName, $args, $label, $description, $id=null, $cls=null)
+    function item($actionName, array $args, $label, $description, $id=null, $cls=null)
     {
         if (empty($id)) {
             $id = $this->menuItemID($actionName, $args);
index f0ce37fb62db07fc0798400d9cbb051c0917ba4c..6e2b486b061cceb34eab1d661a74fe373328b198 100644 (file)
@@ -112,7 +112,7 @@ class RepeatForm extends Form
     {
         $this->out->submit('repeat-submit-' . $this->notice->id,
                            // TRANS: Button text to repeat a notice on notice repeat form.
-                           _m('BUTTON','Yes'), 'submit', null,
+                           _m('BUTTON','Confirm repeat'), 'submit', null,
                            // TRANS: Button title to repeat a notice on notice repeat form.
                            _('Repeat this notice.'));
     }
old mode 100644 (file)
new mode 100755 (executable)
index be195250f679027c715177dc6e1dc9c8cd0fe617..1e927b4fd175437133808b33fd04dd1885073366 100644 (file)
@@ -28,9 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * A list of the user's subscriptions
@@ -48,20 +46,19 @@ class TagSubsAction extends GalleryAction
         if ($this->page == 1) {
             // TRANS: Header for subscriptions overview for a user (first page).
             // TRANS: %s is a user nickname.
-            return sprintf(_m('%s\'s tag subscriptions'), $this->user->nickname);
+            return sprintf(_m('%s\'s tag subscriptions'), $this->getTarget()->getNickname());
         } else {
             // TRANS: Header for subscriptions overview for a user (not first page).
             // TRANS: %1$s is a user nickname, %2$d is the page number.
             return sprintf(_m('%1$s\'s tag subscriptions, page %2$d'),
-                           $this->user->nickname,
+                           $this->getTarget()->getNickname(),
                            $this->page);
         }
     }
 
     function showPageNotice()
     {
-        $user = common_current_user();
-        if ($user && ($user->id == $this->profile->id)) {
+        if ($this->scoped instanceof Profile && $this->scoped->sameAs($this->getTarget())) {
             $this->element('p', null,
                            // TRANS: Page notice for page with an overview of all tag subscriptions
                            // TRANS: of the logged in user's own profile.
@@ -71,7 +68,7 @@ class TagSubsAction extends GalleryAction
                            // TRANS: Page notice for page with an overview of all subscriptions of a user other
                            // TRANS: than the logged in user. %s is the user nickname.
                            sprintf(_m('%s has subscribed to receive all notices on this site containing the following tags:'),
-                                   $this->profile->nickname));
+                                   $this->getTarget()->getNickname()));
         }
     }
 
@@ -86,12 +83,12 @@ class TagSubsAction extends GalleryAction
             $cnt = 0;
 
             $tagsub = new TagSub();
-            $tagsub->profile_id = $this->user->id;
+            $tagsub->profile_id = $this->getTarget()->getID();
             $tagsub->limit($limit, $offset);
             $tagsub->find();
 
             if ($tagsub->N) {
-                $list = new TagSubscriptionsList($tagsub, $this->user, $this);
+                $list = new TagSubscriptionsList($tagsub, $this->getTarget(), $this);
                 $cnt = $list->show();
                 if (0 == $cnt) {
                     $this->showEmptyListMessage();
@@ -102,7 +99,7 @@ class TagSubsAction extends GalleryAction
 
             $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
                               $this->page, 'tagsubs',
-                              array('nickname' => $this->user->nickname));
+                              array('nickname' => $this->getTarget()->getNickname()));
 
 
             Event::handle('EndShowTagSubscriptionsContent', array($this));
@@ -112,8 +109,7 @@ class TagSubsAction extends GalleryAction
     function showEmptyListMessage()
     {
         if (common_logged_in()) {
-            $current_user = common_current_user();
-            if ($this->user->id === $current_user->id) {
+            if ($this->scoped->sameAs($this->getTarget())) {
                 // TRANS: Tag subscription list text when the logged in user has no tag subscriptions.
                 $message = _m('You are not listening to any hash tags right now. You can push the "Subscribe" button ' .
                               'on any hashtag page to automatically receive any public messages on this site that use that ' .
@@ -121,13 +117,13 @@ class TagSubsAction extends GalleryAction
             } else {
                 // TRANS: Tag subscription list text when looking at the subscriptions for a of a user other
                 // TRANS: than the logged in user that has no tag subscriptions. %s is the user nickname.
-                $message = sprintf(_m('%s is not following any tags.'), $this->user->nickname);
+                $message = sprintf(_m('%s is not following any tags.'), $this->getTarget()->getNickname());
             }
         }
         else {
             // TRANS: Subscription list text when looking at the subscriptions for a of a user that has none
             // TRANS: as an anonymous user. %s is the user nickname.
-            $message = sprintf(_m('%s is not following any tags.'), $this->user->nickname);
+            $message = sprintf(_m('%s is not following any tags.'), $this->getTarget()->getNickname());
         }
 
         $this->elementStart('div', 'guide');
old mode 100644 (file)
new mode 100755 (executable)
index 91dc9b53f797f060d65e47f8e361566d949bf9b9..c2a9c69d0c9342adb0922967455de308397ca3a1 100644 (file)
@@ -144,7 +144,7 @@ class WebFingerPlugin extends Plugin
     public function onStartShowHTML($action)
     {
         if ($action instanceof ShowstreamAction) {
-            $acct = 'acct:'. $action->profile->nickname .'@'. common_config('site', 'server');
+            $acct = 'acct:'. $action->getTarget()->getNickname() .'@'. common_config('site', 'server');
             $url = common_local_url('webfinger') . '?resource='.$acct;
 
             foreach (array(Discovery::JRD_MIMETYPE, Discovery::XRD_MIMETYPE) as $type) {
diff --git a/plugins/doc/Plugin_development.md b/plugins/doc/Plugin_development.md
new file mode 100644 (file)
index 0000000..c74b93f
--- /dev/null
@@ -0,0 +1,355 @@
+Plugin Development
+=======================
+
+SamplePlugin.php
+-----------------------
+
+Each plugin requires a main class to interact with the GNU social system.
+
+The main class usually extends the Plugin class that comes with GNU social.
+
+The class has standard-named methods that will be called when certain events
+happen in the code base. These methods have names like 'onX' where X is an
+event name (see EVENTS.txt for the list of available events). Event handlers
+have pre-defined arguments, based on which event they're handling. A typical
+event handler:
+
+```php
+function onSomeEvent($paramA, &$paramB)
+{
+    if ($paramA == 'jed') {
+        throw new Exception(sprintf(_m("Invalid parameter %s"), $paramA));
+    }
+    $paramB = 'spock';
+    return true;
+}
+```
+
+Event Handlers
+-----------------------
+
+Event handlers must return a Boolean value.
+
+If they return false, all other event handlers for this event (in other plug-in)
+will be skipped, and in some cases the default processing for that event would
+be skipped. This is great for replacing the default action of an event.
+
+If the handler returns true, processing of other event handlers and the default
+processing will continue. This is great for extending existing functionality.
+
+If the handler throws an exception, processing will stop, and the exception's
+error will be shown to the user.
+
+Installation
+------------------
+
+To install a plugin (like this one), site admins add the following code to their
+config.php file:
+
+```php
+addPlugin('Sample');
+```
+
+Plugins must be installed in one of the following directories:
+
+* local/plugins/{$pluginclass}.php
+* local/plugins/{$name}/{$pluginclass}.php
+* local/{$pluginclass}.php
+* local/{$name}/{$pluginclass}.php
+* plugins/{$pluginclass}.php
+* plugins/{$name}/{$pluginclass}.php
+
+Here, `{$name}` is the name of the plugin, like 'Sample', and `{$pluginclass}`
+is the name of the main class, like 'SamplePlugin'. Plugins that are part of
+the main GNU social distribution go in 'plugins' and third-party or local ones
+go in 'local'.
+
+Simple plugins can be implemented as a single module. Others are more complex
+and require additional modules; these should use their own directory, like
+'local/plugins/{$name}/'. All files related to the plugin, including images,
+JavaScript, CSS, external libraries or PHP modules should go in the plugin
+directory.
+
+Plugin Configuration
+------------------
+
+Plugins are configured using public instance attributes. To set their values,
+site administrators use this syntax:
+
+```php
+addPlugin('Sample', array('attr1' => 'foo', 'attr2' => 'bar'));
+```
+
+The same plugin class can be initialized multiple times with different arguments:
+
+```php
+addPlugin('EmailNotify', array('sendTo' => 'evan@status.net'));
+addPlugin('EmailNotify', array('sendTo' => 'brionv@status.net'));
+```
+
+```php
+class SamplePlugin extends Plugin
+{
+    public $attr1 = null;
+    public $attr2 = null;
+}
+```
+
+Initialization
+------------------
+
+Plugins overload this method to do any initialization they need, like connecting
+to remote servers or creating paths or so on. @return boolean hook value; true
+means continue processing, false means stop.
+
+```php
+function initialize()
+{
+    return true;
+}
+```
+
+Clean Up
+------------------
+
+Plugins overload this method to do any cleanup they need, like disconnecting from
+remote servers or deleting temp files or so on.
+
+```php
+function cleanup()
+{
+    return true;
+}
+```
+
+Database schema setup
+------------------
+
+Plugins can add their own tables to the GNU social database. Plugins should use
+GNU social's schema interface to add or delete tables. The ensureTable() method
+provides an easy way to ensure a table's structure and availability.
+
+By default, the schema is checked every time GNU social is run (say, when a Web
+page is hit). Admins can configure their systems to only check the schema when
+the checkschema.php script is run, greatly improving performance. However, they
+need to remember to run that script after installing or upgrading a plugin!
+
+```php
+function onCheckSchema()
+{
+    $schema = Schema::get();
+
+    // '''For storing user-submitted flags on profiles'''
+
+    $schema->ensureTable('user_greeting_count',
+                          array(new ColumnDef('user_id', 'integer', null,
+                                              true, 'PRI'),
+                                new ColumnDef('greeting_count', 'integer')));
+
+    return true;
+}
+```
+
+Load related modules when needed
+------------------
+
+Most non-trivial plugins will require extra modules to do their work. Typically
+these include data classes, action classes, widget classes, or external libraries.
+
+This method receives a class name and loads the PHP file related to that class.
+By tradition, action classes typically have files named for the action, all
+lower-case. Data classes are in files with the data class name, initial letter
+capitalized.
+
+Note that this method will be called for *all* overloaded classes, not just ones
+in this plugin! So, make sure to return true by default to let other plugins,
+and the core code, get a chance.
+
+```php
+function onAutoload($cls)
+{
+    $dir = dirname(__FILE__);
+
+    switch ($cls)
+    {
+    case 'HelloAction':
+        include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php';
+        return false;
+    case 'User_greeting_count':
+        include_once $dir . '/'.$cls.'.php';
+        return false;
+    default:
+        return true;
+    }
+}
+```
+
+Map URLs to actions
+------------------
+
+This event handler lets the plugin map URLs on the site to actions (and thus an
+action handler class). Note that the action handler class for an action will be
+named 'FoobarAction', where action = 'foobar'. The class must be loaded in the
+onAutoload() method.
+
+```php
+function onRouterInitialized($m)
+{
+    $m->connect('main/hello',
+                array('action' => 'hello'));
+    return true;
+}
+```
+
+Modify the default menu to link to our custom action
+------------------
+
+Using event handlers, it's possible to modify the default UI for pages almost
+without limit. In this method, we add a menu item to the default primary menu
+for the interface to link to our action.
+
+Action Class
+------------------
+
+The Action class provides a rich set of events to hook, as well as output methods.
+
+```php
+function onEndPrimaryNav($action)
+{
+    // '''common_local_url()''' gets the correct URL for the action name we provide
+
+    $action->menuItem(common_local_url('hello'),
+                      _m('Hello'), _m('A warm greeting'), false, 'nav_hello');
+    return true;
+}
+
+function onPluginVersion(&$versions)
+{
+    $versions[] = array('name' => 'Sample',
+                        'version' => STATUSNET_VERSION,
+                        'author' => 'Brion Vibber, Evan Prodromou',
+                        'homepage' => 'http://example.org/plugin',
+                        'rawdescription' =>
+                        _m('A sample plugin to show basics of development for new hackers.'));
+    return true;
+}
+```
+
+hello.php
+------------------
+
+This section is taken directly from the 'hello.php'. ( plugins/Sample/hello.php )
+
+Give a warm greeting to our friendly user.
+
+This sample action shows some basic ways of doing output in an action class.
+
+Action classes have several output methods that they override from the parent class.
+
+```php
+class HelloAction extends Action
+{
+    var $user = null;
+    var $gc   = null;
+}
+```
+
+Take arguments for running
+------------------
+
+This method is called first, and it lets the action class get all its arguments
+and validate them. It's also the time to fetch any relevant data from the database.
+
+Action classes should run parent::prepare($args) as the first line of this
+method to make sure the default argument-processing happens.
+
+```php     
+function prepare($args)
+{
+    parent::prepare($args);
+
+    $this->user = common_current_user();
+
+    if (!empty($this->user)) {
+        $this->gc = User_greeting_count::inc($this->user->id);
+    }
+
+    return true;
+}
+```
+
+Handle request
+------------------
+
+This is the main method for handling a request. Note that most preparation
+should be done in the prepare() method; by the time handle() is called the
+action should be more or less ready to go.
+
+```php
+function handle($args)
+{
+    parent::handle($args);
+
+    $this->showPage();
+}
+```
+
+Title of this page
+------------------
+
+Override this method to show a custom title.
+
+```php
+function title()
+{
+    if (empty($this->user)) {
+        return _m('Hello');
+    } else {
+        return sprintf(_m('Hello, %s'), $this->user->nickname);
+    }
+}
+```
+
+Show content in the content area
+------------------
+
+The default GNU social page has a lot of decorations: menus, logos, tabs, all
+that jazz. This method is used to show content in the content area of the
+page; it's the main thing you want to overload. This method also demonstrates
+use of a plural localized string.
+
+```php
+function showContent()
+{
+    if (empty($this->user)) {
+        $this->element('p', array('class' => 'greeting'),
+                       _m('Hello, stranger!'));
+    } else {
+        $this->element('p', array('class' => 'greeting'),
+                       sprintf(_m('Hello, %s'), $this->user->nickname));
+        $this->element('p', array('class' => 'greeting_count'),
+                       sprintf(_m('I have greeted you %d time.',
+                                  'I have greeted you %d times.',
+                                  $this->gc->greeting_count),
+                                  $this->gc->greeting_count));
+    }
+}
+```
+
+Return true if read only.
+------------------
+
+Some actions only read from the database; others read and write. The simple
+database load-balancer built into GNU social will direct read-only actions to
+database mirrors (if they are configured) and read-write actions to the master database.
+
+This defaults to false to avoid data integrity issues, but you should make sure
+to overload it for performance gains.
+
+```php
+function isReadOnly($args)
+{
+    return false;
+}
+```
+
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
diff --git a/scripts/delete_notice.php b/scripts/delete_notice.php
new file mode 100755 (executable)
index 0000000..bf10cbb
--- /dev/null
@@ -0,0 +1,68 @@
+#!/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_HELP
+delete_notice.php [options]
+deletes a notice (but not related File objects) from the database
+
+  -i --id       Local ID of the notice
+  -u --uri      Notice URI
+  -y --yes      do not wait for confirmation
+
+END_OF_HELP;
+
+require_once INSTALLDIR.'/scripts/commandline.inc';
+
+if (have_option('i', 'id')) {
+    $id = get_option_value('i', 'id');
+    $notice = Notice::getByID($id);
+    if (!$notice instanceof Notice) {
+        print "Can't find notice with ID $id\n";
+        exit(1);
+    }
+} else if (have_option('u', 'uri')) {
+    $uri = get_option_value('u', 'uri');
+    $notice = Notice::getKV('uri', $uri);
+    if (!$notice instanceof Notice) {
+        print "Can't find notice with URI '$uri'\n";
+        exit(1);
+    }
+} 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 notice ".$notice->getID()." by '".$notice->getProfile()->getNickname()."'. Are you sure? [y/N] ";
+    $response = fgets(STDIN);
+    if (strtolower(trim($response)) != 'y') {
+        print "Aborting.\n";
+        exit(0);
+    }
+}
+
+print "Deleting...";
+$notice->delete();
+print "DONE.\n";
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index 040d259554ccc99b0db2f2b579e426489921288b..20f9aa775fe16613735e3d360d29009fcdbc72cb 100644 (file)
@@ -957,7 +957,7 @@ content: ":";
 }
 
 .threaded-replies .form_notice .count {
-    top: 60px;
+    bottom: 60px;
     right: 50px;
 }
 
@@ -1622,6 +1622,11 @@ ul.profile_list li {
     display: block;
 }
 
+table.profile_list tbody tr:nth-child(2n+1) {
+    background-color: #fafafa !important;
+    border: none !important;
+}
+
 .entity_profile .entity_nickname,
 .entity_profile .entity_fn {
 margin-left:0;
index 39cce89e482edb178fd01b8aeca1c89de754c53a..be9b80d41c5b9fbad12b35f552d2a408cccd3490 100644 (file)
@@ -1141,11 +1141,6 @@ table.profile_list {
         background: url(../images/bluearrow_up.png) no-repeat top right;
 }
 
-table.profile_list tr.alt {
-    background-color: #fafafa !important;
-    border: none !important;
-}
-
 td.entity_profile {
     width: auto;
     min-width: 250px;
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 601845164b5d532d3465492fb116c63de102bac9..575e6b73868c8a06340a6be015698e810011e2f8 100644 (file)
@@ -938,11 +938,6 @@ table.profile_list {
         background: url(../images/bluearrow_up.png) no-repeat top right;
 }
 
-table.profile_list tr.alt {
-    background-color: #fafafa !important;
-    border: none !important;
-}
-
 td.entity_profile {
     width: auto;
     min-width: 250px;