]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'twitter-oauth' into 0.8.x
authorZach Copley <zach@controlyourself.ca>
Mon, 10 Aug 2009 07:49:51 +0000 (07:49 +0000)
committerZach Copley <zach@controlyourself.ca>
Mon, 10 Aug 2009 07:49:51 +0000 (07:49 +0000)
Conflicts:

scripts/getvaliddaemons.php

54 files changed:
README
actions/allrss.php
actions/api.php
actions/emailsettings.php
actions/favoritesrss.php
actions/grouprss.php
actions/imsettings.php
actions/noticesearchrss.php
actions/publicrss.php
actions/repliesrss.php
actions/showfavorites.php
actions/shownotice.php
actions/smssettings.php
actions/subscriptions.php
actions/tagrss.php
actions/twitapigroups.php
actions/twittersettings.php
actions/userrss.php
classes/User_group.php
config.php.sample
db/074to080.sql
db/074to080_pg.sql
db/laconica.sql
db/laconica_pg.sql
doc-src/sms
index.php
install.php
js/util.js
lib/action.php
lib/common.php
lib/connectsettingsaction.php
lib/htmloutputter.php
lib/jsonsearchresultslist.php
lib/mail.php
lib/noticelist.php
lib/router.php
lib/twitterapi.php
plugins/Autocomplete/Autocomplete.js
plugins/FBConnect/FBConnectPlugin.php
plugins/FBConnect/README
scripts/getvaliddaemons.php
scripts/maildaemon.php
theme/base/images/icons/icon_atom.png
theme/base/images/icons/icon_rss.png
theme/default/css/display.css
theme/default/default-avatar-mini.png
theme/default/default-avatar-profile.png
theme/default/default-avatar-stream.png
theme/default/logo.png
theme/identica/css/display.css
theme/identica/default-avatar-mini.png
theme/identica/default-avatar-profile.png
theme/identica/default-avatar-stream.png
theme/identica/logo.png

diff --git a/README b/README
index ef5a1393468fb7bd22ef1e5d1207a3b2e5e79c98..12c465869c5ab7b8b6fcc24194f7757518a59515 100644 (file)
--- a/README
+++ b/README
@@ -1228,6 +1228,30 @@ enabled: Set to true to enable. Default false.
 server: a string with the hostname of the sphinx server.
 port: an integer with the port number of the sphinx server.
 
+emailpost
+---------
+
+For post-by-email.
+
+enabled: Whether to enable post-by-email. Defaults to true. You will
+         also need to set up maildaemon.php.
+
+sms
+---
+
+For SMS integration.
+
+enabled: Whether to enable SMS integration. Defaults to true. Queues
+         should also be enabled.
+
+twitter
+-------
+
+For Twitter integration
+
+enabled: Whether to enable Twitter integration. Defaults to true.
+         Queues should also be enabled.
+
 integration
 -----------
 
index 885a67f6188af13b07a0ea7e6bf9a8302078e476..260667090b65b0af175a5920dd0cd948fd6eb731 100644 (file)
@@ -115,8 +115,8 @@ class AllrssAction extends Rss10Action
                    'link' => common_local_url('all',
                                              array('nickname' =>
                                                    $user->nickname)),
-                   'description' => sprintf(_('Feed for friends of %s'),
-                                            $user->nickname));
+                   'description' => sprintf(_('Updates from %1$s and friends on %2$s!'),
+                                            $user->nickname, common_config('site', 'name')));
         return $c;
     }
 
index 99ab262ad77685cdad2a347264e29b079a27382f..6d226af7e604da46be55cbeae10076780a027c7d 100644 (file)
@@ -131,6 +131,8 @@ class ApiAction extends Action
                                 'tags/timeline',
                                 'oembed/oembed',
                                 'groups/show',
+                                'groups/timeline',
+                                'groups/list_all',
                                 'groups/timeline');
 
         static $bareauth = array('statuses/user_timeline',
@@ -140,7 +142,8 @@ class ApiAction extends Action
                                  'statuses/mentions',
                                  'statuses/followers',
                                  'favorites/favorites',
-                                 'friendships/show');
+                                 'friendships/show',
+                                 'groups/list_groups');
 
         $fullname = "$this->api_action/$this->api_method";
 
index 634388fdddbdf41acae10d679719d45148c5d869..cdd09282991fab1cabdd3bb2e22ee6018ce04fad 100644 (file)
@@ -122,7 +122,7 @@ class EmailsettingsAction extends AccountSettingsAction
         }
         $this->elementEnd('fieldset');
 
-       if ($user->email) {
+       if (common_config('emailpost', 'enabled') && $user->email) {
             $this->elementStart('fieldset', array('id' => 'settings_email_incoming'));
             $this->element('legend',_('Incoming email'));
             if ($user->incomingemail) {
@@ -173,11 +173,13 @@ class EmailsettingsAction extends AccountSettingsAction
                         _('Allow friends to nudge me and send me an email.'),
                         $user->emailnotifynudge);
         $this->elementEnd('li');
-        $this->elementStart('li');
-        $this->checkbox('emailpost',
-                        _('I want to post notices by email.'),
-                        $user->emailpost);
-        $this->elementEnd('li');
+        if (common_config('emailpost', 'enabled')) {
+            $this->elementStart('li');
+            $this->checkbox('emailpost',
+                            _('I want to post notices by email.'),
+                            $user->emailpost);
+            $this->elementEnd('li');
+        }
         $this->elementStart('li');
         $this->checkbox('emailmicroid',
                         _('Publish a MicroID for my email address.'),
index c439a9a62b5cc34d7b37ec7533f230b31e7b00e7..5dc09e5e8a9714e43a24d45e80209162c7add23e 100644 (file)
@@ -111,8 +111,8 @@ class FavoritesrssAction extends Rss10Action
                    'link' => common_local_url('showfavorites',
                                         array('nickname' =>
                                         $user->nickname)),
-                   'description' => sprintf(_('Feed of favorite notices of %s'), 
-                                        $user->nickname));
+                   'description' => sprintf(_('Updates favored by %1$s on %2$s!'),
+                                        $user->nickname, common_config('site', 'name')));
         return $c;
     }
 
index 2bdcaafb27a56e17ea1bd556741e34ba70880599..e1e2d201854ff166229a172118ccd788323f2fc8 100644 (file)
@@ -132,9 +132,10 @@ class groupRssAction extends Rss10Action
         $c = array('url' => common_local_url('grouprss',
                                              array('nickname' =>
                                                    $group->nickname)),
-                   'title' => $group->nickname,
+                   'title' => sprintf(_('%s timeline'), $group->nickname),
                    'link' => common_local_url('showgroup', array('nickname' => $group->nickname)),
-                   'description' => sprintf(_('Microblog by %s group'), $group->nickname));
+                   'description' => sprintf(_('Updates from members of %1$s on %2$s!'),
+                                            $group->nickname, common_config('site', 'name')));
         return $c;
     }
 
index e0f5ede3a7520c1069a9906c229c12416730603c..70a6f37d4f78e0fc4f207b15eb7617c3323fb2ad 100644 (file)
@@ -84,6 +84,12 @@ class ImsettingsAction extends ConnectSettingsAction
 
     function showContent()
     {
+        if (!common_config('xmpp', 'enabled')) {
+            $this->element('div', array('class' => 'error'),
+                           _('IM is not available.'));
+            return;
+        }
+
         $user = common_current_user();
         $this->elementStart('form', array('method' => 'post',
                                           'id' => 'form_settings_im',
index 2a4b2060d3fa3f2d3781d429f27cbd5a372ce9a3..045531c5ac722a2031415679a33ac49fc20cc406 100644 (file)
@@ -86,9 +86,10 @@ class NoticesearchrssAction extends Rss10Action
     {
         $q = $this->trimmed('q');
         $c = array('url' => common_local_url('noticesearchrss', array('q' => $q)),
-                   'title' => common_config('site', 'name') . sprintf(_(' Search Stream for "%s"'), $q),
+                   'title' => sprintf(_('Updates with "%s"'), $q),
                    'link' => common_local_url('noticesearch', array('q' => $q)),
-                   'description' => sprintf(_('All updates matching search term "%s"'), $q));
+                   'description' => sprintf(_('Updates matching search term "%1$s" on %2$s!'),
+                                            $q, common_config('site', 'name')));
         return $c;
     }
 
index 7e8df9625113345e521b7083b68176b469c51e59..5c08de641dbdb06696723fff221019837841b440 100644 (file)
@@ -86,9 +86,9 @@ class PublicrssAction extends Rss10Action
     {
         $c = array(
               'url' => common_local_url('publicrss')
-            , 'title' => sprintf(_('%s Public Stream'), common_config('site', 'name'))
+            , 'title' => sprintf(_('%s public timeline'), common_config('site', 'name'))
             , 'link' => common_local_url('public')
-            , 'description' => sprintf(_('All updates for %s'), common_config('site', 'name')));
+            , 'description' => sprintf(_('%s updates from everyone!'), common_config('site', 'name')));
         return $c;
     }
 
index a87e2870dc090c3bae2f23cc7aac1b128b9e0287..580bb91f7c889a0fba1789fb87214477e20de3ab 100644 (file)
@@ -68,7 +68,8 @@ class RepliesrssAction extends Rss10Action
                    'link' => common_local_url('replies',
                                               array('nickname' =>
                                                     $user->nickname)),
-                   'description' => sprintf(_('Feed for replies to %s'), $user->nickname));
+                   'description' => sprintf(_('Replies to %1$s on %2$s!'),
+                                              $user->nickname, common_config('site', 'name')));
         return $c;
     }
 
index 8efe9d30aa461ff48fb589b4f0c310653ed9a047..8b4926f012fb9ecfeb7626dda7dd8e13562c9baf 100644 (file)
@@ -173,7 +173,7 @@ class ShowfavoritesAction extends OwnerDesignAction
             }
         }
         else {
-            $message = sprintf(_('%s hasn\'t added any notices to his favorites yet. Why not [register an account](%%%%action.register%%%%) and then post something interesting they would add to thier favorites :)'), $this->user->nickname);
+            $message = sprintf(_('%s hasn\'t added any notices to his favorites yet. Why not [register an account](%%%%action.register%%%%) and then post something interesting they would add to their favorites :)'), $this->user->nickname);
         }
 
         $this->elementStart('div', 'guide');
index 8f73dc824af6d6180fab885c571b7c265d8ebf0e..4b179bc72b3eb94b9422a9ae1e135c1fde508b46 100644 (file)
@@ -97,8 +97,8 @@ class ShownoticeAction extends OwnerDesignAction
 
         $this->user = User::staticGet('id', $this->profile->id);
 
-        if (empty($this->user)) {
-            $this->serverError(_('Not a local notice'), 500);
+        if (! $this->notice->is_local) {
+            common_redirect($this->notice->uri);
             return false;
         }
 
index 922bab9a4e3bc2ccec5bd15ad9df102d19e376ff..33b54abf6a531de6c35f84bb2c1062ceace6af8b 100644 (file)
@@ -80,6 +80,12 @@ class SmssettingsAction extends ConnectSettingsAction
 
     function showContent()
     {
+        if (!common_config('sms', 'enabled')) {
+            $this->element('div', array('class' => 'error'),
+                           _('SMS is not available.'));
+            return;
+        }
+
         $user = common_current_user();
 
         $this->elementStart('form', array('method' => 'post',
index 42bdae10f78c160846de3f97d364bddfa88f390a..0724471ff6c946dd81d9eda5cd271f8401b7d7cc 100644 (file)
@@ -174,14 +174,26 @@ class SubscriptionsListItem extends SubscriptionListItem
             return;
         }
 
+        if (!common_config('xmpp', 'enabled') && !common_config('sms', 'enabled')) {
+            return;
+        }
+
         $this->out->elementStart('form', array('id' => 'subedit-' . $this->profile->id,
                                           'method' => 'post',
                                           'class' => 'form_subscription_edit',
                                           'action' => common_local_url('subedit')));
         $this->out->hidden('token', common_session_token());
         $this->out->hidden('profile', $this->profile->id);
-        $this->out->checkbox('jabber', _('Jabber'), $sub->jabber);
-        $this->out->checkbox('sms', _('SMS'), $sub->sms);
+        if (common_config('xmpp', 'enabled')) {
+            $this->out->checkbox('jabber', _('Jabber'), $sub->jabber);
+        } else {
+            $this->out->hidden('jabber', $sub->jabber);
+        }
+        if (common_config('sms', 'enabled')) {
+            $this->out->checkbox('sms', _('SMS'), $sub->sms);
+        } else {
+            $this->out->hidden('sms', $sub->sms);
+        }
         $this->out->submit('save', _('Save'));
         $this->out->elementEnd('form');
         return;
index f69374fcac9d932e4a1394020422d2fba39f4301..c3c03b9cd8662f46ebe86b6bd25507c5816ff591 100644 (file)
@@ -61,7 +61,8 @@ class TagrssAction extends Rss10Action
         $c = array('url' => common_local_url('tagrss', array('tag' => $tagname)),
                'title' => $tagname,
                'link' => common_local_url('tagrss', array('tag' => $tagname)),
-               'description' => sprintf(_('Microblog tagged with %s'), $tagname));
+               'description' => sprintf(_('Updates tagged with %1$s on %2$s!'),
+                                        $tagname, common_config('site', 'name')));
         return $c;
     }
 
index 82604ebff2b90a44a6fb6fbdfb55a1187b0e947b..bebc07fa19df40589269b10d2be43739a2dfb549 100644 (file)
@@ -51,6 +51,103 @@ require_once INSTALLDIR.'/lib/twitterapi.php';
  class TwitapigroupsAction extends TwitterapiAction
  {
 
+     function list_groups($args, $apidata)
+     {
+         parent::handle($args);
+         
+         common_debug("in groups api action");
+         
+         $this->auth_user = $apidata['user'];
+         $user = $this->get_user($apidata['api_arg'], $apidata);
+
+         if (empty($user)) {
+             $this->clientError('Not Found', 404, $apidata['content-type']);
+             return;
+         }
+
+         $page     = (int)$this->arg('page', 1);
+         $count    = (int)$this->arg('count', 20);
+         $max_id   = (int)$this->arg('max_id', 0);
+         $since_id = (int)$this->arg('since_id', 0);
+         $since    = $this->arg('since');
+         $group = $user->getGroups(($page-1)*$count,
+             $count, $since_id, $max_id, $since);
+
+         $sitename   = common_config('site', 'name');
+         $title      = sprintf(_("%s's groups"), $user->nickname);
+         $taguribase = common_config('integration', 'taguri');
+         $id         = "tag:$taguribase:Groups";
+         $link       = common_root_url();
+         $subtitle   = sprintf(_("groups %s is a member of on %s"), $user->nickname, $sitename);
+
+         switch($apidata['content-type']) {
+         case 'xml':
+             $this->show_xml_groups($group);
+             break;
+         case 'rss':
+             $this->show_rss_groups($group, $title, $link, $subtitle);
+             break;
+         case 'atom':
+             $selfuri = common_root_url() . 'api/laconica/groups/list/' . $user->id . '.atom';
+             $this->show_atom_groups($group, $title, $id, $link,
+                 $subtitle, $selfuri);
+             break;
+         case 'json':
+             $this->show_json_groups($group);
+             break;
+         default:
+             $this->clientError(_('API method not found!'), $code = 404);
+             break;
+         }
+     }
+
+     function list_all($args, $apidata)
+     {
+         parent::handle($args);
+         
+         common_debug("in groups api action");
+         
+         $page     = (int)$this->arg('page', 1);
+         $count    = (int)$this->arg('count', 20);
+         $max_id   = (int)$this->arg('max_id', 0);
+         $since_id = (int)$this->arg('since_id', 0);
+         $since    = $this->arg('since');
+
+         /*     TODO:
+         Use the $page, $count, $max_id, $since_id, and $since parameters
+         */
+         $group = new User_group();
+         $group->orderBy('created DESC');
+         $group->find();
+
+         $sitename   = common_config('site', 'name');
+         $title      = sprintf(_("%s groups"), $sitename);
+         $taguribase = common_config('integration', 'taguri');
+         $id         = "tag:$taguribase:Groups";
+         $link       = common_root_url();
+         $subtitle   = sprintf(_("groups on %s"), $sitename);
+
+         switch($apidata['content-type']) {
+         case 'xml':
+             $this->show_xml_groups($group);
+             break;
+         case 'rss':
+             $this->show_rss_groups($group, $title, $link, $subtitle);
+             break;
+         case 'atom':
+             $selfuri = common_root_url() . 'api/laconica/groups/list_all.atom';
+             $this->show_atom_groups($group, $title, $id, $link,
+                 $subtitle, $selfuri);
+             break;
+         case 'json':
+             $this->show_json_groups($group);
+             break;
+         default:
+             $this->clientError(_('API method not found!'), $code = 404);
+             break;
+         }
+     }
+
      function show($args, $apidata)
      {
          parent::handle($args);
index 7fffa0af018b8b5909d26fa51651f6701afc3382..0859ab9d34ef55c8b45bc9ad71f0e257f6aeb154 100644 (file)
@@ -82,6 +82,12 @@ class TwittersettingsAction extends ConnectSettingsAction
 
     function showContent()
     {
+        if (!common_config('twitter', 'enabled')) {
+            $this->element('div', array('class' => 'error'),
+                           _('Twitter is not available.'));
+            return;
+        }
+
         $user = common_current_user();
 
         $profile = $user->getProfile();
index 8a940865f947f872e562faad8deb0bc2cb7d5fac..a9f3fd5f89e4103d69bb38d0f4f44894fec67ae9 100644 (file)
@@ -88,9 +88,10 @@ class UserrssAction extends Rss10Action
         $c = array('url' => common_local_url('userrss',
                                              array('nickname' =>
                                                    $user->nickname)),
-                   'title' => $user->nickname,
+                   'title' => sprintf(_('%s timeline'), $user->nickname),
                    'link' => $profile->profileurl,
-                   'description' => sprintf(_('Microblog by %s'), $user->nickname));
+                   'description' => sprintf(_('Updates from %1$s on %2$s!'),
+                                            $user->nickname, common_config('site', 'name')));
         return $c;
     }
 
index b1ab1c2d313c6537f4fc0db0f01a16b51dfc6c24..ea19cbb97acff0b2a752ebc1793d02e81a94903b 100644 (file)
@@ -297,4 +297,45 @@ class User_group extends Memcached_DataObject
 
         return $ids;
     }
+
+    function asAtomEntry($namespace=false, $source=false)
+    {
+        $xs = new XMLStringer(true);
+
+        if ($namespace) {
+            $attrs = array('xmlns' => 'http://www.w3.org/2005/Atom',
+                           'xmlns:thr' => 'http://purl.org/syndication/thread/1.0');
+        } else {
+            $attrs = array();
+        }
+
+        $xs->elementStart('entry', $attrs);
+
+        if ($source) {
+            $xs->elementStart('source');
+            $xs->element('title', null, $profile->nickname . " - " . common_config('site', 'name'));
+            $xs->element('link', array('href' => $this->permalink()));
+        }
+
+        if ($source) {
+            $xs->elementEnd('source');
+        }
+
+        $xs->element('title', null, $this->nickname);
+        $xs->element('summary', null, $this->description);
+
+        $xs->element('link', array('rel' => 'alternate',
+                                   'href' => $this->permalink()));
+
+        $xs->element('id', null, $this->permalink());
+
+        $xs->element('published', null, common_date_w3dtf($this->created));
+        $xs->element('updated', null, common_date_w3dtf($this->modified));
+
+        $xs->element('content', array('type' => 'html'), $this->description);
+
+        $xs->elementEnd('entry');
+
+        return $xs->getString();
+    }
 }
index 8efa6a6a124f5e96937ad591d5895d73570dd721..c2dcf85169dc71541452646bd430f27ba59d3520 100644 (file)
@@ -164,6 +164,15 @@ $config['sphinx']['port'] = 3312;
 // $config['memcached']['server'] = 'localhost';
 // $config['memcached']['port'] = 11211;
 
+// Disable post-by-email
+// $config['emailpost']['enabled'] = false;
+
+// Disable SMS
+// $config['sms']['enabled'] = false;
+
+// Disable Twitter integration
+// $config['twitter']['enabled'] = false;
+
 // Twitter integration source attribute. Note: default is Laconica
 // $config['integration']['source'] = 'Laconica';
 
index ff08191596655ab8e1bef3c20d7be7380bf9f3f4..e667798eb2ee30ad664d2bda1d0009b79aa6f643 100644 (file)
@@ -17,7 +17,7 @@ alter table user_group
 
 create table file (
     id integer primary key auto_increment,
-    url varchar(255) comment 'destination URL after following redirections',
+    url varchar(2047) comment 'destination URL after following redirections',
     mimetype varchar(50) comment 'mime type of resource',
     size integer comment 'size of resource when available',
     title varchar(255) comment 'title of resource when available',
index 0a7171ae5687c22695ae419e2ce5bded2e3d5d50..e1cb92c7fc802e90cf0ff0875ba86f379bbd607f 100644 (file)
@@ -36,7 +36,7 @@ alter table user_group
 create sequence file_seq;
 create table file (
     id bigint default nextval('file_seq') primary key /* comment 'unique identifier' */,
-    url varchar(255) unique, 
+    url varchar(2047) unique,
     mimetype varchar(50), 
     size integer, 
     title varchar(255), 
index 2c04f680a85d587a032cd06fada5c63c8488eaa5..c1b76d1fa7757f34396bf298cbaed4fb818f24be 100644 (file)
@@ -433,7 +433,7 @@ create table group_inbox (
 create table file (
 
     id integer primary key auto_increment,
-    url varchar(255) comment 'destination URL after following redirections',
+    url varchar(2047) comment 'destination URL after following redirections',
     mimetype varchar(50) comment 'mime type of resource',
     size integer comment 'size of resource when available',
     title varchar(255) comment 'title of resource when available',
index ad34720a23357e405c99a7ff433303385d4df041..4fe2233805e14eebcccaf9df9b983a8f394f54bd 100644 (file)
@@ -450,7 +450,7 @@ create index group_inbox_created_idx on group_inbox using btree(created);
 create sequence file_seq;
 create table file (
     id bigint default nextval('file_seq') primary key /* comment 'unique identifier' */,
-    url varchar(255) unique, 
+    url varchar(2047) unique, 
     mimetype varchar(50), 
     size integer, 
     title varchar(255), 
index 1beb49786d85a3d195f67385fdc6f599c63069d2..1a3064318fa7f6ce42dbd8814e08617a01505ea7 100644 (file)
@@ -44,24 +44,24 @@ You can use the following commands with %%site.name%%.
 * on - turn on notifications
 * off - turn off notifications
 * help - show this help
-* follow <nickname> - subscribe to user
-* leave <nickname> - unsubscribe from user
-* d <nickname> <text> - direct message to user
-* get <nickname> - get last notice from user
-* whois <nickname> - get profile info on user
-* fav <nickname> - add user's last notice as a 'fave'
+* follow &lt;nickname&gt; - subscribe to user
+* leave &lt;nickname&gt; - unsubscribe from user
+* d &lt;nickname&gt; &lt;text&gt; - direct message to user
+* get &lt;nickname&gt; - get last notice from user
+* whois &lt;nickname&gt; - get profile info on user
+* fav &lt;nickname&gt; - add user's last notice as a 'fave'
 * stats - get your stats
 * stop - same as 'off'
 * quit - same as 'off'
-* sub <nickname> - same as 'follow'
-* unsub <nickname> - same as 'leave'
-* last <nickname> - same as 'get'
-* on <nickname> - not yet implemented.
-* off <nickname> - not yet implemented.
-* nudge <nickname> - not yet implemented.
-* invite <phone number> - not yet implemented.
-* track <word> - not yet implemented.
-* untrack <word> - not yet implemented.
+* sub &lt;nickname&gt; - same as 'follow'
+* unsub &lt;nickname&gt; - same as 'leave'
+* last &lt;nickname&gt; - same as 'get'
+* on &lt;nickname&gt; - not yet implemented.
+* off &lt;nickname&gt; - not yet implemented.
+* nudge &lt;nickname&gt; - not yet implemented.
+* invite &lt;phone number&gt; - not yet implemented.
+* track &lt;word&gt; - not yet implemented.
+* untrack &lt;word&gt; - not yet implemented.
 * track off - not yet implemented.
 * untrack all - not yet implemented.
 * tracks - not yet implemented.
index 5f13064dabe8b070547d147c537c243821c92f98..2e74d38fb0ac29d46e01ab115727e93100680f0e 100644 (file)
--- a/index.php
+++ b/index.php
@@ -73,7 +73,7 @@ function handleError($error)
     exit(-1);
 }
 
-function checkMirror($action_obj)
+function checkMirror($action_obj, $args)
 {
     global $config;
 
@@ -198,7 +198,7 @@ function main()
     } else {
         $action_obj = new $action_class();
 
-        checkMirror($action_obj);
+        checkMirror($action_obj, $args);
 
         try {
             if ($action_obj->prepare($args)) {
index ea2135651876f0b370ef107a473540b1515cc3e2..f02a0666387518794b51588bca06319ca1494933 100644 (file)
@@ -180,6 +180,9 @@ function handlePost()
     $password = $_POST['password'];
     $sitename = $_POST['sitename'];
     $fancy    = !empty($_POST['fancy']);
+    $server = $_SERVER['HTTP_HOST'];
+    $path = substr(dirname($_SERVER['PHP_SELF']), 1);
+    
 ?>
     <dl class="system_notice">
         <dt>Page notice</dt>
@@ -219,20 +222,42 @@ function handlePost()
     }
     
     switch($dbtype) {
-      case 'mysql':    mysql_db_installer($host, $database, $username, $password, $sitename, $fancy);
-      break;
-      case 'pgsql':    pgsql_db_installer($host, $database, $username, $password, $sitename, $fancy);
-      break;
-      default:
+        case 'mysql':
+            $db = mysql_db_installer($host, $database, $username, $password);
+            break;
+        case 'pgsql':
+            $db = pgsql_db_installer($host, $database, $username, $password);
+            break;
+        default:
+    }
+    
+    if (!$db) {
+        // database connection failed, do not move on to create config file.
+        return false;
+    }
+    
+    updateStatus("Writing config file...");
+    $res = writeConf($sitename, $server, $path, $fancy, $db);
+    
+    if (!$res) {
+        updateStatus("Can't write config file.", true);
+        showForm();
+        return;
     }
-    if ($path) $path .= '/';
-    updateStatus("You can visit your <a href='/$path'>new Laconica site</a>.");
+    
+    /*
+        TODO https needs to be considered
+    */
+    $link = "http://".$server.'/'.$path;
+    
+    updateStatus("Laconica has been installed at $link");
+    updateStatus("You can visit your <a href='$link'>new Laconica site</a>.");
 ?>
 
 <?php
 }
 
-function pgsql_db_installer($host, $database, $username, $password, $sitename, $fancy) {
+function pgsql_db_installer($host, $database, $username, $password) {
   $connstring = "dbname=$database host=$host user=$username";
 
   //No password would mean trust authentication used.
@@ -265,7 +290,7 @@ function pgsql_db_installer($host, $database, $username, $password, $sitename, $
   if ($res === false) {
       updateStatus("Can't run database script.", true);
       showForm();
-      return;
+      return false;
   }
   foreach (array('sms_carrier' => 'SMS carrier',
                 'notice_source' => 'notice source',
@@ -276,29 +301,24 @@ function pgsql_db_installer($host, $database, $username, $password, $sitename, $
       if ($res === false) {
           updateStatus(sprintf("Can't run %d script.", $name), true);
           showForm();
-          return;
+          return false;
       }
   }
   pg_query($conn, 'COMMIT');
 
-  updateStatus("Writing config file...");
   if (empty($password)) {
     $sqlUrl = "pgsql://$username@$host/$database";
   }
   else {
     $sqlUrl = "pgsql://$username:$password@$host/$database";
   }
-  $res = writeConf($sitename, $sqlUrl, $fancy, 'pgsql');
-  if (!$res) {
-      updateStatus("Can't write config file.", true);
-      showForm();
-      return;
-  }
-  updateStatus("Done!");
-      
+  
+  $db = array('type' => 'pgsql', 'database' => $sqlUrl);
+  
+  return $db;
 }
 
-function mysql_db_installer($host, $database, $username, $password, $sitename, $fancy) {
+function mysql_db_installer($host, $database, $username, $password) {
   updateStatus("Starting installation...");
   updateStatus("Checking database...");
 
@@ -306,21 +326,21 @@ function mysql_db_installer($host, $database, $username, $password, $sitename, $
   if (!$conn) {
       updateStatus("Can't connect to server '$host' as '$username'.", true);
       showForm();
-      return;
+      return false;
   }
   updateStatus("Changing to database...");
   $res = mysql_select_db($database, $conn);
   if (!$res) {
       updateStatus("Can't change to database.", true);
       showForm();
-      return;
+      return false;
   }
   updateStatus("Running database script...");
   $res = runDbScript(INSTALLDIR.'/db/laconica.sql', $conn);
   if ($res === false) {
       updateStatus("Can't run database script.", true);
       showForm();
-      return;
+      return false;
   }
   foreach (array('sms_carrier' => 'SMS carrier',
                 'notice_source' => 'notice source',
@@ -331,35 +351,44 @@ function mysql_db_installer($host, $database, $username, $password, $sitename, $
       if ($res === false) {
           updateStatus(sprintf("Can't run %d script.", $name), true);
           showForm();
-          return;
+          return false;
       }
   }
       
-      updateStatus("Writing config file...");
       $sqlUrl = "mysqli://$username:$password@$host/$database";
-      $res = writeConf($sitename, $sqlUrl, $fancy);
-      if (!$res) {
-          updateStatus("Can't write config file.", true);
-          showForm();
-          return;
-      }
-      updateStatus("Done!");
-    }
-function writeConf($sitename, $sqlUrl, $fancy, $type='mysql')
+      $db = array('type' => 'mysql', 'database' => $sqlUrl);
+      return $db;
+}
+
+function writeConf($sitename, $server, $path, $fancy, $db)
 {
-    $res = file_put_contents(INSTALLDIR.'/config.php',
-                             "<?php\n".
-                             "if (!defined('LACONICA')) { exit(1); }\n\n".
-                             "\$config['site']['name'] = \"$sitename\";\n\n".
-                             ($fancy ? "\$config['site']['fancy'] = true;\n\n":'').
-                             "\$config['db']['database'] = \"$sqlUrl\";\n\n".
-                             ($type == 'pgsql' ? "\$config['db']['quote_identifiers'] = true;\n\n" .
-                             "\$config['db']['type'] = \"$type\";\n\n" : '').
-                             "?>");
+    // assemble configuration file in a string
+    $cfg =  "<?php\n".
+            "if (!defined('LACONICA')) { exit(1); }\n\n".
+            
+            // site name
+            "\$config['site']['name'] = '$sitename';\n\n".
+            
+            // site location
+            "\$config['site']['server'] = '$server';\n".
+            "\$config['site']['path'] = '$path'; \n\n".
+            
+            // checks if fancy URLs are enabled
+            ($fancy ? "\$config['site']['fancy'] = true;\n\n":'').
+            
+            // database
+            "\$config['db']['database'] = '{$db['database']}';\n\n".
+            ($type == 'pgsql' ? "\$config['db']['quote_identifiers'] = true;\n\n":'').
+            "\$config['db']['type'] = '{$db['type']}';\n\n".
+            
+            "?>";
+    // write configuration file out to install directory
+    $res = file_put_contents(INSTALLDIR.'/config.php', $cfg);
+
     return $res;
 }
 
-function runDbScript($filename, $conn, $type='mysql')
+function runDbScript($filename, $conn, $type = 'mysql')
 {
     $sql = trim(file_get_contents($filename));
     $stmts = explode(';', $sql);
@@ -368,10 +397,15 @@ function runDbScript($filename, $conn, $type='mysql')
         if (!mb_strlen($stmt)) {
             continue;
         }
-        if ($type == 'mysql') {
-          $res = mysql_query($stmt, $conn);
-        } elseif ($type=='pgsql') {
-          $res = pg_query($conn, $stmt);
+        switch ($type) {
+        case 'mysql':
+            $res = mysql_query($stmt, $conn);
+            break;
+        case 'pgsql':
+            $res = pg_query($conn, $stmt);
+            break;
+        default:
+            updateStatus("runDbScript() error: unknown database type ". $type ." provided.");
         }
         if ($res === false) {
             updateStatus("FAILED SQL: $stmt");
index ef147bef4a79ac241da814b53ec62bd2abb6a738..440701937ae63cc2645e38ad56db2b1e96d8cc53 100644 (file)
  */
 
 $(document).ready(function(){
+       var counterBlackout = false;
+       
        // count character on keyup
        function counter(event){
                var maxLength = 140;
                var currentLength = $("#notice_data-text").val().length;
                var remaining = maxLength - currentLength;
                var counter = $("#notice_text-count");
-               counter.text(remaining);
+               
+               if (remaining.toString() != counter.text()) {
+                   if (!counterBlackout || remaining == 0) {
+                        if (counter.text() != String(remaining)) {
+                            counter.text(remaining);
+                       }
 
-               if (remaining < 0) {
-                       $("#form_notice").addClass("warning");
-               } else {
-                       $("#form_notice").removeClass("warning");
-               }
+                        if (remaining < 0) {
+                            $("#form_notice").addClass("warning");
+                        } else {
+                            $("#form_notice").removeClass("warning");
+                        }
+                        // Skip updates for the next 500ms.
+                        // On slower hardware, updating on every keypress is unpleasant.
+                        if (!counterBlackout) {
+                            counterBlackout = true;
+                            window.setTimeout(clearCounterBlackout, 500);
+                        }
+                    }
+                }
+       }
+       
+       function clearCounterBlackout() {
+               // Allow keyup events to poke the counter again
+               counterBlackout = false;
+               // Check if the string changed since we last looked
+               counter(null);
        }
 
        function submitonreturn(event) {
@@ -255,10 +277,10 @@ function NoticeReply() {
 function NoticeReplySet(nick,id) {
        rgx_username = /^[0-9a-zA-Z\-_.]*$/;
        if (nick.match(rgx_username)) {
-               replyto = "@" + nick + " ";
                var text = $("#notice_data-text");
                if (text.length) {
-                       text.val(replyto + text.val());
+                       replyto = "@" + nick + " ";
+                       text.val(replyto + text.val().replace(RegExp(replyto, 'i'), ''));
                        $("#form_notice input#notice_in-reply-to").val(id);
                        if (text.get(0).setSelectionRange) {
                                var len = text.val().length;
index 1c6170693f46deaed714764aa70596c462e44b2b..326edf3a00122a8fa7cad6bb3b3f49e8b4217775 100644 (file)
@@ -402,6 +402,14 @@ class Action extends HTMLOutputter // lawsuit
     function showPrimaryNav()
     {
         $user = common_current_user();
+        $connect = '';
+        if (common_config('xmpp', 'enabled')) {
+            $connect = 'imsettings';
+        } else if (common_config('sms', 'enabled')) {
+            $connect = 'smssettings';
+        } else if (common_config('twitter', 'enabled')) {
+            $connect = 'twittersettings';
+        }
 
         $this->elementStart('dl', array('id' => 'site_nav_global_primary'));
         $this->element('dt', null, _('Primary site navigation'));
@@ -413,12 +421,9 @@ class Action extends HTMLOutputter // lawsuit
                                 _('Home'), _('Personal profile and friends timeline'), false, 'nav_home');
                 $this->menuItem(common_local_url('profilesettings'),
                                 _('Account'), _('Change your email, avatar, password, profile'), false, 'nav_account');
-                if (common_config('xmpp', 'enabled')) {
-                    $this->menuItem(common_local_url('imsettings'),
-                                    _('Connect'), _('Connect to IM, SMS, Twitter'), false, 'nav_connect');
-                } else {
-                    $this->menuItem(common_local_url('smssettings'),
-                                    _('Connect'), _('Connect to SMS, Twitter'), false, 'nav_connect');
+                if ($connect) {
+                    $this->menuItem(common_local_url($connect),
+                                    _('Connect'), _('Connect to services'), false, 'nav_connect');
                 }
                 if (common_config('invite', 'enabled')) {
                     $this->menuItem(common_local_url('invite'),
index becd250b061d1c5d9a5657cacb3729a455bb214a..645ae8c3442c5f2aa58b5ddaba0d1f80a79072a8 100644 (file)
@@ -183,6 +183,12 @@ $config =
         array('piddir' => '/var/run',
               'user' => false,
               'group' => false),
+        'emailpost' =>
+        array('enabled' => true),
+        'sms' =>
+        array('enabled' => true),
+        'twitter' =>
+        array('enabled' => true),
         'twitterbridge' =>
         array('enabled' => false),
         'integration' =>
index 30629680ecbb124cecba705c510a3e42b7c2501a..02c468a359b7f166ce012e85ef9db5d0b9f17959 100644 (file)
@@ -99,25 +99,27 @@ class ConnectSettingsNav extends Widget
     function show()
     {
         # action => array('prompt', 'title')
-        $menu =
-          array('imsettings' =>
-                array(_('IM'),
-                      _('Updates by instant messenger (IM)')),
-                'smssettings' =>
-                array(_('SMS'),
-                      _('Updates by SMS')),
-                'twittersettings' =>
-                array(_('Twitter'),
-                      _('Twitter integration options')));
+        $menu = array();
+        if (common_config('xmpp', 'enabled')) {
+            $menu['imsettings'] =
+              array(_('IM'),
+                    _('Updates by instant messenger (IM)'));
+        }
+        if (common_config('sms', 'enabled')) {
+            $menu['smssettings'] =
+              array(_('SMS'),
+                    _('Updates by SMS'));
+        }
+        if (common_config('twitter', 'enabled')) {
+            $menu['twittersettings'] =
+              array(_('Twitter'),
+                    _('Twitter integration options'));
+        }
 
         $action_name = $this->action->trimmed('action');
         $this->action->elementStart('ul', array('class' => 'nav'));
 
         foreach ($menu as $menuaction => $menudesc) {
-            if ($menuaction == 'imsettings' &&
-                !common_config('xmpp', 'enabled')) {
-                continue;
-            }
             $this->action->menuItem(common_local_url($menuaction),
                                    $menudesc[0],
                                    $menudesc[1],
index f4445b44f8d998beafc81095cfee7d7580068b21..6045971161d5e933437d5c1be6d02e61e870f802 100644 (file)
@@ -350,7 +350,7 @@ class HTMLOutputter extends XMLOutputter
     function script($src, $type='text/javascript')
     {
         $url = parse_url($src);
-        if(! ($url->scheme || $url->host || $url->query || $url->fragment))
+        if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment))
         {
             $src = common_path($src) . '?version=' . LACONICA_VERSION;
         }
@@ -370,11 +370,8 @@ class HTMLOutputter extends XMLOutputter
      */
     function cssLink($src,$theme=null,$media=null)
     {
-        if (!$theme) {
-            $theme = common_config('site', 'theme');
-        }
         $url = parse_url($src);
-        if(! ($url->scheme || $url->host || $url->query || $url->fragment))
+        if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment))
         {
             if(file_exists(theme_file($src,$theme))){
                $src = theme_path($src, $theme) . '?version=' . LACONICA_VERSION;
index 7beea9328d27649d507b4e8a753324ae836648d5..34a3d530e8d6bbd17247269f807a584a8cc00e59 100644 (file)
@@ -207,7 +207,7 @@ class ResultItem
         $replier_profile = null;
 
         if ($this->notice->reply_to) {
-            $reply = Notice::staticGet(intval($notice->reply_to));
+            $reply = Notice::staticGet(intval($this->notice->reply_to));
             if ($reply) {
                 $replier_profile = $reply->getProfile();
             }
@@ -224,7 +224,7 @@ class ResultItem
 
         $user = User::staticGet('id', $this->profile->id);
 
-        $this->iso_language_code = $this->user->language;
+        $this->iso_language_code = $user->language;
 
         $this->source = $this->getSourceLink($this->notice->source);
 
index 16c1b0f30a74ddc326f9cb7617e7b418911aa736..33d1eb7549bf19815f524b40a41ed2c0324a4de2 100644 (file)
@@ -596,32 +596,44 @@ function mail_notify_attn($user, $notice)
     $bestname = $sender->getBestName();
 
     common_init_locale($user->language);
-
+       
+       if ($notice->conversation != $notice->id) {
+               $conversationEmailText = "The full conversation can be read here:\n\n".
+                                                                "\t%5\$s\n\n ";
+               $conversationUrl           = common_local_url('conversation',
+                                 array('id' => $notice->conversation)).'#notice-'.$notice->id;
+       } else {
+               $conversationEmailText = "%5\$s";
+               $conversationUrl = null;
+       }
+       
     $subject = sprintf(_('%s sent a notice to your attention'), $bestname);
-
-    $body = sprintf(_("%1\$s just sent a notice to your attention (an '@-reply') on %2\$s.\n\n".
+       
+       $body = sprintf(_("%1\$s just sent a notice to your attention (an '@-reply') on %2\$s.\n\n".
                       "The notice is here:\n\n".
                       "\t%3\$s\n\n" .
                       "It reads:\n\n".
                       "\t%4\$s\n\n" .
+                      $conversationEmailText .
                       "You can reply back here:\n\n".
-                      "\t%5\$s\n\n" .
+                      "\t%6\$s\n\n" .
                       "The list of all @-replies for you here:\n\n" .
-                      "%6\$s\n\n" .
+                      "%7\$s\n\n" .
                       "Faithfully yours,\n" .
                       "%2\$s\n\n" .
-                      "P.S. You can turn off these email notifications here: %7\$s\n"),
-                    $bestname,
-                    common_config('site', 'name'),
+                      "P.S. You can turn off these email notifications here: %8\$s\n"),
+                    $bestname,//%1
+                    common_config('site', 'name'),//%2
                     common_local_url('shownotice',
-                                     array('notice' => $notice->id)),
-                    $notice->content,
+                                     array('notice' => $notice->id)),//%3
+                    $notice->content,//%4
+                                       $conversationUrl,//%5
                     common_local_url('newnotice',
-                                     array('replyto' => $sender->nickname)),
+                                     array('replyto' => $sender->nickname)),//%6
                     common_local_url('replies',
-                                     array('nickname' => $user->nickname)),
-                    common_local_url('emailsettings'));
-
+                                     array('nickname' => $user->nickname)),//%7
+                    common_local_url('emailsettings'));//%8
+       
     common_init_locale();
     mail_to_user($user, $subject, $body);
 }
index a8d5059ca49bb443c17c21caf93c6fe02af8e150..5429d943f14b8039977d62aa2d44d0506855305b 100644 (file)
@@ -350,11 +350,10 @@ class NoticeListItem extends Widget
 
     function showNoticeLink()
     {
-        $noticeurl = common_local_url('shownotice',
+        if($this->notice->is_local){
+            $noticeurl = common_local_url('shownotice',
                                       array('notice' => $this->notice->id));
-        // XXX: we need to figure this out better. Is this right?
-        if (strcmp($this->notice->uri, $noticeurl) != 0 &&
-            preg_match('/^http/', $this->notice->uri)) {
+        }else{
             $noticeurl = $this->notice->uri;
         }
         $this->out->elementStart('a', array('rel' => 'bookmark',
index 6651773c0d8e3c93355027e8ead89e1d8461a783..f03cfcf6db753ec5d22344f63dbe7e0324ce1d61 100644 (file)
@@ -413,6 +413,28 @@ class Router
                           'apiaction' => 'laconica'));
 
         // Groups
+        //'list' has to be handled differently, as php will not allow a method to be named 'list'
+        $m->connect('api/laconica/groups/list/:argument',
+                    array('action' => 'api',
+                          'method' => 'list_groups',
+                          'apiaction' => 'groups'));
+        foreach (array('xml', 'json', 'rss', 'atom') as $e) {
+            $m->connect('api/laconica/groups/list.' . $e,
+                    array('action' => 'api',
+                          'method' => 'list_groups.' . $e,
+                          'apiaction' => 'groups'));
+        }
+
+        $m->connect('api/laconica/groups/:method',
+                    array('action' => 'api',
+                          'apiaction' => 'statuses'),
+                    array('method' => '(list_all|)(\.(atom|rss|xml|json))?'));
+
+        $m->connect('api/statuses/:method/:argument',
+                    array('action' => 'api',
+                          'apiaction' => 'statuses'),
+                    array('method' => '(|user_timeline|friends_timeline|replies|mentions|show|destroy|friends|followers)'));
+
         $m->connect('api/laconica/groups/:method/:argument',
                     array('action' => 'api',
                           'apiaction' => 'groups'));
index 4737c5874f7babc28d6d65db87c396859d64826f..a5dc2067f85ffb389471fdb799254526cfe917af 100644 (file)
@@ -233,6 +233,24 @@ class TwitterapiAction extends Action
         return $twitter_group;
     }
 
+    function twitter_rss_group_array($group)
+    {
+        $entry = array();
+        $entry['content']=$group->description;
+        $entry['title']=$group->nickname;
+        $entry['link']=$group->permalink();
+        $entry['published']=common_date_iso8601($group->created);
+        $entry['updated']==common_date_iso8601($group->modified);
+        $taguribase = common_config('integration', 'groupuri');
+        $entry['id'] = "group:$groupuribase:$entry[link]";
+
+        $entry['description'] = $entry['content'];
+        $entry['pubDate'] = common_date_rfc2822($group->created);
+        $entry['guid'] = $entry['link'];
+
+        return $entry;
+    }
+
     function twitter_rss_entry_array($notice)
     {
         $profile = $notice->getProfile();
@@ -644,6 +662,65 @@ class TwitterapiAction extends Action
 
     }
 
+    function show_rss_groups($group, $title, $link, $subtitle)
+    {
+
+        $this->init_document('rss');
+
+        $this->elementStart('channel');
+        $this->element('title', null, $title);
+        $this->element('link', null, $link);
+        $this->element('description', null, $subtitle);
+        $this->element('language', null, 'en-us');
+        $this->element('ttl', null, '40');
+
+        if (is_array($group)) {
+            foreach ($group as $g) {
+                $twitter_group = $this->twitter_rss_group_array($g);
+                $this->show_twitter_rss_item($twitter_group);
+            }
+        } else {
+            while ($group->fetch()) {
+                $twitter_group = $this->twitter_rss_group_array($group);
+                $this->show_twitter_rss_item($twitter_group);
+            }
+        }
+
+        $this->elementEnd('channel');
+        $this->end_twitter_rss();
+    }
+
+    function show_atom_groups($group, $title, $id, $link, $subtitle=null, $selfuri=null)
+    {
+
+        $this->init_document('atom');
+
+        $this->element('title', null, $title);
+        $this->element('id', null, $id);
+        $this->element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null);
+
+        if (!is_null($selfuri)) {
+            $this->element('link', array('href' => $selfuri,
+                'rel' => 'self', 'type' => 'application/atom+xml'), null);
+        }
+
+        $this->element('updated', null, common_date_iso8601('now'));
+        $this->element('subtitle', null, $subtitle);
+
+        if (is_array($group)) {
+            foreach ($group as $g) {
+                $this->raw($g->asAtomEntry());
+            }
+        } else {
+            while ($group->fetch()) {
+                $this->raw($group->asAtomEntry());
+            }
+        }
+
+        $this->end_document('atom');
+
+    }
+
     function show_json_timeline($notice)
     {
 
@@ -668,6 +745,52 @@ class TwitterapiAction extends Action
         $this->end_document('json');
     }
 
+    function show_json_groups($group)
+    {
+
+        $this->init_document('json');
+
+        $groups = array();
+
+        if (is_array($group)) {
+            foreach ($group as $g) {
+                $twitter_group = $this->twitter_group_array($g);
+                array_push($groups, $twitter_group);
+            }
+        } else {
+            while ($group->fetch()) {
+                $twitter_group = $this->twitter_group_array($group);
+                array_push($groups, $twitter_group);
+            }
+        }
+
+        $this->show_json_objects($groups);
+
+        $this->end_document('json');
+    }
+
+    function show_xml_groups($group)
+    {
+
+        $this->init_document('xml');
+        $this->elementStart('groups', array('type' => 'array'));
+
+        if (is_array($group)) {
+            foreach ($group as $g) {
+                $twitter_group = $this->twitter_group_array($g);
+                $this->show_twitter_xml_group($twitter_group);
+            }
+        } else {
+            while ($group->fetch()) {
+                $twitter_group = $this->twitter_group_array($group);
+                $this->show_twitter_xml_group($twitter_group);
+            }
+        }
+
+        $this->elementEnd('groups');
+        $this->end_document('xml');
+    }
+
     function show_single_json_group($group)
     {
         $this->init_document('json');
index 759ed60ae9c4f6592767542e9e027c3f179970b7..e799c11e50ae14ced17c0bf9ddb3e58f2bee4cd5 100644 (file)
@@ -4,6 +4,7 @@ $(document).ready(function(){
             $('#notice_data-text').autocomplete(friends, {
                 multiple: true,
                 multipleSeparator: " ",
+                minChars: 1,
                 formatItem: function(row, i, max){
                     return '@' + row.screen_name + ' (' + row.name + ')';
                 },
@@ -16,4 +17,22 @@ $(document).ready(function(){
             });
         }
     );
+    $.getJSON($('address .url')[0].href+'/api/laconica/groups/list.json?user_id=' + current_user['id'] + '&callback=?',
+        function(groups){
+            $('#notice_data-text').autocomplete(groups, {
+                multiple: true,
+                multipleSeparator: " ",
+                minChars: 1,
+                formatItem: function(row, i, max){
+                    return '!' + row.nickname + ' (' + row.fullname + ')';
+                },
+                formatMatch: function(row, i, max){
+                    return '!' + row.nickname;
+                },
+                formatResult: function(row){
+                    return '!' + row.nickname;
+                }
+            });
+        }
+    );
 });
index 19b778c6677ac30904b11e50c10ba14eeb0bc5e3..fd16d2bf1e4fb058c901324645086a5fcf7a2299 100644 (file)
@@ -116,13 +116,13 @@ class FBConnectPlugin extends Plugin
             // but we actually do, for IE and Safari. Gar.
 
             $html = sprintf('<script type="text/javascript">
-                                window.onload = function () {
+                                $(document).ready(function () {
                                     FB_RequireFeatures(
                                         ["XFBML"],
                                             function() {
                                                 FB.init("%s", "../xd_receiver.html");
                                             }
-                                        ); }
+                                        ); });
 
                                 function goto_login() {
                                     window.location = "%s";
index 914b774cb77c4d721c1e02b4d899453546c69dcb..11e5ce45371f03a3943ba33954cbcfb4ed85f6fc 100644 (file)
@@ -43,8 +43,7 @@ API key and secret to your Laconica config.php file:
 Finally, to enable the plugin, add the following stanza to your
 config.php:
 
-    require_once(INSTALLDIR.'/plugins/FBConnect/FBConnectPlugin.php');
-    $fbc = new FBConnectPlugin();
+    addPlugin('FBConnect');
 
 To try out the plugin, fire up your browser and connect to:
 
index 9a2b8332933ea249eba30900157d9dddbfb3d7a8..f1d8d8116d0deb6f1d60ec46b56d2dba721732b9 100755 (executable)
@@ -43,8 +43,12 @@ if(common_config('twitterbridge','enabled')) {
     echo "twitterstatusfetcher.php ";
 }
 echo "ombqueuehandler.php ";
-echo "twitterqueuehandler.php ";
-echo "synctwitterfriends.php ";
+if (common_config('twitter', 'enabled')) {
+    echo "twitterqueuehandler.php ";
+    echo "synctwitterfriends.php ";
+}
 echo "facebookqueuehandler.php ";
 echo "pingqueuehandler.php ";
-echo "smsqueuehandler.php ";
+if (common_config('sms', 'enabled')) {
+    echo "smsqueuehandler.php ";
+}
index 3ef4d06383f99cba74214c5f170d5ececcbd20a9..91c257adb451fd468af1a5da305beee297580c27 100755 (executable)
@@ -385,5 +385,7 @@ class MailerDaemon
     }
 }
 
-$md = new MailerDaemon();
-$md->handle_message('php://stdin');
+if (common_config('emailpost', 'enabled')) {
+    $md = new MailerDaemon();
+    $md->handle_message('php://stdin');
+}
index 6a001f11aa7d0ea8d7bccdd97c85adaa42457f8b..de63f1577fe4abfa91c16be78b58b2a789c46bd3 100644 (file)
Binary files a/theme/base/images/icons/icon_atom.png and b/theme/base/images/icons/icon_atom.png differ
index 0ccd1ce254370ad278a4c4cc9d0484b72a564bf5..e75778a9e1434e1c3bbce79c6d1efbf77e2cf016 100644 (file)
Binary files a/theme/base/images/icons/icon_rss.png and b/theme/base/images/icons/icon_rss.png differ
index 921a6b27b4c08e835185c6c0190e7b57096f7acd..646fb0445d78dad5c14b55c6fed9ca9ec52b2a25 100644 (file)
@@ -66,7 +66,7 @@ div.notice-options input,
 .entity_nudge p,
 .form_settings input.form_action-primary,
 .form_make_admin input.submit {
-color:#002E6E;
+color:#002FA7;
 }
 
 .notice,
index 38b8692b4a2f71c8de3d6a12b715df33aada5f7c..6c7808616a0ed512a66845527ea0b18a703865f6 100644 (file)
Binary files a/theme/default/default-avatar-mini.png and b/theme/default/default-avatar-mini.png differ
index f8357d4fc296271b837b3d9911cfbc133918ef2f..08ce4e48ee5baf4d5eea4860c720db57f7b7b4dd 100644 (file)
Binary files a/theme/default/default-avatar-profile.png and b/theme/default/default-avatar-profile.png differ
index 6b63baa70ffede89af964363c384971346d9a7a6..f18994d75223ce90bb966570424a400f33e5d208 100644 (file)
Binary files a/theme/default/default-avatar-stream.png and b/theme/default/default-avatar-stream.png differ
index fdead6c4a0a23614552329ee68bb0860b0200a0c..322cbe903404e4348bc4473758f457b6e9703f5c 100644 (file)
Binary files a/theme/default/logo.png and b/theme/default/logo.png differ
index 8af5644b6726cd8b43185ce7c305e44a1fb8025e..0688db42566a199041293c9feb37f0443588637c 100644 (file)
@@ -66,7 +66,7 @@ div.notice-options input,
 .entity_nudge p,
 .form_settings input.form_action-primary,
 .form_make_admin input.submit {
-color:#002E6E;
+color:#002FA7;
 }
 
 .notice,
index 38b8692b4a2f71c8de3d6a12b715df33aada5f7c..6c7808616a0ed512a66845527ea0b18a703865f6 100644 (file)
Binary files a/theme/identica/default-avatar-mini.png and b/theme/identica/default-avatar-mini.png differ
index f8357d4fc296271b837b3d9911cfbc133918ef2f..08ce4e48ee5baf4d5eea4860c720db57f7b7b4dd 100644 (file)
Binary files a/theme/identica/default-avatar-profile.png and b/theme/identica/default-avatar-profile.png differ
index 6b63baa70ffede89af964363c384971346d9a7a6..f18994d75223ce90bb966570424a400f33e5d208 100644 (file)
Binary files a/theme/identica/default-avatar-stream.png and b/theme/identica/default-avatar-stream.png differ
index 7c68b34f61008753d12394806c3cf46f7b04effd..b32c6f951c626f044ae7a8bdb46c69ca1e416cd6 100644 (file)
Binary files a/theme/identica/logo.png and b/theme/identica/logo.png differ