]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
QnA fixes from chimo
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 24 Aug 2014 11:05:49 +0000 (13:05 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 24 Aug 2014 11:05:49 +0000 (13:05 +0200)
31 files changed:
HOW-TO-INSTALL-GNU-SOCIAL.txt [new file with mode: 0644]
README [deleted file]
README.SOCIAL [deleted file]
README.md [new file with mode: 0644]
actions/apitimelineuser.php
classes/File.php
classes/Profile.php
htaccess.sample
lib/apiaction.php
lib/attachmentlist.php
lib/attachmentlistitem.php
lib/framework.php
lib/inlineattachmentlist.php
lib/installer.php
lib/siteprofile.php
lib/util.php
plugins/Event/classes/RSVP.php
plugins/Poll/PollPlugin.php
plugins/Poll/lib/polllistitem.php [new file with mode: 0644]
plugins/TwitterBridge/TwitterBridgePlugin.php
plugins/TwitterBridge/actions/twitterauthorization.php
plugins/TwitterBridge/actions/twitterlogin.php
plugins/TwitterBridge/actions/twittersettings.php
plugins/TwitterBridge/daemons/synctwitterfriends.php
plugins/TwitterBridge/daemons/twitterstatusfetcher.php
plugins/TwitterBridge/lib/tweetinqueuehandler.php
plugins/TwitterBridge/lib/twitterimport.php
plugins/TwitterBridge/lib/twitterqueuehandler.php
plugins/TwitterBridge/tweetctlqueuehandler.php
theme/base/css/display.css
theme/neo/css/display.css

diff --git a/HOW-TO-INSTALL-GNU-SOCIAL.txt b/HOW-TO-INSTALL-GNU-SOCIAL.txt
new file mode 100644 (file)
index 0000000..24fd0a0
--- /dev/null
@@ -0,0 +1,37 @@
+## How to install GNU social
+
+There are two ways to install GNU social -- from git, or from a snapshot.
+
+### Install from git
+
+0. Make sure you have all the things you need installed:
+
+    sudo locale-gen en_US en_US.UTF-8
+    sudo dpkg-reconfigure locales 
+    sudo apt-get update -q
+    sudo apt-get dist-upgrade -y
+    sudo apt-get install -y pound varnish php5 rsync htop emacs23-nox apache2 php5-mysql dtrx mysql-server exim4
+
+1. SSH to your server
+
+    ssh mattl@mattl.io
+
+2. Make a directory for your installation and let the webserver write to it.
+
+    mkdir www/mattl.io -p
+    chown www-data:www-data www/mattl.io
+
+3. Check out GNU social into your directory.
+
+    cd www/mattl.io
+    git clone git://gitorious.org/social/mainline.git .
+
+4. Make a database.
+
+    mysql -u root -p
+    create database social;
+    exit
+
+5. Visit your website and enter your name, database details, etc.
+
+6. You're all set!
diff --git a/README b/README
deleted file mode 100644 (file)
index 3999bff..0000000
--- a/README
+++ /dev/null
@@ -1,230 +0,0 @@
-------
-README
-------
-
-StatusNet 1.1.1
-16 July 2013
-
-This is the README file for StatusNet, the Open Source social
-networking platform. It includes general information about the
-software and the project.
-
-Some other files to review:
-
-- INSTALL: instructions on how to install the software.
-- UPGRADE: upgrading from earlier versions
-- CONFIGURE: configuration options in gruesome detail.
-- PLUGINS.txt: how to install and configure plugins.
-- EVENTS.txt: events supported by the plugin system
-- COPYING: full text of the software license
-
-Information on using StatusNet can be found in the "doc" subdirectory
-or in the "help" section on-line.
-
-About
-=====
-
-StatusNet is a Free and Open Source social networking platform. It
-helps people in a community, company or group to exchange short status
-updates, do polls, announce events, or other social activities (and
-you can add more!). Users can choose which people to "follow" and
-receive only their friends' or colleagues' status messages. It
-provides a similar service to sites like Twitter, Google+, Facebook or
-Yammer, but is much more awesome.
-
-With a little work, status messages can be sent to mobile phones,
-instant messenger programs (GTalk/Jabber), and specially-designed
-desktop clients that support the Twitter API.
-
-StatusNet supports an open standard called OStatus
-<http://ostatus.org/> that lets users in different networks follow
-each other. It enables a distributed social network spread all across
-the Web.
-
-StatusNet was originally developed for the Open Software Service,
-Identi.ca <http://identi.ca/>. It is shared with you in hope that you
-too make an Open Software Service available to your users. To learn
-more, please see the Open Software Service Definition 1.1:
-
-    http://www.opendefinition.org/ossd
-
-StatusNet, Inc. <http://status.net/> also offers this software as a
-Web service, requiring no installation on your part. See
-<http://status.net/signup> for details. The software run
-on status.net is identical to the software available for download, so
-you can move back and forth between a hosted version or a version
-installed on your own servers.
-
-A commercial software subscription is available from StatusNet Inc. It
-includes 24-hour technical support and developer support. More
-information at http://status.net/contact or email sales@status.net.
-
-License
-=======
-
-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, in the file "COPYING".  If not, see
-<http://www.gnu.org/licenses/>.
-
-    IMPORTANT NOTE: The GNU Affero General Public License (AGPL) has
-    *different requirements* from the "regular" GPL. In particular, if
-    you make modifications to the StatusNet source code on your server,
-    you *MUST MAKE AVAILABLE* the modified version of the source code
-    to your users under the same license. This is a legal requirement
-    of using the software, and if you do not wish to share your
-    modifications, *YOU MAY NOT INSTALL STATUSNET*.
-
-Documentation in the /doc-src/ directory is available under the
-Creative Commons Attribution 3.0 Unported license, with attribution to
-"StatusNet". See http://creativecommons.org/licenses/by/3.0/ for details.
-
-CSS and images in the /theme/ directory are available under the
-Creative Commons Attribution 3.0 Unported license, with attribution to
-"StatusNet". See http://creativecommons.org/licenses/by/3.0/ for details.
-
-Our understanding and intention is that if you add your own theme that
-uses only CSS and images, those files are not subject to the copyleft
-requirements of the Affero General Public License 3.0. See
-http://wordpress.org/news/2009/07/themes-are-gpl-too/ . This is not
-legal advice; consult your lawyer.
-
-Additional library software has been made available in the 'extlib'
-directory. All of it is Free Software and can be distributed under
-liberal terms, but those terms may differ in detail from the AGPL's
-particulars. See each package's license file in the extlib directory
-for additional terms.
-
-New this version
-================
-
-This is a security fix and bug fix release since 1.1.0,
-released 2 July 2012. All 1.1.0 sites should upgrade to this version.
-
-It includes the following changes:
-
-- Fixes for SQL injection errors in profile lists.
-- Improved ActivityStreams JSON representation of activities and objects.
-- Upgrade to the Twitter 1.1 API.
-- More robust handling of errors in distribution.
-- Fix error in OStatus subscription for remote groups.
-- Fix error in XMPP distribution.
-
-A full changelog is available at http://status.net/wiki/StatusNet_1.1.1.
-
-Troubleshooting
-===============
-
-The primary output for StatusNet is syslog, unless you configured a
-separate logfile. This is probably the first place to look if you're
-getting weird behaviour from StatusNet.
-
-If you're tracking the unstable version of StatusNet in the git
-repository (see below), and you get a compilation error ("unexpected
-T_STRING") in the browser, check to see that you don't have any
-conflicts in your code.
-
-Unstable version
-================
-
-If you're adventurous or impatient, you may want to install the
-development version of StatusNet. To get it, use the git version
-control tool <http://git-scm.com/> like so:
-
-    git clone git@gitorious.org:statusnet/mainline.git
-
-This is the version of the software that runs on Identi.ca and the
-status.net hosted service. Using it is a mixed bag. On the positive
-side, it usually includes the latest security and bug fix patches. On
-the downside, it may also include changes that require admin
-intervention (like running a script or even raw SQL!) that may not be
-documented yet. It may be a good idea to test this version before
-installing it on your production machines.
-
-To keep it up-to-date, use 'git pull'. Watch for conflicts!
-
-Further information
-===================
-
-There are several ways to get more information about StatusNet.
-
-* There is a mailing list for StatusNet developers and admins at
-  http://mail.status.net/mailman/listinfo/statusnet-dev
-* The #statusnet IRC channel on freenode.net <http://www.freenode.net/>.
-* The StatusNet wiki, http://status.net/wiki/
-* The StatusNet blog, http://status.net/blog/
-* The StatusNet status update, <http://status.status.net/> (!)
-
-Feedback
-========
-
-* Messages to http://support.status.net/ are very welcome.
-* The group http://identi.ca/group/statusnet is a good
-  place to discuss the software.
-* StatusNet has a bug tracker for any defects you may find, or ideas for
-  making things better. http://status.net/open-source/issues
-* The StatusNet forum is at http://forum.status.net/.
-
-Credits
-=======
-
-The following is an incomplete list of developers who've worked on
-StatusNet. Apologies for any oversight; please let evan@status.net know
-if anyone's been overlooked in error.
-
-* Evan Prodromou, founder and lead developer, StatusNet, Inc.
-* Zach Copley, StatusNet, Inc.
-* Earle Martin, StatusNet, Inc.
-* Marie-Claude Doyon, designer, StatusNet, Inc.
-* Sarven Capadisli, StatusNet, Inc.
-* Robin Millette, StatusNet, Inc.
-* Ciaran Gultnieks
-* Michael Landers
-* Ori Avtalion
-* Garret Buell
-* Mike Cochrane
-* Matthew Gregg
-* Florian Biree
-* Erik Stambaugh
-* 'drry'
-* Gina Haeussge
-* Tryggvi Björgvinsson
-* Adrian Lang
-* Ori Avtalion
-* Meitar Moscovitz
-* Ken Sheppardson (Trac server, man-about-town)
-* Tiago 'gouki' Faria (i18n manager)
-* Sean Murphy
-* Leslie Michael Orchard
-* Eric Helgeson
-* Ken Sedgwick
-* Brian Hendrickson
-* Tobias Diekershoff
-* Dan Moore
-* Fil
-* Jeff Mitchell
-* Brenda Wallace
-* Jeffery To
-* Federico Marani
-* Craig Andrews
-* mEDI
-* Brett Taylor
-* Brigitte Schuster
-* Siebrand Mazeland and the amazing volunteer translators at translatewiki.net
-* Brion Vibber, StatusNet, Inc.
-* James Walker, StatusNet, Inc.
-* Samantha Doherty, designer, StatusNet, Inc.
-
-Thanks also to the developers of our upstream library code and to the
-thousands of people who have tried out Identi.ca, installed StatusNet,
-told their friends, and built the Open Microblogging network to what
-it is today.
diff --git a/README.SOCIAL b/README.SOCIAL
deleted file mode 100644 (file)
index 3394dca..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-This is GNU social, a free software, decentralized social network,
-based on StatusNet.
-
-Developers
-==========
-
-Matt Lee
-Rob Myers
-Sean Corbett
-Ian Denhardt
-Steve DuBois
-Mike Sheldon
-
-With help from
-==============
-
-Bradley M. Kuhn
-
-Special help from
-=================
-
-Craig Andrews
-
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..7101371
--- /dev/null
+++ b/README.md
@@ -0,0 +1,241 @@
+# GNU social 1.1.2 (alpha)
+August 2014
+
+(c) Free Software Foundation, Inc
+(c) StatusNet, Inc
+
+This is the README file for GNU social, the free
+software social networking platform. It includes
+general information about the software and the
+project.
+
+Some other files to review:
+
+- INSTALL: instructions on how to install the software.
+- UPGRADE: upgrading from earlier versions
+- CONFIGURE: configuration options in gruesome detail.
+- PLUGINS.txt: how to install and configure plugins.
+- EVENTS.txt: events supported by the plugin system
+- COPYING: full text of the software license
+
+Information on using GNU social can be found in
+the "doc" subdirectory or in the "help" section
+on-line, or you can catch us on IRC in #social on
+the freenode network.
+
+## About
+
+GNU social is a free social networking
+platform. It helps people in a community, company
+or group to exchange short status updates, do
+polls, announce events, or other social activities
+(and you can add more!). Users can choose which
+people to "follow" and receive only their friends'
+or colleagues' status messages. It provides a
+similar service to sites like Twitter, Google+ or
+Facebook, but is much more awesome.
+
+With a little work, status messages can be sent to
+mobile phones, instant messenger programs (using
+XMPP), and specially-designed desktop clients that
+support the Twitter API.
+
+GNU social supports an open standard called
+OStatus <http://ostatus.org/> that lets users in
+different networks follow each other. It enables a
+distributed social network spread all across the
+Web.
+
+GNU social was originally developed for the
+service, Identi.ca <http://identi.ca/>.
+
+It is shared with you in hope that you too make an
+service available to your users. To learn more,
+please see the Open Software Service Definition
+1.1:
+
+    http://www.opendefinition.org/ossd
+
+### License
+
+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, in the file "COPYING".  If not, see
+<http://www.gnu.org/licenses/>.
+
+    IMPORTANT NOTE: The GNU Affero General Public License (AGPL) has
+    *different requirements* from the "regular" GPL. In particular, if
+    you make modifications to the GNU social source code on your server,
+    you *MUST MAKE AVAILABLE* the modified version of the source code
+    to your users under the same license. This is a legal requirement
+    of using the software, and if you do not wish to share your
+    modifications, *YOU MAY NOT INSTALL GNU SOCIAL*.
+
+Documentation in the /doc-src/ directory is available under the
+Creative Commons Attribution 3.0 Unported license, with attribution to
+"GNU social". See http://creativecommons.org/licenses/by/3.0/ for details.
+
+CSS and images in the /theme/ directory are available under the
+Creative Commons Attribution 3.0 Unported license, with attribution to
+"GNU social". See http://creativecommons.org/licenses/by/3.0/ for details.
+
+Our understanding and intention is that if you add your own theme that
+uses only CSS and images, those files are not subject to the copyleft
+requirements of the Affero General Public License 3.0. See
+http://wordpress.org/news/2009/07/themes-are-gpl-too/ . This is not
+legal advice; consult your lawyer.
+
+Additional library software has been made available in the 'extlib'
+directory. All of it is Free Software and can be distributed under
+liberal terms, but those terms may differ in detail from the AGPL's
+particulars. See each package's license file in the extlib directory
+for additional terms.
+
+## New this version
+
+This is a security fix and bug fix release since 1.1.0,
+released 2 July 2012. All 1.1.0 sites should upgrade to this version.
+
+It includes the following changes:
+
+- Fixes for SQL injection errors in profile lists.
+- Improved ActivityStreams JSON representation of activities and objects.
+- Upgrade to the Twitter 1.1 API.
+- More robust handling of errors in distribution.
+- Fix error in OStatus subscription for remote groups.
+- Fix error in XMPP distribution.
+
+### Troubleshooting
+
+The primary output for GNU social is syslog,
+unless you configured a separate logfile. This is
+probably the first place to look if you're getting
+weird behaviour from GNU social.
+
+If you're tracking the unstable version of
+GNU social in the git repository (see below), and you
+get a compilation error ("unexpected T_STRING") in
+the browser, check to see that you don't have any
+conflicts in your code.
+
+### Unstable version
+
+If you're adventurous or impatient, you may want
+to install the development version of
+StatusNet. To get it, use the git version control
+tool <http://git-scm.com/> like so:
+
+    git clone git@gitorious.org:social/mainline.git
+
+Using it is a mixed bag. On the positive side, it
+usually includes the latest security and bug fix
+patches. On the downside, it may also include
+changes that require admin intervention (like
+running a script or even raw SQL!) that may not be
+documented yet. It may be a good idea to test this
+version before installing it on your production
+machines.
+
+To keep it up-to-date, use 'git pull'. Watch for
+conflicts!
+
+## Further information
+
+There are several ways to get more information
+about GNU social.
+
+* The #social IRC channel on freenode.net <http://www.freenode.net/>.
+* The GNU social website
+* Following us on GNU social -- http://quitter.se/gnusocial
+* Following us on Twitter -- https://twitter.com/gnusocial
+
+* GNU social has a bug tracker for any defects you may find, or ideas for
+  making things better. http://bugz.foocorp.net/
+
+Credits
+=======
+
+The following is an incomplete list of developers
+who've worked on GNU social, or its predecessors
+StatusNet and Free Social. Apologies for any
+oversight; please let mattl@gnu.org know if
+anyone's been overlooked in error.
+
+## Project Founders
+
+* Matt Lee (GNU social)
+* Evan Prodromou (StatusNet)
+* Mikael Nordfeldth (Free Social)
+
+Thanks to all of the StatusNet developers:
+
+* Zach Copley, StatusNet, Inc.
+* Earle Martin, StatusNet, Inc.
+* Marie-Claude Doyon, designer, StatusNet, Inc.
+* Sarven Capadisli, StatusNet, Inc.
+* Robin Millette, StatusNet, Inc.
+* Ciaran Gultnieks
+* Michael Landers
+* Ori Avtalion
+* Garret Buell
+* Mike Cochrane
+* Matthew Gregg
+* Florian Biree
+* Erik Stambaugh
+* 'drry'
+* Gina Haeussge
+* Tryggvi Björgvinsson
+* Adrian Lang
+* Ori Avtalion
+* Meitar Moscovitz
+* Ken Sheppardson (Trac server, man-about-town)
+* Tiago 'gouki' Faria (i18n manager)
+* Sean Murphy
+* Leslie Michael Orchard
+* Eric Helgeson
+* Ken Sedgwick
+* Brian Hendrickson
+* Tobias Diekershoff
+* Dan Moore
+* Fil
+* Jeff Mitchell
+* Brenda Wallace
+* Jeffery To
+* Federico Marani
+* mEDI
+* Brett Taylor
+* Brigitte Schuster
+* Siebrand Mazeland and the amazing volunteer translators at translatewiki.net
+* Brion Vibber, StatusNet, Inc.
+* James Walker, StatusNet, Inc.
+* Samantha Doherty, designer, StatusNet, Inc.
+
+### Extra special thanks to the GNU socialites
+
+* Craig Andrews
+* Donald Robertson
+* Deb Nicholson
+* Ian Denhart
+* Steven DuBois
+* Blaine Cook
+* Henry Story
+* Melvin Carvalho
+
+Thanks also to the developers of our upstream
+library code and to the thousands of people who
+have tried out GNU social, told their friends, and
+built the fediverse network to what it is today.
+
+### License help from
+
+* Bradley M. Kuhn
+
index c0894c5dbaa69491eae1725def746626f66bd477..97462452f22c0642453df81aedb56df3e2213fea 100644 (file)
@@ -59,6 +59,8 @@ class ApiTimelineUserAction extends ApiBareAuthAction
 {
     var $notices = null;
 
+    var $next_id = null;
+
     /**
      * Take arguments for running
      *
@@ -124,6 +126,24 @@ class ApiTimelineUserAction extends ApiBareAuthAction
         $suplink = common_local_url('sup', null, null, $this->target->id);
         header('X-SUP-ID: ' . $suplink);
 
+
+        // paging links
+        $nextUrl = !empty($this->next_id)
+                    ? common_local_url('ApiTimelineUser',
+                                    array('format' => $this->format,
+                                          'id' => $this->target->id),
+                                    array('max_id' => $this->next_id))
+                    : null;
+        $lastNotice = $this->notices[0];
+        $lastId     = $lastNotice->id;
+        $prevUrl = common_local_url('ApiTimelineUser',
+                                    array('format' => $this->format,
+                                          'id' => $this->target->id),
+                                    array('since_id' => $lastId));
+        $firstUrl = common_local_url('ApiTimelineUser',
+                                    array('format' => $this->format,
+                                          'id' => $this->target->id));
+
         switch($this->format) {
         case 'xml':
             $this->showXmlTimeline($this->notices);
@@ -150,37 +170,18 @@ class ApiTimelineUserAction extends ApiBareAuthAction
             // change too quickly!
 
             if (!empty($this->next_id)) {
-                $nextUrl = common_local_url('ApiTimelineUser',
-                                            array('format' => 'atom',
-                                                  'id' => $this->target->id),
-                                            array('max_id' => $this->next_id));
-
                 $atom->addLink($nextUrl,
                                array('rel' => 'next',
                                      'type' => 'application/atom+xml'));
             }
 
             if (($this->page > 1 || !empty($this->max_id)) && !empty($this->notices)) {
-
-                $lastNotice = $this->notices[0];
-                $lastId     = $lastNotice->id;
-
-                $prevUrl = common_local_url('ApiTimelineUser',
-                                            array('format' => 'atom',
-                                                  'id' => $this->target->id),
-                                            array('since_id' => $lastId));
-
                 $atom->addLink($prevUrl,
                                array('rel' => 'prev',
                                      'type' => 'application/atom+xml'));
             }
 
             if ($this->page > 1 || !empty($this->since_id) || !empty($this->max_id)) {
-
-                $firstUrl = common_local_url('ApiTimelineUser',
-                                            array('format' => 'atom',
-                                                  'id' => $this->target->id));
-
                 $atom->addLink($firstUrl,
                                array('rel' => 'first',
                                      'type' => 'application/atom+xml'));
@@ -201,7 +202,23 @@ class ApiTimelineUserAction extends ApiBareAuthAction
             $doc->addLink($link, 'alternate', 'text/html');
             $doc->addItemsFromNotices($this->notices);
 
-            // XXX: Add paging extension?
+            if (!empty($this->next_id)) {
+                $doc->addLink($nextUrl,
+                               array('rel' => 'next',
+                                     'type' => ActivityStreamJSONDocument::CONTENT_TYPE));
+            }
+
+            if (($this->page > 1 || !empty($this->max_id)) && !empty($this->notices)) {
+                $doc->addLink($prevUrl,
+                               array('rel' => 'prev',
+                                     'type' => ActivityStreamJSONDocument::CONTENT_TYPE));
+            }
+
+            if ($this->page > 1 || !empty($this->since_id) || !empty($this->max_id)) {
+                $doc->addLink($firstUrl,
+                               array('rel' => 'first',
+                                     'type' => ActivityStreamJSONDocument::CONTENT_TYPE));
+            }
 
             $this->raw($doc->asString());
             break;
index b834036405aba6a3b85c21c5028ac19d924db243..210e758419570c8044bba27429f0ca5ecdb1dde8 100644 (file)
@@ -352,30 +352,21 @@ class File extends Managed_DataObject
 
     function getEnclosure(){
         $enclosure = (object) array();
-        $enclosure->title=$this->title;
-        $enclosure->url=$this->url;
-        $enclosure->title=$this->title;
-        $enclosure->date=$this->date;
-        $enclosure->modified=$this->modified;
-        $enclosure->size=$this->size;
-        $enclosure->mimetype=$this->mimetype;
-
-        if (!isset($this->filename)) {
-            $notEnclosureMimeTypes = array(null,'text/html','application/xhtml+xml');
-            $mimetype = $this->mimetype;
-            if($mimetype != null){
-                $mimetype = strtolower($this->mimetype);
-            }
-            $semicolon = strpos($mimetype,';');
-            if($semicolon){
-                $mimetype = substr($mimetype,0,$semicolon);
-            }
-            if (in_array($mimetype, $notEnclosureMimeTypes)) {
-                Event::handle('FileEnclosureMetadata', array($this, &$enclosure));
-            }
+        foreach (array('title', 'url', 'date', 'modified', 'size', 'mimetype') as $key) {
+            $enclosure->$key = $this->$key;
+        }
+
+        $needMoreMetadataMimetypes = array(null, 'text/html', 'application/xhtml+xml');
+
+        if (!isset($this->filename) && in_array(common_bare_mime($enclosure->mimetype), $needMoreMetadataMimetypes)) {
+            // This fetches enclosure metadata for non-local links with unset/HTML mimetypes,
+            // which may be enriched through oEmbed or similar (implemented as plugins)
+            Event::handle('FileEnclosureMetadata', array($this, &$enclosure));
         }
-        if (empty($enclosure->mimetype)) {
-            // This means we don't know what it is, so it can't be an enclosure!
+        if (empty($enclosure->mimetype) || in_array(common_bare_mime($enclosure->mimetype), $needMoreMetadataMimetypes)) {
+            // This means we either don't know what it is, so it can't
+            // be shown as an enclosure, or it is an HTML link which
+            // does not link to a resource with further metadata.
             throw new ServerException('Unknown enclosure mimetype, not enough metadata');
         }
         return $enclosure;
@@ -550,4 +541,11 @@ class File extends Managed_DataObject
         // And finally remove the entry from the database
         return parent::delete($useWhere);
     }
+
+    public function getTitle()
+    {
+        $title = $this->title ?: $this->filename;
+
+        return $title ?: null;
+    }
 }
index 94f83ab788a1ca388168d1bfb80dec1251c2ccb1..1af29b262090c11d94de624f6ad1feff7d073a73 100644 (file)
@@ -1324,6 +1324,7 @@ class Profile extends Managed_DataObject
             $object->id     = $this->getUri();
             $object->title  = $this->getBestName();
             $object->link   = $this->getUrl();
+            $object->summary = $this->getDescription();
 
             try {
                 $avatar = Avatar::getUploaded($this);
@@ -1390,6 +1391,11 @@ class Profile extends Managed_DataObject
         return $this->nickname;
     }
 
+    public function getDescription()
+    {
+        return $this->bio;
+    }
+
     /**
      * Returns the best URI for a profile. Plugins may override.
      *
index fb191cc7e8cf2e1082c6b0137641d68673697601..90e18e72e678e68a818b5051d73dd26a0477a937 100644 (file)
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule (.*) index.php?p=$1 [L,QSA]
+
+  ## You can also use PATHINFO by using this RewriteRule instead:
+  # RewriteRule (.*) index.php/$1 [L,QSA]
 </IfModule>
 
 <FilesMatch "\.(ini)">
+  # For mod_access_compat in Apache <2.4
   Order allow,deny
-</FilesMatch>
 
+  # Use this instead for Apache >2.4 (mod_authz_host)
+  # Require all denied
+</FilesMatch>
index d945d532d013969e139b73a40ff7bdf0d7700ff5..b55647e445d2022654b2167a2b68fb251f9242a6 100644 (file)
@@ -127,6 +127,7 @@ class ApiAction extends Action
     var $since_id  = null;
     var $source    = null;
     var $callback  = null;
+    var $format    = null;
 
     var $access    = self::READ_ONLY;  // read (default) or read-write
 
index 6609cb40daecc66c64492d02bcbf7338b3772d4d..d6cfda6f95961b4f3bd74be7a1a52d384df947bc 100644 (file)
@@ -74,18 +74,28 @@ class AttachmentList extends Widget
      */
     function show()
     {
-       $att = $this->notice->attachments();
-        if (empty($att)) return 0;
+       $attachments = $this->notice->attachments();
+        $representable = false;
+        foreach ($attachments as $key=>$att) {
+            // Only show attachments representable with a title
+            if ($att->getTitle() === null) {
+                unset($attachments[$key]);
+            }
+        }
+        if (!count($attachments)) {
+            return 0;
+        }
+
         $this->showListStart();
 
-        foreach ($att as $n=>$attachment) {
-            $item = $this->newListItem($attachment);
+        foreach ($attachments as $att) {
+            $item = $this->newListItem($att);
             $item->show();
         }
 
         $this->showListEnd();
 
-        return count($att);
+        return count($attachments);
     }
 
     function showListStart()
index 025ffa9fd6a7cefb019ad178d7bfac476308a69b..3764c827cb2f7ea459f4db9ceb99601177274531 100644 (file)
@@ -63,7 +63,7 @@ class AttachmentListItem extends Widget
     }
 
     function title() {
-        return $this->attachment->title ?: $this->attachment->filename;
+        return $this->attachment->getTitle();
     }
 
     function linkTitle() {
index cc716cbdb54f39749a40734f9f02a1c2e7687ca3..3c96f7c39b11728a54b07120cc3c24bb0c30a8cc 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.1.1');
-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 04fddf3b304b3d35c6b74cf010bda124fca53df1..d760400487605ddc92f42fccac005e61b3d9b0b4 100644 (file)
@@ -35,12 +35,8 @@ class InlineAttachmentList extends AttachmentList
 {
     function showListStart()
     {
-        $this->out->elementStart('div', array('class' => 'attachments'));
-    }
-
-    function showListEnd()
-    {
-        $this->out->elementEnd('div');
+        $this->out->element('h2', null, _('Attachments'));
+        parent::showListStart();
     }
 
     /**
@@ -59,20 +55,8 @@ class InlineAttachmentList extends AttachmentList
 class InlineAttachmentListItem extends AttachmentListItem
 {
     function showLink() {
-        $this->out->elementStart('a', $this->linkAttr());
+        $this->out->element('a', $this->linkAttr(), $this->title());
         $this->showRepresentation();
-        $this->out->elementEnd('a');
-    }
-
-    /**
-     * Build HTML attributes for the link
-     * @return array
-     */
-    function linkAttr()
-    {
-        $attr = parent::linkAttr();
-        $attr['class'] = 'attachment-thumbnail';
-        return $attr;
     }
 
     /**
@@ -84,7 +68,7 @@ class InlineAttachmentListItem extends AttachmentListItem
     {
         // XXX: RDFa
         // TODO: add notice_type class e.g., notice_video, notice_image
-        $this->out->elementStart('span', array('class' => 'inline-attachment'));
+        $this->out->elementStart('li', array('class' => 'inline-attachment'));
     }
 
     /**
@@ -96,6 +80,6 @@ class InlineAttachmentListItem extends AttachmentListItem
      */
     function showEnd()
     {
-        $this->out->elementEnd('span');
+        $this->out->elementEnd('li');
     }
 }
index dc4c7786a8d007c93155ad9f75a85e637f924573..cea7d29ec7df621801ffaeb934fc5fd7462b65ed 100644 (file)
@@ -293,6 +293,11 @@ abstract class Installer
             }
         }
 
+        if (!$conn instanceof DB_common) {
+            // Is not the right instance
+            throw new Exception('Cannot connect to database: ' . $conn->getMessage());
+        }
+
         $res = $this->updateStatus("Creating database tables...");
         if (!$this->createCoreTables($conn)) {
             $this->updateStatus("Error creating tables.", true);
index d2a4a00204d34f33ba48c1998be2467f740bed1a..569a4bbaf8d56f9eb987821784352822e137c8f2 100644 (file)
@@ -230,8 +230,6 @@ class SingleuserSite extends SiteProfileSettings
                 'core'    => self::corePlugins(),
                 'default' => array_merge(self::defaultPlugins(), array(
                     'MobileProfile'           => array(),
-                    'TwitterBridge'           => array(),
-                    'FacebookBridge'          => array(),
                 )),
                 'disable-Directory' => 1,
             ),
index fd89bb491cd44d2e3351854ae16654029b783ae1..08a0cdea2fac9f736e164ac0e01e0a3f1bccd2c9 100644 (file)
@@ -1820,6 +1820,15 @@ function common_get_mime_media($type)
     return strtolower($tmp[0]);
 }
 
+function common_bare_mime($mimetype)
+{
+    $mimetype = mb_strtolower($mimetype);
+    if ($semicolon = mb_strpos($mimetype, ';')) {
+        $mimetype = mb_substr($mimetype, 0, $semicolon);
+    }
+    return $mimetype;
+}
+
 function common_mime_type_match($type, $avail)
 {
     if(array_key_exists($type, $avail)) {
index 31ccf439ef9ac0812b4123ffa6d9208ddd4003f5..de3307fad4e4352ef6ca1c4bc3cfbc967e6e00e0 100644 (file)
@@ -226,7 +226,12 @@ class RSVP extends Managed_DataObject
 
     static function fromNotice(Notice $notice)
     {
-        return RSVP::getKV('uri', $notice->uri);
+        $rsvp = new RSVP();
+        $rsvp->uri = $notice->uri;
+        if (!$rsvp->find(true)) {
+            throw new NoResultException($rsvp);
+        }
+        return $rsvp;
     }
 
     static function forEvent(Happening $event)
index 2a5805015cee8f74fb30881fe9bf534cb3248a40..ff98bcfb307e745050fc1bd36550f70650378281 100644 (file)
@@ -137,6 +137,11 @@ class PollPlugin extends MicroAppPlugin
         return array(self::POLL_OBJECT, self::POLL_RESPONSE_OBJECT);
     }
 
+
+    function adaptNoticeListItem($nli) {
+        return new PollListItem($nli);
+    }
+
     /**
      * When a notice is deleted, delete the related Poll
      *
@@ -375,65 +380,6 @@ class PollPlugin extends MicroAppPlugin
         }
     }
 
-
-    function showNoticeContent(Notice $notice, HTMLOutputter $out)
-    {
-        switch ($notice->object_type) {
-        case self::POLL_OBJECT:
-            return $this->showNoticePoll($notice, $out);
-        case self::POLL_RESPONSE_OBJECT:
-            return $this->showNoticePollResponse($notice, $out);
-        default:
-            // TRANS: Exception thrown when performing an unexpected action on a poll.
-            // TRANS: %s is the unexpected object type.
-            throw new Exception(sprintf(_m('Unexpected type for poll plugin: %s.'), $notice->object_type));
-        }
-    }
-
-    function showNoticePoll(Notice $notice, $out)
-    {
-        $user = common_current_user();
-
-        // @hack we want regular rendering, then just add stuff after that
-        $nli = new NoticeListItem($notice, $out);
-        $nli->showNotice();
-
-        $out->elementStart('div', array('class' => 'e-content poll-content'));
-        $poll = Poll::getByNotice($notice);
-        if ($poll) {
-            if ($user) {
-                $profile = $user->getProfile();
-                $response = $poll->getResponse($profile);
-                if ($response) {
-                    // User has already responded; show the results.
-                    $form = new PollResultForm($poll, $out);
-                } else {
-                    $form = new PollResponseForm($poll, $out);
-                }
-                $form->show();
-            }
-        } else {
-            // TRANS: Error text displayed if no poll data could be found.
-            $out->text(_m('Poll data is missing'));
-        }
-        $out->elementEnd('div');
-
-        // @fixme
-        $out->elementStart('div', array('class' => 'e-content'));
-    }
-
-    function showNoticePollResponse(Notice $notice, $out)
-    {
-        $user = common_current_user();
-
-        // @hack we want regular rendering, then just add stuff after that
-        $nli = new NoticeListItem($notice, $out);
-        $nli->showNotice();
-
-        // @fixme
-        $out->elementStart('div', array('class' => 'e-content'));
-    }
-
     function entryForm($out)
     {
         return new NewPollForm($out);
diff --git a/plugins/Poll/lib/polllistitem.php b/plugins/Poll/lib/polllistitem.php
new file mode 100644 (file)
index 0000000..875fa9c
--- /dev/null
@@ -0,0 +1,111 @@
+<?php
+/**
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2011, StatusNet, Inc.
+ *
+ * Adapter to show polls in a nicer way
+ *
+ * PHP version 5
+ *
+ * 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  Poll
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 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 adapter to show polls in a nicer way
+ *
+ * @category  Poll
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @copyright 2011 StatusNet, Inc.
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
+ * @link      http://status.net/
+ */
+
+class PollListItem extends NoticeListItemAdapter
+{
+    // @fixme which domain should we use for these namespaces?
+    const POLL_OBJECT          = 'http://activityschema.org/object/poll';
+    const POLL_RESPONSE_OBJECT = 'http://activityschema.org/object/poll-response';
+
+    function showNotice(Notice $notice, $out)
+    {
+        switch ($notice->object_type) {
+        case self::POLL_OBJECT:
+            return $this->showNoticePoll($notice, $out);
+        case self::POLL_RESPONSE_OBJECT:
+            return $this->showNoticePollResponse($notice, $out);
+        default:
+            // TRANS: Exception thrown when performing an unexpected action on a poll.
+            // TRANS: %s is the unexpected object type.
+            throw new Exception(sprintf(_m('Unexpected type for poll plugin: %s.'), $notice->object_type));
+        }
+    }
+
+    function showNoticePoll(Notice $notice, $out)
+    {
+        $user = common_current_user();
+
+        // @hack we want regular rendering, then just add stuff after that
+        $nli = new NoticeListItem($notice, $out);
+        $nli->showNotice();
+
+        $out->elementStart('div', array('class' => 'e-content poll-content'));
+        $poll = Poll::getByNotice($notice);
+        if ($poll) {
+            if ($user) {
+                $profile = $user->getProfile();
+                $response = $poll->getResponse($profile);
+                if ($response) {
+                    // User has already responded; show the results.
+                    $form = new PollResultForm($poll, $out);
+                } else {
+                    $form = new PollResponseForm($poll, $out);
+                }
+                $form->show();
+            }
+        } else {
+            // TRANS: Error text displayed if no poll data could be found.
+            $out->text(_m('Poll data is missing'));
+        }
+        $out->elementEnd('div');
+
+        // @fixme
+        $out->elementStart('div', array('class' => 'e-content'));
+    }
+
+    function showNoticePollResponse(Notice $notice, $out)
+    {
+        $user = common_current_user();
+
+        // @hack we want regular rendering, then just add stuff after that
+        $nli = new NoticeListItem($notice, $out);
+        $nli->showNotice();
+
+        // @fixme
+        $out->elementStart('div', array('class' => 'e-content'));
+    }
+}
index 3284d10563310c2aea47d9aaa115e45d96566a7a..8d14744090ab0c5a734e5264b40fba4a31c43c79 100644 (file)
@@ -30,7 +30,7 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once __DIR__ . '/twitter.php';
 
 /**
  * Plugin for sending and importing Twitter statuses
index aace7e4f09c67763003e1ebb26b0c2950960e0b8..ce6af091e2d5adcd61a8ccca503ad024417e7b52 100644 (file)
@@ -32,7 +32,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
 
 /**
  * Class for doing OAuth authentication against Twitter
index 379e136045d21dca566501418c5d57b9460135e0..ee00714c9f18f14f9adfb369da93b4b5cd6921b5 100644 (file)
@@ -32,7 +32,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
 
 /**
  * Page for logging in with Twitter
index cc3e34f345e15835c123ea21078443ffe37a1d29..37abb4d27297281e501313ab17a147d0fe246d45 100644 (file)
@@ -31,7 +31,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
 
 /**
  * Settings for Twitter integration
index 651c4d34da145b59b2b74ebcd30c91cea559a6db..8b8ffbfd496bdbaaa0382f71c4bf12db2469a4a7 100755 (executable)
@@ -31,7 +31,7 @@ Batch script for synching local friends with Twitter friends.
 END_OF_TRIM_HELP;
 
 require_once INSTALLDIR . '/scripts/commandline.inc';
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
 
 /**
  * Daemon to sync local friends with Twitter friends
index b4b78dc80af3fee43a0179b2904712c0ba3be90f..74fc77cd79a00b6a2e494c24e8cdff59a906b51f 100755 (executable)
@@ -39,7 +39,7 @@ END_OF_TRIM_HELP;
 require_once INSTALLDIR . '/scripts/commandline.inc';
 require_once INSTALLDIR . '/lib/common.php';
 require_once INSTALLDIR . '/lib/daemon.php';
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
 
 /**
  * Fetch statuses from Twitter
index 0ab74803058d208f461ed69fd929faeef43b2ed7..cc0c05f9a669abbe2bfd4496c526021f2341dda4 100644 (file)
@@ -19,7 +19,7 @@
 
 if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
 
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
 
 /**
  * Queue handler to deal with incoming Twitter status updates, as retrieved by
index 41d8ac9d469831490498fd1b00af399928027f59..5258bfc2c981767bba9d297f33ef56905a3a08a3 100644 (file)
@@ -31,7 +31,7 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
 
 /**
  * Encapsulation of the Twitter status -> notice incoming bridge import.
index 644ce17871eb83b6a14ead9a88fd8c4b8fa3235a..bba1b8b2bc80f00aae961646daa769e38e1abafc 100644 (file)
@@ -19,7 +19,7 @@
 
 if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
 
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once dirname(__DIR__) . '/twitter.php';
 
 class TwitterQueueHandler extends QueueHandler
 {
index 4c8bef463ef5d94ecc4301a7b1640379286ef65f..d7636c373e64c4aa85cf5e210eee8ce673777fcb 100644 (file)
@@ -19,7 +19,7 @@
 
 if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
 
-require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once __DIR__ . '/twitter.php';
 
 /**
  * Queue handler to deal with incoming Twitter status updates, as retrieved by
index 792501e28905fddae5634cb531229bca7a12dea9..1029850a1e654fa8b46144a802f420da1b36f759 100644 (file)
@@ -704,7 +704,7 @@ font-style:italic;
     min-height: 1em; 
 }
 
-#shownotice .notice .h-entry {,
+#shownotice .notice .h-entry {
     font-size:2.2em;
     min-height:123px;
     font-size: 1.6em;
@@ -812,6 +812,15 @@ position:static;
     top: 1em;
 }
 
+.notice.h-entry .attachments .inline-attachment * {
+    max-width: 100%;
+}
+.notice.h-entry .attachments .inline-attachment > a {
+    font-size: 0.88em;
+    line-height: 16px;
+    height: 16px;
+}
+
 #attachments {
 clear:both;
 float:left;
@@ -1991,8 +2000,6 @@ margin:0;
 #profile_search_results {
 display:block;
 border-radius:4px;
--moz-border-radius:4px;
--webkit-border-radius:4px;
 max-height:800px;
 margin:10px 0;
 padding: 5px;
@@ -2061,8 +2068,6 @@ float:left;
     padding: 6px;
     margin: 4px 0px 0px 4px;
     border-top-left-radius: 7px;
-    -moz-border-radius-topleft: 7px;
-    -webkit-border-top-left-radius: 7px;
 }
 
 .oauth-desktop-mode fieldset {
@@ -2484,7 +2489,7 @@ display:none;
     list-style-type: none;
 }
 
-/*end of @media screen, projection, tv*/
+}/*end of @media screen, projection, tv*/
 
 
 @media print {
index dce214f07b029f6d5a9bc08781b3ba77cd9bd8fe..a46f296537db20e52e0ab8b04d68f8b33fc8ea2c 100644 (file)
@@ -442,7 +442,6 @@ h6 {font-size: 1em;}
     border: 1px solid #aaa;
     border-radius: 4px;
     box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.4);
-    position: relative;
 }
 
 .notice-options .form_repeat.dialogbox legend {