From a33edb00424882258a90b138c634a466c92faf61 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 1 Sep 2011 18:02:08 -0700 Subject: [PATCH] infrastructure for personalised @ tags (no UI/settings form yet), allow own comments through statusnet connector --- addon/statusnet/statusnet.php | 5 ++++- boot.php | 4 ++-- database.sql | 1 + mod/item.php | 3 ++- mod/photos.php | 3 ++- update.php | 8 ++++++-- zot.txt | 4 ++-- 7 files changed, 19 insertions(+), 9 deletions(-) diff --git a/addon/statusnet/statusnet.php b/addon/statusnet/statusnet.php index 2f02ded54b..f1b35d6c04 100644 --- a/addon/statusnet/statusnet.php +++ b/addon/statusnet/statusnet.php @@ -355,7 +355,10 @@ function statusnet_post_hook(&$a,&$b) { logger('StatusNet post invoked'); - if((local_user()) && (local_user() == $b['uid']) && (! $b['private']) && (!$b['parent']) ) { + if((local_user()) && (local_user() == $b['uid']) && (! $b['private'])) { + + // mike 2-9-11 there was a restriction to only allow this for top level posts + // now relaxed so should allow one's own comments to be forwarded through the connector as well. // Status.Net is not considered a private network if($b['prvnets']) diff --git a/boot.php b/boot.php index 3578f3f333..e8b3d7ac18 100644 --- a/boot.php +++ b/boot.php @@ -7,9 +7,9 @@ require_once('include/text.php'); require_once("include/pgettext.php"); -define ( 'FRIENDIKA_VERSION', '2.2.1089' ); +define ( 'FRIENDIKA_VERSION', '2.2.1090' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); -define ( 'DB_UPDATE_VERSION', 1084 ); +define ( 'DB_UPDATE_VERSION', 1085 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index 9819914f78..432ce76938 100644 --- a/database.sql +++ b/database.sql @@ -58,6 +58,7 @@ CREATE TABLE IF NOT EXISTS `contact` ( `network` char(255) NOT NULL, `name` char(255) NOT NULL, `nick` char(255) NOT NULL, + `attag` char(255) NOT NULL, `photo` text NOT NULL, `thumb` text NOT NULL, `micro` text NOT NULL, diff --git a/mod/item.php b/mod/item.php index b6ea8ff085..6ecca8f4a1 100644 --- a/mod/item.php +++ b/mod/item.php @@ -404,7 +404,8 @@ function item_post(&$a) { ); } else { - $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1", + $r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1", + dbesc($name), dbesc($name), intval($profile_uid) ); diff --git a/mod/photos.php b/mod/photos.php index cb13b76036..b74ca85d71 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -414,7 +414,8 @@ function photos_post(&$a) { ); } else { - $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1", + $r = q("SELECT * FROM `contact` WHERE `attag` = '%s' OR `nick` = '%s' AND `uid` = %d ORDER BY `attag` DESC LIMIT 1", + dbesc($name), dbesc($name), intval($page_owner_uid) ); diff --git a/update.php b/update.php index 14bc48ab71..80761cce45 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@