From 9b9d80cd97704426e54434d8777c5c15154014ad Mon Sep 17 00:00:00 2001
From: Zach Copley
Date: Tue, 25 Aug 2009 14:52:25 -0700
Subject: [PATCH 001/187] Pluginized Twitter settings stuff
---
lib/connectsettingsaction.php | 49 +++++----
lib/router.php | 6 +-
plugins/TwitterBridge/TwitterBridgePlugin.php | 101 ++++++++++++++++++
.../TwitterBridge}/twitterauthorization.php | 0
.../TwitterBridge}/twitteroauthclient.php | 0
.../TwitterBridge}/twittersettings.php | 5 -
6 files changed, 128 insertions(+), 33 deletions(-)
create mode 100644 plugins/TwitterBridge/TwitterBridgePlugin.php
rename {actions => plugins/TwitterBridge}/twitterauthorization.php (100%)
rename {lib => plugins/TwitterBridge}/twitteroauthclient.php (100%)
rename {actions => plugins/TwitterBridge}/twittersettings.php (97%)
diff --git a/lib/connectsettingsaction.php b/lib/connectsettingsaction.php
index 02c468a359..7902931e03 100644
--- a/lib/connectsettingsaction.php
+++ b/lib/connectsettingsaction.php
@@ -98,34 +98,37 @@ class ConnectSettingsNav extends Widget
function show()
{
- # action => array('prompt', 'title')
- $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) {
- $this->action->menuItem(common_local_url($menuaction),
- $menudesc[0],
- $menudesc[1],
- $action_name === $menuaction);
+ if (Event::handle('StartConnectSettingsNav', array(&$this->action))) {
+
+ # action => array('prompt', 'title')
+ $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'));
+ }
+
+ foreach ($menu as $menuaction => $menudesc) {
+ $this->action->menuItem(common_local_url($menuaction),
+ $menudesc[0],
+ $menudesc[1],
+ $action_name === $menuaction);
+ }
+
+ Event::handle('EndConnectSettingsNav', array(&$this->action));
}
$this->action->elementEnd('ul');
}
+
}
+
+
diff --git a/lib/router.php b/lib/router.php
index 08bc0566dd..5bffdb16bf 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -86,10 +86,6 @@ class Router
$m->connect('doc/:title', array('action' => 'doc'));
- // Twitter
-
- $m->connect('twitter/authorization', array('action' => 'twitterauthorization'));
-
// facebook
$m->connect('facebook', array('action' => 'facebookhome'));
@@ -136,7 +132,7 @@ class Router
// settings
foreach (array('profile', 'avatar', 'password', 'im',
- 'email', 'sms', 'twitter', 'userdesign', 'other') as $s) {
+ 'email', 'sms', 'userdesign', 'other') as $s) {
$m->connect('settings/'.$s, array('action' => $s.'settings'));
}
diff --git a/plugins/TwitterBridge/TwitterBridgePlugin.php b/plugins/TwitterBridge/TwitterBridgePlugin.php
new file mode 100644
index 0000000000..f7daa9a222
--- /dev/null
+++ b/plugins/TwitterBridge/TwitterBridgePlugin.php
@@ -0,0 +1,101 @@
+.
+ *
+ * @category Plugin
+ * @package Laconica
+ * @author Zach Copley
+ * @copyright 2009 Control Yourself, Inc.
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://laconi.ca/
+ */
+
+if (!defined('LACONICA')) {
+ exit(1);
+}
+
+/**
+ * Plugin for sending and importing Twitter statuses
+ *
+ * This class allows users to link their Twitter accounts
+ *
+ * @category Plugin
+ * @package Laconica
+ * @author Zach Copley
+ * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link http://laconi.ca/
+ * @link http://twitter.com/
+ */
+
+class TwitterBridgePlugin extends Plugin
+{
+ /**
+ * Initializer for the plugin.
+ */
+
+ function __construct()
+ {
+ parent::__construct();
+ }
+
+ /**
+ * Add Twitter-related paths to the router table
+ *
+ * Hook for RouterInitialized event.
+ *
+ * @return boolean hook return
+ */
+
+ function onRouterInitialized(&$m)
+ {
+ $m->connect('twitter/authorization', array('action' => 'twitterauthorization'));
+ $m->connect('settings/twitter', array('action' => 'twittersettings'));
+
+ return true;
+ }
+
+ function onEndConnectSettingsNav(&$action)
+ {
+ $action_name = $action->trimmed('action');
+
+ $action->menuItem(common_local_url('twittersettings'),
+ _('Twitter'),
+ _('Twitter integration options'),
+ $action_name === 'twittersettings');
+
+ return true;
+ }
+
+ function onAutoload($cls)
+ {
+ switch ($cls)
+ {
+ case 'TwittersettingsAction':
+ case 'TwitterauthorizationAction':
+ require_once(INSTALLDIR.'/plugins/TwitterBridge/' . strtolower(mb_substr($cls, 0, -6)) . '.php');
+ return false;
+ case 'TwitterOAuthClient':
+ require_once(INSTALLDIR.'/plugins/TwitterBridge/twitteroAuthclient.php');
+ return false;
+ default:
+ return true;
+ }
+ }
+
+
+}
\ No newline at end of file
diff --git a/actions/twitterauthorization.php b/plugins/TwitterBridge/twitterauthorization.php
similarity index 100%
rename from actions/twitterauthorization.php
rename to plugins/TwitterBridge/twitterauthorization.php
diff --git a/lib/twitteroauthclient.php b/plugins/TwitterBridge/twitteroauthclient.php
similarity index 100%
rename from lib/twitteroauthclient.php
rename to plugins/TwitterBridge/twitteroauthclient.php
diff --git a/actions/twittersettings.php b/plugins/TwitterBridge/twittersettings.php
similarity index 97%
rename from actions/twittersettings.php
rename to plugins/TwitterBridge/twittersettings.php
index 0859ab9d34..a3e02e1256 100644
--- a/actions/twittersettings.php
+++ b/plugins/TwitterBridge/twittersettings.php
@@ -82,11 +82,6 @@ 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();
From 5efe588174c71979fc1970353c9a556ea441f138 Mon Sep 17 00:00:00 2001
From: Zach Copley
Date: Wed, 26 Aug 2009 00:59:06 +0000
Subject: [PATCH 002/187] Moved the rest of the Twitter stuff into the
TwitterBridge plugin
---
lib/common.php | 1 -
plugins/TwitterBridge/TwitterBridgePlugin.php | 2 +-
.../TwitterBridge/daemons}/synctwitterfriends.php | 3 ++-
.../TwitterBridge/daemons}/twitterqueuehandler.php | 7 +++----
.../TwitterBridge/daemons}/twitterstatusfetcher.php | 5 +++--
{lib => plugins/TwitterBridge}/twitter.php | 0
plugins/TwitterBridge/twitterauthorization.php | 2 ++
plugins/TwitterBridge/twittersettings.php | 4 ++--
8 files changed, 13 insertions(+), 11 deletions(-)
rename {scripts => plugins/TwitterBridge/daemons}/synctwitterfriends.php (98%)
rename {scripts => plugins/TwitterBridge/daemons}/twitterqueuehandler.php (90%)
rename {scripts => plugins/TwitterBridge/daemons}/twitterstatusfetcher.php (98%)
rename {lib => plugins/TwitterBridge}/twitter.php (100%)
diff --git a/lib/common.php b/lib/common.php
index 62cf5640d6..d23d9da7d1 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -409,7 +409,6 @@ require_once INSTALLDIR.'/lib/theme.php';
require_once INSTALLDIR.'/lib/mail.php';
require_once INSTALLDIR.'/lib/subs.php';
require_once INSTALLDIR.'/lib/Shorturl_api.php';
-require_once INSTALLDIR.'/lib/twitter.php';
require_once INSTALLDIR.'/lib/clientexception.php';
require_once INSTALLDIR.'/lib/serverexception.php';
diff --git a/plugins/TwitterBridge/TwitterBridgePlugin.php b/plugins/TwitterBridge/TwitterBridgePlugin.php
index f7daa9a222..a8de1c6644 100644
--- a/plugins/TwitterBridge/TwitterBridgePlugin.php
+++ b/plugins/TwitterBridge/TwitterBridgePlugin.php
@@ -90,7 +90,7 @@ class TwitterBridgePlugin extends Plugin
require_once(INSTALLDIR.'/plugins/TwitterBridge/' . strtolower(mb_substr($cls, 0, -6)) . '.php');
return false;
case 'TwitterOAuthClient':
- require_once(INSTALLDIR.'/plugins/TwitterBridge/twitteroAuthclient.php');
+ require_once(INSTALLDIR.'/plugins/TwitterBridge/twitteroauthclient.php');
return false;
default:
return true;
diff --git a/scripts/synctwitterfriends.php b/plugins/TwitterBridge/daemons/synctwitterfriends.php
similarity index 98%
rename from scripts/synctwitterfriends.php
rename to plugins/TwitterBridge/daemons/synctwitterfriends.php
index 2de464bccc..b7be5d043a 100755
--- a/scripts/synctwitterfriends.php
+++ b/plugins/TwitterBridge/daemons/synctwitterfriends.php
@@ -18,7 +18,7 @@
* along with this program. If not, see .
*/
-define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
+define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
$shortoptions = 'di::';
$longoptions = array('id::', 'debug');
@@ -32,6 +32,7 @@ END_OF_TRIM_HELP;
require_once INSTALLDIR . '/scripts/commandline.inc';
require_once INSTALLDIR . '/lib/parallelizingdaemon.php';
+require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
/**
* Daemon to sync local friends with Twitter friends
diff --git a/scripts/twitterqueuehandler.php b/plugins/TwitterBridge/daemons/twitterqueuehandler.php
similarity index 90%
rename from scripts/twitterqueuehandler.php
rename to plugins/TwitterBridge/daemons/twitterqueuehandler.php
index 00e735d983..9aa9d1ed0a 100755
--- a/scripts/twitterqueuehandler.php
+++ b/plugins/TwitterBridge/daemons/twitterqueuehandler.php
@@ -18,7 +18,7 @@
* along with this program. If not, see .
*/
-define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
+define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
$shortoptions = 'i::';
$longoptions = array('id::');
@@ -30,10 +30,9 @@ Daemon script for pushing new notices to Twitter.
END_OF_ENJIT_HELP;
-require_once INSTALLDIR.'/scripts/commandline.inc';
-
-require_once INSTALLDIR . '/lib/twitter.php';
+require_once INSTALLDIR . '/scripts/commandline.inc';
require_once INSTALLDIR . '/lib/queuehandler.php';
+require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
class TwitterQueueHandler extends QueueHandler
{
diff --git a/scripts/twitterstatusfetcher.php b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php
similarity index 98%
rename from scripts/twitterstatusfetcher.php
rename to plugins/TwitterBridge/daemons/twitterstatusfetcher.php
index f5289c5f4b..3023bf423b 100755
--- a/scripts/twitterstatusfetcher.php
+++ b/plugins/TwitterBridge/daemons/twitterstatusfetcher.php
@@ -18,7 +18,7 @@
* along with this program. If not, see .
*/
-define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
+define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
// Tune number of processes and how often to poll Twitter
// XXX: Should these things be in config.php?
@@ -36,8 +36,9 @@ Batch script for retrieving Twitter messages from foreign service.
END_OF_TRIM_HELP;
-require_once INSTALLDIR .'/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc';
require_once INSTALLDIR . '/lib/daemon.php';
+require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
/**
* Fetcher for statuses from Twitter
diff --git a/lib/twitter.php b/plugins/TwitterBridge/twitter.php
similarity index 100%
rename from lib/twitter.php
rename to plugins/TwitterBridge/twitter.php
diff --git a/plugins/TwitterBridge/twitterauthorization.php b/plugins/TwitterBridge/twitterauthorization.php
index b04f353278..a545284342 100644
--- a/plugins/TwitterBridge/twitterauthorization.php
+++ b/plugins/TwitterBridge/twitterauthorization.php
@@ -31,6 +31,8 @@ if (!defined('LACONICA')) {
exit(1);
}
+require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+
/**
* Class for doing OAuth authentication against Twitter
*
diff --git a/plugins/TwitterBridge/twittersettings.php b/plugins/TwitterBridge/twittersettings.php
index a3e02e1256..b3d4a971f6 100644
--- a/plugins/TwitterBridge/twittersettings.php
+++ b/plugins/TwitterBridge/twittersettings.php
@@ -31,8 +31,8 @@ if (!defined('LACONICA')) {
exit(1);
}
-require_once INSTALLDIR.'/lib/connectsettingsaction.php';
-require_once INSTALLDIR.'/lib/twitter.php';
+require_once INSTALLDIR . '/lib/connectsettingsaction.php';
+require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
/**
* Settings for Twitter integration
From c8c87fc6030cacd6591098b8f5ab69e3a824babe Mon Sep 17 00:00:00 2001
From: Brenda Wallace
Date: Mon, 31 Aug 2009 10:59:50 +1200
Subject: [PATCH 003/187] some typoes in comments that annoyed me, fixed now
---
lib/twitteroauthclient.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/twitteroauthclient.php b/lib/twitteroauthclient.php
index e37fa05f0a..bad2b74ca3 100644
--- a/lib/twitteroauthclient.php
+++ b/lib/twitteroauthclient.php
@@ -118,7 +118,7 @@ class TwitterOAuthClient extends OAuthClient
}
/**
- * Calls Twitter's /stutuses/update API method
+ * Calls Twitter's /statuses/update API method
*
* @param string $status text of the status
* @param int $in_reply_to_status_id optional id of the status it's
@@ -137,7 +137,7 @@ class TwitterOAuthClient extends OAuthClient
}
/**
- * Calls Twitter's /stutuses/friends_timeline API method
+ * Calls Twitter's /statuses/friends_timeline API method
*
* @param int $since_id show statuses after this id
* @param int $max_id show statuses before this id
@@ -167,7 +167,7 @@ class TwitterOAuthClient extends OAuthClient
}
/**
- * Calls Twitter's /stutuses/friends API method
+ * Calls Twitter's /statuses/friends API method
*
* @param int $id id of the user whom you wish to see friends of
* @param int $user_id numerical user id
@@ -197,7 +197,7 @@ class TwitterOAuthClient extends OAuthClient
}
/**
- * Calls Twitter's /stutuses/friends/ids API method
+ * Calls Twitter's /statuses/friends/ids API method
*
* @param int $id id of the user whom you wish to see friends of
* @param int $user_id numerical user id
From d46f2ee350b9bf2c70371f7bcd2f2793e7ed8110 Mon Sep 17 00:00:00 2001
From: Brenda Wallace
Date: Tue, 11 Aug 2009 09:24:18 +1200
Subject: [PATCH 004/187] upgrade script for postgres
---
db/08to09_pg.sql | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 db/08to09_pg.sql
diff --git a/db/08to09_pg.sql b/db/08to09_pg.sql
new file mode 100644
index 0000000000..892df4a39f
--- /dev/null
+++ b/db/08to09_pg.sql
@@ -0,0 +1,2 @@
+// SQL commands to update an 0.8.x version of Laconica
+// to 0.9.x.
From e9edb803bc66028204defcfa659cccbf23da97c6 Mon Sep 17 00:00:00 2001
From: Brenda Wallace
Date: Mon, 31 Aug 2009 11:53:59 +1200
Subject: [PATCH 005/187] added missing parts to postgres update, and the
config+user_role tables to both upgrade scripts
Conflicts:
db/08to09.sql
---
db/08to09.sql | 34 ++++++++++++++++++++++++++++++++++
db/08to09_pg.sql | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 72 insertions(+)
create mode 100644 db/08to09.sql
diff --git a/db/08to09.sql b/db/08to09.sql
new file mode 100644
index 0000000000..953e0e5f48
--- /dev/null
+++ b/db/08to09.sql
@@ -0,0 +1,34 @@
+alter table notice
+ modify column content text comment 'update content';
+
+alter table message
+ modify column content text comment 'message content';
+
+alter table profile
+ modify column bio text comment 'descriptive biography';
+
+alter table user_group
+ modify column description text comment 'group description';
+
+alter table file_oembed
+ add column mimetype varchar(50) comment 'mime type of resource';
+
+create table config (
+
+ section varchar(32) comment 'configuration section',
+ setting varchar(32) comment 'configuration setting',
+ value varchar(255) comment 'configuration value',
+
+ constraint primary key (section, setting)
+
+) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+
+create table user_role (
+
+ user_id integer not null comment 'user having the role' references user (id),
+ role varchar(32) not null comment 'string representing the role',
+ created datetime not null comment 'date the role was granted',
+
+ constraint primary key (user_id, role)
+
+) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
diff --git a/db/08to09_pg.sql b/db/08to09_pg.sql
index 892df4a39f..492b3ebb91 100644
--- a/db/08to09_pg.sql
+++ b/db/08to09_pg.sql
@@ -1,2 +1,40 @@
// SQL commands to update an 0.8.x version of Laconica
// to 0.9.x.
+
+--these are just comments
+/*
+alter table notice
+ modify column content text comment 'update content';
+
+alter table message
+ modify column content text comment 'message content';
+
+alter table profile
+ modify column bio text comment 'descriptive biography';
+
+alter table user_group
+ modify column description text comment 'group description';
+*/
+
+alter table file_oembed
+ add column mimetype varchar(50) /*comment 'mime type of resource'*/;
+
+create table config (
+
+ section varchar(32) /* comment 'configuration section'*/,
+ setting varchar(32) /* comment 'configuration setting'*/,
+ value varchar(255) /* comment 'configuration value'*/,
+
+ primary key (section, setting)
+
+);
+
+create table user_role (
+
+ user_id integer not null /* comment 'user having the role'*/ references "user" (id),
+ role varchar(32) not null /* comment 'string representing the role'*/,
+ created timestamp /* not null comment 'date the role was granted'*/,
+
+ primary key (user_id, role)
+
+);
\ No newline at end of file
From 6704ddddf227865de43c1fdd846b68f76f723fe6 Mon Sep 17 00:00:00 2001
From: Brenda Wallace
Date: Mon, 31 Aug 2009 11:01:01 +1200
Subject: [PATCH 006/187] fixed up some invalid comment syntax - this is ANSI
SQL
---
db/08to09_pg.sql | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/db/08to09_pg.sql b/db/08to09_pg.sql
index 492b3ebb91..9e37314aa8 100644
--- a/db/08to09_pg.sql
+++ b/db/08to09_pg.sql
@@ -1,5 +1,5 @@
-// SQL commands to update an 0.8.x version of Laconica
-// to 0.9.x.
+-- SQL commands to update an 0.8.x version of Laconica
+-- to 0.9.x.
--these are just comments
/*
@@ -37,4 +37,4 @@ create table user_role (
primary key (user_id, role)
-);
\ No newline at end of file
+);
From ddc95559215142e806428716772cb0edff206ecb Mon Sep 17 00:00:00 2001
From: Zach Copley
Date: Tue, 1 Sep 2009 19:00:18 +0000
Subject: [PATCH 007/187] Stop requeuing notices not bound for Twitter.
---
lib/twitter.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/twitter.php b/lib/twitter.php
index b734d22d8e..e049dc8df0 100644
--- a/lib/twitter.php
+++ b/lib/twitter.php
@@ -160,6 +160,8 @@ function broadcast_twitter($notice)
return broadcast_basicauth($notice, $flink);
}
}
+
+ return true;
}
function broadcast_oauth($notice, $flink) {
From 6adc50b97fb6d7b5dfd70321281f041f2f579461 Mon Sep 17 00:00:00 2001
From: Zach Copley
Date: Sat, 29 Aug 2009 06:20:19 +0000
Subject: [PATCH 008/187] Fix error in log msg format specifier
---
lib/twitter.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/twitter.php b/lib/twitter.php
index e049dc8df0..455f7e7ef0 100644
--- a/lib/twitter.php
+++ b/lib/twitter.php
@@ -196,7 +196,7 @@ function broadcast_oauth($notice, $flink) {
$errmsg = sprintf('cURL error trying to send notice to Twitter ' .
'for user %1$s (user id: %2$s) - ' .
- 'code: %3$s message: $4$s.',
+ 'code: %3$s message: %4$s.',
$user->nickname, $user->id,
$e->getCode(), $e->getMessage());
common_log(LOG_WARNING, $errmsg);
@@ -254,7 +254,7 @@ function broadcast_basicauth($notice, $flink)
$errmsg = sprintf('cURL error trying to send notice to Twitter ' .
'for user %1$s (user id: %2$s) - ' .
- 'code: %3$s message: $4$s.',
+ 'code: %3$s message: %4$s.',
$user->nickname, $user->id,
$e->getCode(), $e->getMessage());
common_log(LOG_WARNING, $errmsg);
From 78f367b23962ce1091807d7ed3eeed5f18a1475b Mon Sep 17 00:00:00 2001
From: Zach Copley
Date: Wed, 2 Sep 2009 00:24:30 +0000
Subject: [PATCH 009/187] Fixed bug in which you cannot turn off importing
friends timelines flag
---
actions/twittersettings.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/actions/twittersettings.php b/actions/twittersettings.php
index 563d867a49..89169941eb 100644
--- a/actions/twittersettings.php
+++ b/actions/twittersettings.php
@@ -165,7 +165,7 @@ class TwittersettingsAction extends ConnectSettingsAction
($flink->noticesync & FOREIGN_NOTICE_RECV) :
false);
$this->elementEnd('li');
-
+ } else {
// preserve setting even if bidrection bridge toggled off
if ($flink && ($flink->noticesync & FOREIGN_NOTICE_RECV)) {
From f049d669d95128741f9cb7b1604b758df0550360 Mon Sep 17 00:00:00 2001
From: Zach Copley
Date: Wed, 2 Sep 2009 00:50:41 +0000
Subject: [PATCH 010/187] Better error handling
---
lib/twitter.php | 100 ++++++++++++++++++++----------------------------
1 file changed, 42 insertions(+), 58 deletions(-)
diff --git a/lib/twitter.php b/lib/twitter.php
index 455f7e7ef0..676c9b20a2 100644
--- a/lib/twitter.php
+++ b/lib/twitter.php
@@ -175,34 +175,7 @@ function broadcast_oauth($notice, $flink) {
try {
$status = $client->statusesUpdate($statustxt);
} catch (OAuthClientCurlException $e) {
-
- if ($e->getMessage() == 'The requested URL returned error: 401') {
-
- $errmsg = sprintf('User %1$s (user id: %2$s) has an invalid ' .
- 'Twitter OAuth access token.',
- $user->nickname, $user->id);
- common_log(LOG_WARNING, $errmsg);
-
- // Bad auth token! We need to delete the foreign_link
- // to Twitter and inform the user.
-
- remove_twitter_link($flink);
- return true;
-
- } else {
-
- // Some other error happened, so we should probably
- // try to send again later.
-
- $errmsg = sprintf('cURL error trying to send notice to Twitter ' .
- 'for user %1$s (user id: %2$s) - ' .
- 'code: %3$s message: %4$s.',
- $user->nickname, $user->id,
- $e->getCode(), $e->getMessage());
- common_log(LOG_WARNING, $errmsg);
-
- return false;
- }
+ return process_error($e, $flink);
}
if (empty($status)) {
@@ -210,9 +183,9 @@ function broadcast_oauth($notice, $flink) {
// This could represent a failure posting,
// or the Twitter API might just be behaving flakey.
- $errmsg = sprintf('No data returned by Twitter API when ' .
- 'trying to send update for %1$s (user id %2$s).',
- $user->nickname, $user->id);
+ $errmsg = sprintf('Twitter bridge - No data returned by Twitter API when ' .
+ 'trying to send update for %1$s (user id %2$s).',
+ $user->nickname, $user->id);
common_log(LOG_WARNING, $errmsg);
return false;
@@ -220,7 +193,7 @@ function broadcast_oauth($notice, $flink) {
// Notice crossed the great divide
- $msg = sprintf('Twitter bridge posted notice %s to Twitter using OAuth.',
+ $msg = sprintf('Twitter bridge - posted notice %s to Twitter using OAuth.',
$notice->id);
common_log(LOG_INFO, $msg);
@@ -239,46 +212,57 @@ function broadcast_basicauth($notice, $flink)
try {
$status = $client->statusesUpdate($statustxt);
} catch (BasicAuthCurlException $e) {
-
- if ($e->getMessage() == 'The requested URL returned error: 401') {
-
- $errmsg = sprintf('User %1$s (user id: %2$s) has an invalid ' .
- 'Twitter screen_name/password combo.',
- $user->nickname, $user->id);
- common_log(LOG_WARNING, $errmsg);
-
- remove_twitter_link($flink);
- return true;
-
- } else {
-
- $errmsg = sprintf('cURL error trying to send notice to Twitter ' .
- 'for user %1$s (user id: %2$s) - ' .
- 'code: %3$s message: %4$s.',
- $user->nickname, $user->id,
- $e->getCode(), $e->getMessage());
- common_log(LOG_WARNING, $errmsg);
-
- return false;
- }
+ return process_error($e, $flink);
}
if (empty($status)) {
- $errmsg = sprintf('No data returned by Twitter API when ' .
- 'trying to send update for %1$s (user id %2$s).',
- $user->nickname, $user->id);
+ $errmsg = sprintf('Twitter bridge - No data returned by Twitter API when ' .
+ 'trying to send update for %1$s (user id %2$s).',
+ $user->nickname, $user->id);
common_log(LOG_WARNING, $errmsg);
return false;
}
- $msg = sprintf('Twitter bridge posted notice %s to Twitter using basic auth.',
+ $msg = sprintf('Twitter bridge - posted notice %s to Twitter using basic auth.',
$notice->id);
common_log(LOG_INFO, $msg);
return true;
+}
+function process_error($e, $flink)
+{
+ $user = $flink->getUser();
+ $errmsg = $e->getMessage();
+ $delivered = false;
+
+ switch($errmsg) {
+ case 'The requested URL returned error: 401':
+ $logmsg = sprintf('Twiter bridge - User %1$s (user id: %2$s) has an invalid ' .
+ 'Twitter screen_name/password combo or an invalid acesss token.',
+ $user->nickname, $user->id);
+ $delivered = true;
+ remove_twitter_link($flink);
+ break;
+ case 'The requested URL returned error: 403':
+ $logmsg = sprintf('Twitter bridge - User %1$s (user id: %2$s) has exceeded ' .
+ 'his/her Twitter request limit.',
+ $user->nickname, $user->id);
+ break;
+ default:
+ $logmsg = sprintf('Twitter bridge - cURL error trying to send notice to Twitter ' .
+ 'for user %1$s (user id: %2$s) - ' .
+ 'code: %3$s message: %4$s.',
+ $user->nickname, $user->id,
+ $e->getCode(), $e->getMessage());
+ break;
+ }
+
+ common_log(LOG_WARNING, $logmsg);
+
+ return $delivered;
}
function format_status($notice)
From 876f56254d3ccdcc7ba3e9c7693345cef8a6e22b Mon Sep 17 00:00:00 2001
From: Zach Copley
Date: Tue, 8 Sep 2009 16:07:01 -0700
Subject: [PATCH 011/187] Moved basic auth client into plugin dir
---
{lib => plugins/TwitterBridge}/twitterbasicauthclient.php | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {lib => plugins/TwitterBridge}/twitterbasicauthclient.php (100%)
diff --git a/lib/twitterbasicauthclient.php b/plugins/TwitterBridge/twitterbasicauthclient.php
similarity index 100%
rename from lib/twitterbasicauthclient.php
rename to plugins/TwitterBridge/twitterbasicauthclient.php
From 1710082f0459d7acc130697d14476faf01ecfa2d Mon Sep 17 00:00:00 2001
From: Zach Copley
Date: Sat, 19 Sep 2009 18:34:07 -0700
Subject: [PATCH 012/187] Make statuses/home_timeline return the same thing as
statuses/friends_timeline to support apps trying to use the new retweet API
method.
---
actions/twitapistatuses.php | 5 +++++
lib/router.php | 6 +++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php
index edee239a03..5e2867ea81 100644
--- a/actions/twitapistatuses.php
+++ b/actions/twitapistatuses.php
@@ -136,6 +136,11 @@ class TwitapistatusesAction extends TwitterapiAction
}
+ function home_timeline($args, $apidata)
+ {
+ call_user_func(array($this, 'friends_timeline'), $args, $apidata);
+ }
+
function user_timeline($args, $apidata)
{
parent::handle($args);
diff --git a/lib/router.php b/lib/router.php
index 00e728f557..5309fe7530 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -268,12 +268,12 @@ class Router
$m->connect('api/statuses/:method',
array('action' => 'api',
'apiaction' => 'statuses'),
- array('method' => '(public_timeline|friends_timeline|user_timeline|update|replies|mentions|show|friends|followers|featured)(\.(atom|rss|xml|json))?'));
+ array('method' => '(public_timeline|home_timeline|friends_timeline|user_timeline|update|replies|mentions|show|friends|followers|featured)(\.(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)'));
+ array('method' => '(user_timeline|home_timeline|friends_timeline|replies|mentions|show|destroy|friends|followers)'));
// users
@@ -432,7 +432,7 @@ class Router
$m->connect('api/statuses/:method/:argument',
array('action' => 'api',
'apiaction' => 'statuses'),
- array('method' => '(|user_timeline|friends_timeline|replies|mentions|show|destroy|friends|followers)'));
+ array('method' => '(user_timeline|home_timeline|friends_timeline|replies|mentions|show|destroy|friends|followers)'));
$m->connect('api/statusnet/groups/:method/:argument',
array('action' => 'api',
From bf3699105a010a291db283f1058df6ea064f0a56 Mon Sep 17 00:00:00 2001
From: Zach Copley
Date: Sun, 27 Sep 2009 20:21:16 -0700
Subject: [PATCH 013/187] Forgot to add home_timeline to the list of methods
that only require bareauth.
---
actions/api.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/actions/api.php b/actions/api.php
index f425a8dcd7..dc1bdbeacb 100644
--- a/actions/api.php
+++ b/actions/api.php
@@ -139,6 +139,7 @@ class ApiAction extends Action
static $bareauth = array('statuses/user_timeline',
'statuses/friends_timeline',
+ 'statuses/home_timeline',
'statuses/friends',
'statuses/replies',
'statuses/mentions',
From 120a84593e5155d1243ab47bfad604311729c698 Mon Sep 17 00:00:00 2001
From: Zach Copley
Date: Sun, 27 Sep 2009 20:21:16 -0700
Subject: [PATCH 014/187] Forgot to add home_timeline to the list of methods
that only require bareauth.
---
actions/api.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/actions/api.php b/actions/api.php
index f425a8dcd7..dc1bdbeacb 100644
--- a/actions/api.php
+++ b/actions/api.php
@@ -139,6 +139,7 @@ class ApiAction extends Action
static $bareauth = array('statuses/user_timeline',
'statuses/friends_timeline',
+ 'statuses/home_timeline',
'statuses/friends',
'statuses/replies',
'statuses/mentions',
From 92ac156cbe588f2fdf86ac8c3391e4057852ac77 Mon Sep 17 00:00:00 2001
From: Craig Andrews
Date: Fri, 28 Aug 2009 16:18:05 -0400
Subject: [PATCH 015/187] Add % and ~ as valid characters in the path,
querystring, and fragment parts of URLs
---
lib/util.php | 10 +++++-----
tests/URLDetectionTest.php | 4 ++++
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/lib/util.php b/lib/util.php
index 0b696662c1..0bb943ad86 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -421,7 +421,7 @@ function common_replace_urls_callback($text, $callback, $notice_id = null) {
'|'.
'(?:(?:mailto|aim|tel|xmpp):)'.
')'.
- '(?:[\pN\pL\-\_\+]+(?::[\pN\pL\-\_\+]+)?\@)?'. //user:pass@
+ '(?:[\pN\pL\-\_\+\%\~]+(?::[\pN\pL\-\_\+\%\~]+)?\@)?'. //user:pass@
'(?:'.
'(?:'.
'\[[\pN\pL\-\_\:\.]+(?127.0.0.1:99'),
array('127.0.0.1/test.php',
'127.0.0.1/test.php'),
+ array('127.0.0.1/~test',
+ '127.0.0.1/~test'),
+ array('127.0.0.1/test%20stuff',
+ '127.0.0.1/test%20stuff'),
array('http://[::1]:99/test.php',
'http://[::1]:99/test.php'),
array('http://::1/test.php',
From 4312ea90aa46299bfd77454e441f9ecb867fadd1 Mon Sep 17 00:00:00 2001
From: Evan Prodromou
Date: Tue, 29 Sep 2009 09:12:44 -0400
Subject: [PATCH 016/187] stop overwriting created timestamp on group edit
---
actions/editgroup.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/actions/editgroup.php b/actions/editgroup.php
index cac910e9bc..652719a33d 100644
--- a/actions/editgroup.php
+++ b/actions/editgroup.php
@@ -244,7 +244,6 @@ class EditgroupAction extends GroupDesignAction
$this->group->homepage = $homepage;
$this->group->description = $description;
$this->group->location = $location;
- $this->group->created = common_sql_now();
$result = $this->group->update($orig);
From b0ce2add41877091ba750b36387b45a476127526 Mon Sep 17 00:00:00 2001
From: Evan Prodromou
Date: Tue, 29 Sep 2009 17:43:45 -0400
Subject: [PATCH 017/187] move HTTP error code strings to class variables
---
lib/clienterroraction.php | 43 +++++++++++++++++----------------------
lib/error.php | 6 ++++--
lib/servererroraction.php | 19 +++++++----------
3 files changed, 30 insertions(+), 38 deletions(-)
diff --git a/lib/clienterroraction.php b/lib/clienterroraction.php
index 7d007a7567..1b98a10645 100644
--- a/lib/clienterroraction.php
+++ b/lib/clienterroraction.php
@@ -46,28 +46,28 @@ require_once INSTALLDIR.'/lib/error.php';
*/
class ClientErrorAction extends ErrorAction
{
+ static $status = array(400 => 'Bad Request',
+ 401 => 'Unauthorized',
+ 402 => 'Payment Required',
+ 403 => 'Forbidden',
+ 404 => 'Not Found',
+ 405 => 'Method Not Allowed',
+ 406 => 'Not Acceptable',
+ 407 => 'Proxy Authentication Required',
+ 408 => 'Request Timeout',
+ 409 => 'Conflict',
+ 410 => 'Gone',
+ 411 => 'Length Required',
+ 412 => 'Precondition Failed',
+ 413 => 'Request Entity Too Large',
+ 414 => 'Request-URI Too Long',
+ 415 => 'Unsupported Media Type',
+ 416 => 'Requested Range Not Satisfiable',
+ 417 => 'Expectation Failed');
+
function __construct($message='Error', $code=400)
{
parent::__construct($message, $code);
-
- $this->status = array(400 => 'Bad Request',
- 401 => 'Unauthorized',
- 402 => 'Payment Required',
- 403 => 'Forbidden',
- 404 => 'Not Found',
- 405 => 'Method Not Allowed',
- 406 => 'Not Acceptable',
- 407 => 'Proxy Authentication Required',
- 408 => 'Request Timeout',
- 409 => 'Conflict',
- 410 => 'Gone',
- 411 => 'Length Required',
- 412 => 'Precondition Failed',
- 413 => 'Request Entity Too Large',
- 414 => 'Request-URI Too Long',
- 415 => 'Unsupported Media Type',
- 416 => 'Requested Range Not Satisfiable',
- 417 => 'Expectation Failed');
$this->default = 400;
}
@@ -91,9 +91,4 @@ class ClientErrorAction extends ErrorAction
$this->showPage();
}
-
- function title()
- {
- return $this->status[$this->code];
- }
}
diff --git a/lib/error.php b/lib/error.php
index 0c521db081..6a9b76be11 100644
--- a/lib/error.php
+++ b/lib/error.php
@@ -44,9 +44,10 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
*/
class ErrorAction extends Action
{
+ static $status = array();
+
var $code = null;
var $message = null;
- var $status = null;
var $default = null;
function __construct($message, $code, $output='php://output', $indent=true)
@@ -88,9 +89,10 @@ class ErrorAction extends Action
*
* @return page title
*/
+
function title()
{
- return $this->message;
+ return self::$status[$this->code];
}
function isReadOnly($args)
diff --git a/lib/servererroraction.php b/lib/servererroraction.php
index c6400605ea..0993a63bca 100644
--- a/lib/servererroraction.php
+++ b/lib/servererroraction.php
@@ -55,17 +55,17 @@ require_once INSTALLDIR.'/lib/error.php';
class ServerErrorAction extends ErrorAction
{
+ static $status = array(500 => 'Internal Server Error',
+ 501 => 'Not Implemented',
+ 502 => 'Bad Gateway',
+ 503 => 'Service Unavailable',
+ 504 => 'Gateway Timeout',
+ 505 => 'HTTP Version Not Supported');
+
function __construct($message='Error', $code=500)
{
parent::__construct($message, $code);
- $this->status = array(500 => 'Internal Server Error',
- 501 => 'Not Implemented',
- 502 => 'Bad Gateway',
- 503 => 'Service Unavailable',
- 504 => 'Gateway Timeout',
- 505 => 'HTTP Version Not Supported');
-
$this->default = 500;
// Server errors must be logged.
@@ -93,9 +93,4 @@ class ServerErrorAction extends ErrorAction
$this->showPage();
}
-
- function title()
- {
- return $this->status[$this->code];
- }
}
From f46084309b72e647ee6552669a009cf5b3fbff5a Mon Sep 17 00:00:00 2001
From: Evan Prodromou
Date: Tue, 29 Sep 2009 17:57:31 -0400
Subject: [PATCH 018/187] Twitter API returns server errors in preferred format
---
actions/twitapistatuses.php | 2 +-
lib/twitterapi.php | 56 ++++++++++++++++++++++---------------
2 files changed, 34 insertions(+), 24 deletions(-)
diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php
index 5e2867ea81..41887a68f4 100644
--- a/actions/twitapistatuses.php
+++ b/actions/twitapistatuses.php
@@ -297,7 +297,7 @@ class TwitapistatusesAction extends TwitterapiAction
$source, 1, $reply_to);
if (is_string($notice)) {
- $this->serverError($notice);
+ $this->serverError($notice, 500, $apidata['content-type']);
return;
}
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index 638efba241..3bac400e2f 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.php
@@ -501,7 +501,7 @@ class TwitterapiAction extends Action
$enclosure = $entry['enclosures'][0];
$this->element('enclosure', array('url'=>$enclosure['url'],'type'=>$enclosure['mimetype'],'length'=>$enclosure['size']), null);
}
-
+
if(array_key_exists('tags', $entry)){
foreach($entry['tags'] as $tag){
$this->element('category', null,$tag);
@@ -939,35 +939,16 @@ class TwitterapiAction extends Action
function clientError($msg, $code = 400, $content_type = 'json')
{
-
- static $status = array(400 => 'Bad Request',
- 401 => 'Unauthorized',
- 402 => 'Payment Required',
- 403 => 'Forbidden',
- 404 => 'Not Found',
- 405 => 'Method Not Allowed',
- 406 => 'Not Acceptable',
- 407 => 'Proxy Authentication Required',
- 408 => 'Request Timeout',
- 409 => 'Conflict',
- 410 => 'Gone',
- 411 => 'Length Required',
- 412 => 'Precondition Failed',
- 413 => 'Request Entity Too Large',
- 414 => 'Request-URI Too Long',
- 415 => 'Unsupported Media Type',
- 416 => 'Requested Range Not Satisfiable',
- 417 => 'Expectation Failed');
-
$action = $this->trimmed('action');
common_debug("User error '$code' on '$action': $msg", __FILE__);
- if (!array_key_exists($code, $status)) {
+ if (!array_key_exists($code, ClientErrorAction::$status)) {
$code = 400;
}
- $status_string = $status[$code];
+ $status_string = ClientErrorAction::$status[$code];
+
header('HTTP/1.1 '.$code.' '.$status_string);
if ($content_type == 'xml') {
@@ -986,6 +967,35 @@ class TwitterapiAction extends Action
}
+ function serverError($msg, $code = 500, $content_type = 'json')
+ {
+ $action = $this->trimmed('action');
+
+ common_debug("Server error '$code' on '$action': $msg", __FILE__);
+
+ if (!array_key_exists($code, ServerErrorAction::$status)) {
+ $code = 400;
+ }
+
+ $status_string = ServerErrorAction::$status[$code];
+
+ header('HTTP/1.1 '.$code.' '.$status_string);
+
+ if ($content_type == 'xml') {
+ $this->init_document('xml');
+ $this->elementStart('hash');
+ $this->element('error', null, $msg);
+ $this->element('request', null, $_SERVER['REQUEST_URI']);
+ $this->elementEnd('hash');
+ $this->end_document('xml');
+ } else {
+ $this->init_document('json');
+ $error_array = array('error' => $msg, 'request' => $_SERVER['REQUEST_URI']);
+ print(json_encode($error_array));
+ $this->end_document('json');
+ }
+ }
+
function init_twitter_rss()
{
$this->startXML();
From 3727b17c39a9dba97b08f15211e3631c82162fdf Mon Sep 17 00:00:00 2001
From: Evan Prodromou
Date: Fri, 9 Oct 2009 10:39:56 -0400
Subject: [PATCH 019/187] don't write session if it's unchanged
---
classes/Session.php | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/classes/Session.php b/classes/Session.php
index d641edbbe4..79a69a96ea 100644
--- a/classes/Session.php
+++ b/classes/Session.php
@@ -85,9 +85,18 @@ class Session extends Memcached_DataObject
return $session->insert();
} else {
- $session->session_data = $session_data;
+ if (strcmp($session->session_data, $session_data) == 0) {
+ self::logdeb("Not writing session '$id'; unchanged");
+ return true;
+ } else {
+ self::logdeb("Session '$id' data changed; updating");
- return $session->update();
+ $orig = clone($session);
+
+ $session->session_data = $session_data;
+
+ return $session->update($orig);
+ }
}
}
From ed1ff81e948ca576ed439178c7d6482a09dc4140 Mon Sep 17 00:00:00 2001
From: Brion Vibber
Date: Tue, 13 Oct 2009 16:54:57 +0000
Subject: [PATCH 020/187] Include long-form attachment URL in notice if URL
shortening is disabled. Previously, the attachment URL would simply be
dropped when shortening returned false instead of a short URL... the
attachment was present if you clicked through to notice details but didn't
appear in the timeline, making it nigh-impossible to see the attachment.
---
actions/newnotice.php | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/actions/newnotice.php b/actions/newnotice.php
index 00a822860e..115cfd580f 100644
--- a/actions/newnotice.php
+++ b/actions/newnotice.php
@@ -239,6 +239,10 @@ class NewnoticeAction extends Action
$this->maybeAddRedir($fileRecord->id, $fileurl);
$short_fileurl = common_shorten_url($fileurl);
+ if (!$short_fileurl) {
+ // todo -- Consider forcing default shortener if none selected?
+ $short_fileurl = $fileurl;
+ }
$content_shortened .= ' ' . $short_fileurl;
if (mb_strlen($content_shortened) > 140) {
From 8be28f478dd578f1b8fca561238b9ee5a13c6b27 Mon Sep 17 00:00:00 2001
From: Zach Copley
Date: Tue, 13 Oct 2009 14:48:19 -0700
Subject: [PATCH 021/187] Fix syntax errors
---
actions/apidirectmessagenew.php | 2 +-
actions/apifavoritecreate.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/actions/apidirectmessagenew.php b/actions/apidirectmessagenew.php
index fa6cafbe8d..ca1ee70dde 100644
--- a/actions/apidirectmessagenew.php
+++ b/actions/apidirectmessagenew.php
@@ -157,7 +157,7 @@ class ApiDirectMessageNewAction extends ApiAuthAction
// Note: sending msgs to yourself is allowed by Twitter
$errmsg = 'Don\'t send a message to yourself; ' .
- 'just say it to yourself quietly instead.'
+ 'just say it to yourself quietly instead.';
$this->clientError(_($errmsg), 403, $this->format);
return;
diff --git a/actions/apifavoritecreate.php b/actions/apifavoritecreate.php
index a80a6492e9..4367397707 100644
--- a/actions/apifavoritecreate.php
+++ b/actions/apifavoritecreate.php
@@ -127,7 +127,7 @@ class ApiFavoriteCreateAction extends ApiAuthAction
if (empty($fave)) {
$this->clientError(
- _('Could not create favorite.')
+ _('Could not create favorite.'),
403,
$this->format
);
From 77afd6c3448335b3a46c98c78fbbda733fc5d586 Mon Sep 17 00:00:00 2001
From: Brion Vibber
Date: Tue, 13 Oct 2009 14:51:23 -0700
Subject: [PATCH 022/187] Commit upstream updates to php-gettext after the
1.0.7 release (but in 2006! :P) Fixes file magic checks on 64-bit systems.
http://bazaar.launchpad.net/~danilo/php-gettext/trunk/revision/17
http://bazaar.launchpad.net/~danilo/php-gettext/trunk/revision/18
http://bazaar.launchpad.net/~danilo/php-gettext/trunk/revision/19
---
extlib/php-gettext/ChangeLog | 16 ++++++++++++++++
extlib/php-gettext/gettext.inc | 6 +++---
extlib/php-gettext/gettext.php | 6 +++---
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/extlib/php-gettext/ChangeLog b/extlib/php-gettext/ChangeLog
index 5e0949dfd7..ab77d80810 100644
--- a/extlib/php-gettext/ChangeLog
+++ b/extlib/php-gettext/ChangeLog
@@ -1,3 +1,19 @@
+2006-02-28 Danilo Šegan
+
+ * gettext.php: Added some comments about these workarounds for
+ different PHP versions and architectures.
+
+2006-02-28 Danilo Šegan
+
+ Fixes bug #15923.
+
+ * gettext.php (gettext_reader): make magic check work on 64-bit
+ platforms as well (by Steffen Pingel).
+
+2006-02-20 Danilo Šegan
+
+ * gettext.inc (_bindtextdomain): Use php_uname to detect Windows.
+
2006-02-07 Danilo Šegan
* examples/pigs_dropin.php: comment-out bind_textdomain_codeset
diff --git a/extlib/php-gettext/gettext.inc b/extlib/php-gettext/gettext.inc
index eb94b256a6..fcaafe7c9e 100644
--- a/extlib/php-gettext/gettext.inc
+++ b/extlib/php-gettext/gettext.inc
@@ -148,9 +148,9 @@ function _setlocale($category, $locale) {
*/
function _bindtextdomain($domain, $path) {
global $text_domains;
- // ensure $path ends with a slash
- if ($path[strlen($path) - 1] != '/') $path .= '/';
- elseif ($path[strlen($path) - 1] != '\\') $path .= '\\';
+ // ensure $path ends with a slash
+ if ($path[strlen($path) - 1] != '/') $path .= '/';
+ elseif ($path[strlen($path) - 1] != '\\') $path .= '\\';
$text_domains[$domain]->path = $path;
}
diff --git a/extlib/php-gettext/gettext.php b/extlib/php-gettext/gettext.php
index ad94a987b7..cd080444ca 100644
--- a/extlib/php-gettext/gettext.php
+++ b/extlib/php-gettext/gettext.php
@@ -102,16 +102,16 @@ class gettext_reader {
// Caching can be turned off
$this->enable_cache = $enable_cache;
- // $MAGIC1 = (int)0x950412de; //bug in PHP 5
+ // $MAGIC1 = (int)0x950412de; //bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565
$MAGIC1 = (int) - 1794895138;
// $MAGIC2 = (int)0xde120495; //bug
$MAGIC2 = (int) - 569244523;
$this->STREAM = $Reader;
$magic = $this->readint();
- if ($magic == $MAGIC1) {
+ if ($magic == ($MAGIC1 & 0xFFFFFFFF)) { // to make sure it works for 64-bit platforms
$this->BYTEORDER = 0;
- } elseif ($magic == $MAGIC2) {
+ } elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) {
$this->BYTEORDER = 1;
} else {
$this->error = 1; // not MO file
From ffeef6520c4e9e1d691bcea8a15aa8097ceb1d37 Mon Sep 17 00:00:00 2001
From: Brion Vibber
Date: Tue, 13 Oct 2009 14:51:23 -0700
Subject: [PATCH 023/187] Commit upstream updates to php-gettext after the
1.0.7 release (but in 2006! :P) Fixes file magic checks on 64-bit systems.
http://bazaar.launchpad.net/~danilo/php-gettext/trunk/revision/17
http://bazaar.launchpad.net/~danilo/php-gettext/trunk/revision/18
http://bazaar.launchpad.net/~danilo/php-gettext/trunk/revision/19
---
extlib/php-gettext/ChangeLog | 16 ++++++++++++++++
extlib/php-gettext/gettext.inc | 6 +++---
extlib/php-gettext/gettext.php | 6 +++---
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/extlib/php-gettext/ChangeLog b/extlib/php-gettext/ChangeLog
index 5e0949dfd7..ab77d80810 100644
--- a/extlib/php-gettext/ChangeLog
+++ b/extlib/php-gettext/ChangeLog
@@ -1,3 +1,19 @@
+2006-02-28 Danilo Šegan
+
+ * gettext.php: Added some comments about these workarounds for
+ different PHP versions and architectures.
+
+2006-02-28 Danilo Šegan
+
+ Fixes bug #15923.
+
+ * gettext.php (gettext_reader): make magic check work on 64-bit
+ platforms as well (by Steffen Pingel).
+
+2006-02-20 Danilo Šegan
+
+ * gettext.inc (_bindtextdomain): Use php_uname to detect Windows.
+
2006-02-07 Danilo Šegan
* examples/pigs_dropin.php: comment-out bind_textdomain_codeset
diff --git a/extlib/php-gettext/gettext.inc b/extlib/php-gettext/gettext.inc
index eb94b256a6..fcaafe7c9e 100644
--- a/extlib/php-gettext/gettext.inc
+++ b/extlib/php-gettext/gettext.inc
@@ -148,9 +148,9 @@ function _setlocale($category, $locale) {
*/
function _bindtextdomain($domain, $path) {
global $text_domains;
- // ensure $path ends with a slash
- if ($path[strlen($path) - 1] != '/') $path .= '/';
- elseif ($path[strlen($path) - 1] != '\\') $path .= '\\';
+ // ensure $path ends with a slash
+ if ($path[strlen($path) - 1] != '/') $path .= '/';
+ elseif ($path[strlen($path) - 1] != '\\') $path .= '\\';
$text_domains[$domain]->path = $path;
}
diff --git a/extlib/php-gettext/gettext.php b/extlib/php-gettext/gettext.php
index ad94a987b7..cd080444ca 100644
--- a/extlib/php-gettext/gettext.php
+++ b/extlib/php-gettext/gettext.php
@@ -102,16 +102,16 @@ class gettext_reader {
// Caching can be turned off
$this->enable_cache = $enable_cache;
- // $MAGIC1 = (int)0x950412de; //bug in PHP 5
+ // $MAGIC1 = (int)0x950412de; //bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565
$MAGIC1 = (int) - 1794895138;
// $MAGIC2 = (int)0xde120495; //bug
$MAGIC2 = (int) - 569244523;
$this->STREAM = $Reader;
$magic = $this->readint();
- if ($magic == $MAGIC1) {
+ if ($magic == ($MAGIC1 & 0xFFFFFFFF)) { // to make sure it works for 64-bit platforms
$this->BYTEORDER = 0;
- } elseif ($magic == $MAGIC2) {
+ } elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) {
$this->BYTEORDER = 1;
} else {
$this->error = 1; // not MO file
From d1e70b4e37149e09b2189957e2a869b4014a05c5 Mon Sep 17 00:00:00 2001
From: Brion Vibber
Date: Tue, 13 Oct 2009 14:51:23 -0700
Subject: [PATCH 024/187] Commit upstream updates to php-gettext after the
1.0.7 release (but in 2006! :P) Fixes file magic checks on 64-bit systems.
http://bazaar.launchpad.net/~danilo/php-gettext/trunk/revision/17
http://bazaar.launchpad.net/~danilo/php-gettext/trunk/revision/18
http://bazaar.launchpad.net/~danilo/php-gettext/trunk/revision/19
---
extlib/php-gettext/ChangeLog | 16 ++++++++++++++++
extlib/php-gettext/gettext.inc | 6 +++---
extlib/php-gettext/gettext.php | 6 +++---
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/extlib/php-gettext/ChangeLog b/extlib/php-gettext/ChangeLog
index 5e0949dfd7..ab77d80810 100644
--- a/extlib/php-gettext/ChangeLog
+++ b/extlib/php-gettext/ChangeLog
@@ -1,3 +1,19 @@
+2006-02-28 Danilo Šegan
+
+ * gettext.php: Added some comments about these workarounds for
+ different PHP versions and architectures.
+
+2006-02-28 Danilo Šegan
+
+ Fixes bug #15923.
+
+ * gettext.php (gettext_reader): make magic check work on 64-bit
+ platforms as well (by Steffen Pingel).
+
+2006-02-20 Danilo Šegan
+
+ * gettext.inc (_bindtextdomain): Use php_uname to detect Windows.
+
2006-02-07 Danilo Šegan
* examples/pigs_dropin.php: comment-out bind_textdomain_codeset
diff --git a/extlib/php-gettext/gettext.inc b/extlib/php-gettext/gettext.inc
index eb94b256a6..fcaafe7c9e 100644
--- a/extlib/php-gettext/gettext.inc
+++ b/extlib/php-gettext/gettext.inc
@@ -148,9 +148,9 @@ function _setlocale($category, $locale) {
*/
function _bindtextdomain($domain, $path) {
global $text_domains;
- // ensure $path ends with a slash
- if ($path[strlen($path) - 1] != '/') $path .= '/';
- elseif ($path[strlen($path) - 1] != '\\') $path .= '\\';
+ // ensure $path ends with a slash
+ if ($path[strlen($path) - 1] != '/') $path .= '/';
+ elseif ($path[strlen($path) - 1] != '\\') $path .= '\\';
$text_domains[$domain]->path = $path;
}
diff --git a/extlib/php-gettext/gettext.php b/extlib/php-gettext/gettext.php
index ad94a987b7..cd080444ca 100644
--- a/extlib/php-gettext/gettext.php
+++ b/extlib/php-gettext/gettext.php
@@ -102,16 +102,16 @@ class gettext_reader {
// Caching can be turned off
$this->enable_cache = $enable_cache;
- // $MAGIC1 = (int)0x950412de; //bug in PHP 5
+ // $MAGIC1 = (int)0x950412de; //bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565
$MAGIC1 = (int) - 1794895138;
// $MAGIC2 = (int)0xde120495; //bug
$MAGIC2 = (int) - 569244523;
$this->STREAM = $Reader;
$magic = $this->readint();
- if ($magic == $MAGIC1) {
+ if ($magic == ($MAGIC1 & 0xFFFFFFFF)) { // to make sure it works for 64-bit platforms
$this->BYTEORDER = 0;
- } elseif ($magic == $MAGIC2) {
+ } elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) {
$this->BYTEORDER = 1;
} else {
$this->error = 1; // not MO file
From 0fd8e758ade32204b452cc9fd40e071f0ec8c0f6 Mon Sep 17 00:00:00 2001
From: Zach Copley
Date: Wed, 14 Oct 2009 04:50:16 +0000
Subject: [PATCH 025/187] Make queuing and daemons work via events
---
classes/Avatar.php | 2 +-
plugins/TwitterBridge/TwitterBridgePlugin.php | 17 +++++++++++++++++
.../daemons/synctwitterfriends.php | 10 ++--------
.../daemons/twitterstatusfetcher.php | 9 ++++-----
plugins/TwitterBridge/twitter.php | 3 +++
scripts/getvaliddaemons.php | 9 ---------
6 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/classes/Avatar.php b/classes/Avatar.php
index 5e8b315fe6..64f105179c 100644
--- a/classes/Avatar.php
+++ b/classes/Avatar.php
@@ -81,7 +81,7 @@ class Avatar extends Memcached_DataObject
if (empty($server)) {
$server = common_config('site', 'server');
}
-
+ common_debug('path = ' . $path);
// XXX: protocol
return 'http://'.$server.$path.$filename;
diff --git a/plugins/TwitterBridge/TwitterBridgePlugin.php b/plugins/TwitterBridge/TwitterBridgePlugin.php
index a8de1c6644..69bec06511 100644
--- a/plugins/TwitterBridge/TwitterBridgePlugin.php
+++ b/plugins/TwitterBridge/TwitterBridgePlugin.php
@@ -97,5 +97,22 @@ class TwitterBridgePlugin extends Plugin
}
}
+ function onStartEnqueueNotice($notice, $transports)
+ {
+ array_push($transports, 'twitter');
+ return true;
+ }
+
+ function onGetValidDaemons($daemons)
+ {
+ array_push($daemons, INSTALLDIR . '/plugins/TwitterBridge/daemons/twitterqueuehandler.php');
+ array_push($daemons, INSTALLDIR . '/plugins/TwitterBridge/daemons/synctwitterfriends.php');
+
+ if (common_config('twitterbridge', 'enabled')) {
+ array_push($daemons, INSTALLDIR . '/plugins/TwitterBridge/daemons/twitterstatusfetcher.php');
+ }
+
+ return true;
+ }
}
\ No newline at end of file
diff --git a/plugins/TwitterBridge/daemons/synctwitterfriends.php b/plugins/TwitterBridge/daemons/synctwitterfriends.php
index 0668c6222f..ed2bf48a22 100755
--- a/plugins/TwitterBridge/daemons/synctwitterfriends.php
+++ b/plugins/TwitterBridge/daemons/synctwitterfriends.php
@@ -33,6 +33,8 @@ END_OF_TRIM_HELP;
require_once INSTALLDIR . '/scripts/commandline.inc';
require_once INSTALLDIR . '/lib/parallelizingdaemon.php';
require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
+require_once INSTALLDIR . '/plugins/TwitterBridge/twitterbasicauthclient.php';
+require_once INSTALLDIR . '/plugins/TwitterBridge/twitteroauthclient.php';
/**
* Daemon to sync local friends with Twitter friends
@@ -45,14 +47,6 @@ require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
* @link http://status.net/
*/
-$helptext = <<filename = $filename;
$avatar->url = Avatar::url($filename);
- common_debug($this->name() . " - New filename: $avatar->url");
-
$avatar->created = common_sql_now();
$id = $avatar->insert();
@@ -516,9 +517,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
function fetchAvatar($url, $filename)
{
- $avatar_dir = INSTALLDIR . '/avatar/';
-
- $avatarfile = $avatar_dir . $filename;
+ $avatarfile = Avatar::path($filename);
$out = fopen($avatarfile, 'wb');
if (!$out) {
diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php
index afc3f55bab..ac1f49c363 100644
--- a/plugins/TwitterBridge/twitter.php
+++ b/plugins/TwitterBridge/twitter.php
@@ -23,6 +23,9 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
define('TWITTER_SERVICE', 1); // Twitter is foreign_service ID 1
+require_once INSTALLDIR . '/plugins/TwitterBridge/twitterbasicauthclient.php';
+require_once INSTALLDIR . '/plugins/TwitterBridge/twitteroauthclient.php';
+
function updateTwitter_user($twitter_id, $screen_name)
{
$uri = 'http://twitter.com/' . $screen_name;
diff --git a/scripts/getvaliddaemons.php b/scripts/getvaliddaemons.php
index 6dd0197129..7caea1bb75 100755
--- a/scripts/getvaliddaemons.php
+++ b/scripts/getvaliddaemons.php
@@ -49,15 +49,6 @@ if(common_config('xmpp','enabled')) {
$daemons[] = INSTALLDIR.'/scripts/xmppconfirmhandler.php';
}
-if(common_config('twitterbridge','enabled')) {
- $daemons[] = INSTALLDIR.'/scripts/twitterstatusfetcher.php';
-}
-
-if (common_config('twitter', 'enabled')) {
- $daemons[] = INSTALLDIR.'/scripts/twitterqueuehandler.php';
- $daemons[] = INSTALLDIR.'/scripts/synctwitterfriends.php';
-}
-
if (common_config('sms', 'enabled')) {
$daemons[] = INSTALLDIR.'/scripts/smsqueuehandler.php';
}
From 6b5810f5d562260a0143446982bf22ef50298d80 Mon Sep 17 00:00:00 2001
From: Sarven Capadisli
Date: Wed, 14 Oct 2009 09:53:07 +0000
Subject: [PATCH 026/187] Moved to location of the FBConnect JavaScript to the
end of
- function onStartShowHeader($action)
+ function onEndShowScripts($action)
{
if ($this->reqFbScripts($action)) {
From 2e3cda4da626a83d87a4c35814d6d01307dde5dc Mon Sep 17 00:00:00 2001
From: Evan Prodromou
Date: Thu, 15 Oct 2009 04:49:45 -0400
Subject: [PATCH 027/187] update DB_DataObject to 1.8.12
---
extlib/DB/DataObject.php | 2 +-
extlib/DB/DataObject/Cast.php | 8 ++++----
extlib/DB/DataObject/Error.php | 8 ++++----
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/extlib/DB/DataObject.php b/extlib/DB/DataObject.php
index 8e226b8fa9..60ff1441b5 100644
--- a/extlib/DB/DataObject.php
+++ b/extlib/DB/DataObject.php
@@ -235,7 +235,7 @@ class DB_DataObject extends DB_DataObject_Overload
* @access private
* @var string
*/
- var $_DB_DataObject_version = "1.8.11";
+ var $_DB_DataObject_version = "1.8.12";
/**
* The Database table (used by table extends)
diff --git a/extlib/DB/DataObject/Cast.php b/extlib/DB/DataObject/Cast.php
index 095d2a4d25..2049beb581 100644
--- a/extlib/DB/DataObject/Cast.php
+++ b/extlib/DB/DataObject/Cast.php
@@ -6,9 +6,9 @@
*
* PHP versions 4 and 5
*
- * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
- * http://www.php.net/license/3_0.txt. If you did not receive a copy of
+ * http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
@@ -16,8 +16,8 @@
* @package DB_DataObject
* @author Alan Knowles
* @copyright 1997-2008 The PHP Group
- * @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Cast.php 264148 2008-08-04 03:44:59Z alan_k $
+ * @license http://www.php.net/license/3_01.txt PHP License 3.01
+ * @version CVS: $Id: Cast.php 287158 2009-08-12 13:58:31Z alan_k $
* @link http://pear.php.net/package/DB_DataObject
*/
diff --git a/extlib/DB/DataObject/Error.php b/extlib/DB/DataObject/Error.php
index 3821154537..cdb863d83c 100644
--- a/extlib/DB/DataObject/Error.php
+++ b/extlib/DB/DataObject/Error.php
@@ -7,9 +7,9 @@
*
* PHP versions 4 and 5
*
- * LICENSE: This source file is subject to version 3.0 of the PHP license
+ * LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
- * http://www.php.net/license/3_0.txt. If you did not receive a copy of
+ * http://www.php.net/license/3_01.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
@@ -17,8 +17,8 @@
* @package DB_DataObject
* @author Alan Knowles
* @copyright 1997-2006 The PHP Group
- * @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version CVS: $Id: Error.php 277015 2009-03-12 05:51:03Z alan_k $
+ * @license http://www.php.net/license/3_01.txt PHP License 3.01
+ * @version CVS: $Id: Error.php 287158 2009-08-12 13:58:31Z alan_k $
* @link http://pear.php.net/package/DB_DataObject
*/
From 1241e651ae54adfc429aceb92a2bc873f1c82f8d Mon Sep 17 00:00:00 2001
From: Trever Fischer
Date: Thu, 15 Oct 2009 05:16:37 -0400
Subject: [PATCH 028/187] Added support for profile designs to the twitter API
---
classes/Profile.php | 5 +++++
lib/api.php | 20 +++++++++++++-------
2 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/classes/Profile.php b/classes/Profile.php
index 4a069ee84e..a78a27f4a2 100644
--- a/classes/Profile.php
+++ b/classes/Profile.php
@@ -46,6 +46,11 @@ class Profile extends Memcached_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
+ function getUser()
+ {
+ return User::staticGet('id', $this->id);
+ }
+
function getAvatar($width, $height=null)
{
if (is_null($height)) {
diff --git a/lib/api.php b/lib/api.php
index 7a63a4a785..9bd2083deb 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -134,11 +134,19 @@ class ApiAction extends Action
$twitter_user['protected'] = false; # not supported by StatusNet yet
$twitter_user['followers_count'] = $profile->subscriberCount();
- // To be supported soon...
- $twitter_user['profile_background_color'] = '';
- $twitter_user['profile_text_color'] = '';
- $twitter_user['profile_link_color'] = '';
- $twitter_user['profile_sidebar_fill_color'] = '';
+ // Need to pull up the user for some of this
+ $user = $profile->getUser();
+ $design = $user->getDesign();
+ $defaultDesign = Design::siteDesign();
+ if (!$design) $design = $defaultDesign;
+ $color = Design::toWebColor(empty($design->backgroundcolor) ? $defaultDesign->backgroundcolor : $design->backgroundcolor);
+ $twitter_user['profile_background_color'] = ($color == null) ? '' : '#'.$color->hexValue();
+ $color = Design::toWebColor(empty($design->textcolor) ? $defaultDesign->textcolor : $design->textcolor);
+ $twitter_user['profile_text_color'] = ($color == null) ? '' : '#'.$color->hexValue();
+ $color = Design::toWebColor(empty($design->linkcolor) ? $defaultDesign->linkcolor : $design->linkcolor);
+ $twitter_user['profile_link_color'] = ($color == null) ? '' : '#'.$color->hexValue();
+ $color = Design::toWebColor(empty($design->sidebarcolor) ? $defaultDesign->sidebarcolor : $design->sidebarcolor);
+ $twitter_user['profile_sidebar_fill_color'] = ($color == null) ? '' : '#'.$color->hexValue();
$twitter_user['profile_sidebar_border_color'] = '';
$twitter_user['friends_count'] = $profile->subscriptionCount();
@@ -147,8 +155,6 @@ class ApiAction extends Action
$twitter_user['favourites_count'] = $profile->faveCount(); // British spelling!
- // Need to pull up the user for some of this
- $user = User::staticGet($profile->id);
$timezone = 'UTC';
From 90de6eae5a6195e4455a726d7183dbefc8eeb617 Mon Sep 17 00:00:00 2001
From: Evan Prodromou
Date: Thu, 15 Oct 2009 06:01:26 -0400
Subject: [PATCH 029/187] add more events to profile list
---
EVENTS.txt | 65 ++++++++++++++++++++++++++++++++++++++++
actions/groupmembers.php | 9 ++++--
lib/profilelist.php | 62 ++++++++++++++++++++++++++++++--------
3 files changed, 120 insertions(+), 16 deletions(-)
diff --git a/EVENTS.txt b/EVENTS.txt
index 9de2f8bc6b..5d34a9e13b 100644
--- a/EVENTS.txt
+++ b/EVENTS.txt
@@ -390,3 +390,68 @@ EndProfilePageProfileTags: after showing the tags on the profile page
- $action: the current action
- &$profile: the profile being shown
+StartProfileList: when starting a list of profiles (before )
+- $profilelist: ProfileList widget, with $profile, $action, and $out
+
+EndProfileList: when ending a list of profiles (after
)
+- $profilelist: ProfileList widget
+
+StartProfileListItem: when starting to show a profile list item
+- $item: ProfileListItem widget
+
+EndProfileListItem: after showing a profile list item
+- $item: ProfileListItem widget
+
+StartProfileListItemProfile: the profile data part of the item
+- $item: ProfileListItem widget
+
+EndProfileListItemProfile: the profile data part of the item
+- $item: ProfileListItem widget
+
+StartProfileListItemActions: the actions (buttons) for an item
+- $item: ProfileListItem widget
+
+EndProfileListItemActions: the actions (buttons) for an item
+- $item: ProfileListItem widget
+
+StartProfileListItemProfileElements: inside the