]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '0.9.x' into 1.0.x
authorBrion Vibber <brion@pobox.com>
Mon, 16 Aug 2010 23:56:27 +0000 (16:56 -0700)
committerBrion Vibber <brion@pobox.com>
Mon, 16 Aug 2010 23:56:27 +0000 (16:56 -0700)
1  2 
EVENTS.txt
README
lib/apiaction.php
lib/common.php

diff --combined EVENTS.txt
index 68752ef3fe0bf603b43905be1e2cd81230d7abd7,1a3b2594a2efe55ef5be80810e1321c76385ee99..39d34afe06a94b38f93e855dc5f81292d3c687cf
@@@ -716,24 -716,6 +716,24 @@@ StartShowContentLicense: Showing the de
  EndShowContentLicense: Showing the default license for content
  - $action: the current action
  
 +GetImTransports: Get IM transports that are available
 +- &$transports: append your transport to this array like so: $transports[transportName]=array('display'=>display)
 +
 +NormalizeImScreenname: Normalize an IM screenname
 +- $transport: transport the screenname is on
 +- &$screenname: screenname to be normalized
 +
 +ValidateImScreenname: Validate an IM screenname
 +- $transport: transport the screenname is on
 +- $screenname: screenname to be validated
 +- $valid: is the screenname valid?
 +
 +SendImConfirmationCode: Send a confirmation code to confirm a user owns an IM screenname
 +- $transport: transport the screenname exists on
 +- $screenname: screenname being confirmed
 +- $code: confirmation code for confirmation URL
 +- $user: user requesting the confirmation
 +
  StartUserRegister: When a new user is being registered
  - &$profile: new profile data (no ID)
  - &$user: new user account (no ID or URI)
@@@ -1063,3 -1045,24 +1063,24 @@@ StartActivityEnd: before the closing </
  EndActivityEnd: after the closing </entry> in a notice activity entry
  - &$notice: notice being output
  - &$xs: XMLStringer for output
+ StartNoticeSaveWeb: before saving a notice through the Web interface
+ - $action: action being executed (instance of NewNoticeAction)
+ - &$authorId: integer ID of the author
+ - &$text: text of the notice
+ - &$options: additional options (location, replies, etc.)
+ EndNoticeSaveWeb: after saving a notice through the Web interface
+ - $action: action being executed (instance of NewNoticeAction)
+ - $notice: notice that was saved
+ StartRssEntryArray: at the start of copying a notice to an array
+ - $notice: the notice being copied
+ - &$entry: the entry (empty at beginning)
+ EndRssEntryArray: at the end of copying a notice to an array
+ - $notice: the notice being copied
+ - &$entry: the entry, with all the fields filled up
+ NoticeDeleteRelated: at the beginning of deleting related fields to a notice
+ - $notice: notice being deleted
diff --combined README
index 393008f5d1e07794f87e2f4d7e065caf50094076,e5cb2c933d53f378b7ca4c07f8fd82c10139cba3..e01d149167a73e422096394584d2e62a0b55c07a
--- 1/README
--- 2/README
+++ b/README
@@@ -2,8 -2,8 +2,8 @@@
  README
  ------
  
- StatusNet 0.9.4beta2
- 11 August 2010
+ StatusNet 0.9.4 "Orange Crush"
+ 16 August 2010
  
  This is the README file for StatusNet, the Open Source microblogging
  platform. It includes installation instructions, descriptions of
@@@ -88,9 -88,6 +88,6 @@@ For best compatibility with client soft
  bug fixes, it is highly recommended that all public sites upgrade to the new
  version.
  
- Changes from 0.9.4beta1:
- - fix for daemon config switching on multi-site setup
  Notable changes this version:
  
  - OpenID and OAuth libraries patched for potential timing attack
@@@ -845,7 -842,9 +842,7 @@@ sslserver: use an alternate server nam
      parameters correctly so that both the SSL server and the
      "normal" server can access the session cookie and
      preferably other cookies as well.
 -shorturllength: Length of URL at which URLs in a message exceeding 140
 -    characters will be sent to the user's chosen
 -    shortening service.
 +shorturllength: ignored. See 'url' section below.
  dupelimit: minimum time allowed for one person to say the same thing
      twice. Default 60s. Anything lower is considered a user
      or UI error.
@@@ -1468,22 -1467,6 +1465,22 @@@ disallow: Array of (virtual) directorie
      'search', 'message', 'settings', 'admin'. Ignored when site
      is private, in which case the entire site ('/') is disallowed.
  
 +url
 +---
 +
 +Everybody loves URL shorteners. These are some options for fine-tuning
 +how and when the server shortens URLs.
 +
 +shortener: URL shortening service to use by default. Users can override
 +           individually. 'ur1.ca' by default.
 +maxlength: If an URL is strictly longer than this limit, it will be
 +           shortened. Note that the URL shortener service may return an
 +           URL longer than this limit. Defaults to 25. Users can
 +           override. If set to 0, all URLs will be shortened.
 +maxnoticelength: If a notice is strictly longer than this limit, all
 +           URLs in the notice will be shortened. Users can override.
 +           -1 means the text limit for notices.
 +
  Plugins
  =======
  
diff --combined lib/apiaction.php
index 432b3245320aa9ac1718ee9aa97182119575a128,cc98b9b6ec57d380c2a33637a11c4f19cd5d53b6..bb39e4e512210852018f175cd304a4d69936d297
@@@ -98,8 -98,6 +98,8 @@@ if (!defined('STATUSNET')) 
      exit(1);
  }
  
 +class ApiValidationException extends Exception { }
 +
  /**
   * Contains most of the Twitter-compatible API output functions.
   *
@@@ -464,66 -462,71 +464,71 @@@ class ApiAction extends Actio
  
      function twitterRssEntryArray($notice)
      {
-         $profile = $notice->getProfile();
          $entry = array();
  
-         // We trim() to avoid extraneous whitespace in the output
+         if (Event::handle('StartRssEntryArray', array($notice, &$entry))) {
  
-         $entry['content'] = common_xml_safe_str(trim($notice->rendered));
-         $entry['title'] = $profile->nickname . ': ' . common_xml_safe_str(trim($notice->content));
-         $entry['link'] = common_local_url('shownotice', array('notice' => $notice->id));
-         $entry['published'] = common_date_iso8601($notice->created);
+             $profile = $notice->getProfile();
  
-         $taguribase = TagURI::base();
-         $entry['id'] = "tag:$taguribase:$entry[link]";
+             // We trim() to avoid extraneous whitespace in the output
  
-         $entry['updated'] = $entry['published'];
-         $entry['author'] = $profile->getBestName();
+             $entry['content'] = common_xml_safe_str(trim($notice->rendered));
+             $entry['title'] = $profile->nickname . ': ' . common_xml_safe_str(trim($notice->content));
+             $entry['link'] = common_local_url('shownotice', array('notice' => $notice->id));
+             $entry['published'] = common_date_iso8601($notice->created);
  
-         // Enclosures
-         $attachments = $notice->attachments();
-         $enclosures = array();
-         foreach ($attachments as $attachment) {
-             $enclosure_o=$attachment->getEnclosure();
-             if ($enclosure_o) {
-                  $enclosure = array();
-                  $enclosure['url'] = $enclosure_o->url;
-                  $enclosure['mimetype'] = $enclosure_o->mimetype;
-                  $enclosure['size'] = $enclosure_o->size;
-                  $enclosures[] = $enclosure;
-             }
-         }
+             $taguribase = TagURI::base();
+             $entry['id'] = "tag:$taguribase:$entry[link]";
  
-         if (!empty($enclosures)) {
-             $entry['enclosures'] = $enclosures;
-         }
+             $entry['updated'] = $entry['published'];
+             $entry['author'] = $profile->getBestName();
  
-         // Tags/Categories
-         $tag = new Notice_tag();
-         $tag->notice_id = $notice->id;
-         if ($tag->find()) {
-             $entry['tags']=array();
-             while ($tag->fetch()) {
-                 $entry['tags'][]=$tag->tag;
+             // Enclosures
+             $attachments = $notice->attachments();
+             $enclosures = array();
+             foreach ($attachments as $attachment) {
+                 $enclosure_o=$attachment->getEnclosure();
+                 if ($enclosure_o) {
+                     $enclosure = array();
+                     $enclosure['url'] = $enclosure_o->url;
+                     $enclosure['mimetype'] = $enclosure_o->mimetype;
+                     $enclosure['size'] = $enclosure_o->size;
+                     $enclosures[] = $enclosure;
+                 }
              }
-         }
-         $tag->free();
  
-         // RSS Item specific
-         $entry['description'] = $entry['content'];
-         $entry['pubDate'] = common_date_rfc2822($notice->created);
-         $entry['guid'] = $entry['link'];
+             if (!empty($enclosures)) {
+                 $entry['enclosures'] = $enclosures;
+             }
  
-         if (isset($notice->lat) && isset($notice->lon)) {
-             // This is the format that GeoJSON expects stuff to be in.
-             // showGeoRSS() below uses it for XML output, so we reuse it
-             $entry['geo'] = array('type' => 'Point',
-                                   'coordinates' => array((float) $notice->lat,
-                                                          (float) $notice->lon));
-         } else {
-             $entry['geo'] = null;
+             // Tags/Categories
+             $tag = new Notice_tag();
+             $tag->notice_id = $notice->id;
+             if ($tag->find()) {
+                 $entry['tags']=array();
+                 while ($tag->fetch()) {
+                     $entry['tags'][]=$tag->tag;
+                 }
+             }
+             $tag->free();
+             // RSS Item specific
+             $entry['description'] = $entry['content'];
+             $entry['pubDate'] = common_date_rfc2822($notice->created);
+             $entry['guid'] = $entry['link'];
+             if (isset($notice->lat) && isset($notice->lon)) {
+                 // This is the format that GeoJSON expects stuff to be in.
+                 // showGeoRSS() below uses it for XML output, so we reuse it
+                 $entry['geo'] = array('type' => 'Point',
+                                       'coordinates' => array((float) $notice->lat,
+                                                              (float) $notice->lon));
+             } else {
+                 $entry['geo'] = null;
+             }
+             Event::handle('EndRssEntryArray', array($notice, &$entry));
          }
  
          return $entry;
diff --combined lib/common.php
index 570666da791307cdea2e2a57b24d8f5cdec4e3ef,097f19268d55398ef14697107c79f48a1811be6d..422a639b879a9e4c54b3862c1aa591aa651d65f0
@@@ -22,7 -22,7 +22,7 @@@ if (!defined('STATUSNET') && !defined('
  //exit with 200 response, if this is checking fancy from the installer
  if (isset($_REQUEST['p']) && $_REQUEST['p'] == 'check-fancy') {  exit; }
  
- define('STATUSNET_VERSION', '0.9.4beta2');
+ define('STATUSNET_VERSION', '0.9.4');
  define('LACONICA_VERSION', STATUSNET_VERSION); // compatibility
  
  define('STATUSNET_CODENAME', 'Orange Crush');
@@@ -71,7 -71,6 +71,7 @@@ if (!function_exists('dl')) 
  # global configuration object
  
  require_once('PEAR.php');
 +require_once('PEAR/Exception.php');
  require_once('DB/DataObject.php');
  require_once('DB/DataObject/Cast.php'); # for dates
  
@@@ -128,23 -127,6 +128,23 @@@ require_once INSTALLDIR.'/lib/subs.php'
  require_once INSTALLDIR.'/lib/clientexception.php';
  require_once INSTALLDIR.'/lib/serverexception.php';
  
 +
 +//set PEAR error handling to use regular PHP exceptions
 +function PEAR_ErrorToPEAR_Exception($err)
 +{
 +    //DB_DataObject throws error when an empty set would be returned
 +    //That behavior is weird, and not how the rest of StatusNet works.
 +    //So just ignore those errors.
 +    if ($err->getCode() == DB_DATAOBJECT_ERROR_NODATA) {
 +        return;
 +    }
 +    if ($err->getCode()) {
 +        throw new PEAR_Exception($err->getMessage(), $err->getCode());
 +    }
 +    throw new PEAR_Exception($err->getMessage());
 +}
 +PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'PEAR_ErrorToPEAR_Exception');
 +
  try {
      StatusNet::init(@$server, @$path, @$conffile);
  } catch (NoConfigException $e) {