From d7154a4606d8c6f86b2eacd35c16893283b484c4 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 5 Jul 2011 19:55:09 -0700 Subject: [PATCH] ability to link contacts that are "really me, but on another system/network". --- boot.php | 2 +- database.sql | 1 + include/items.php | 7 +++++++ mod/dfrn_notify.php | 6 ++++++ update.php | 7 ++++++- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/boot.php b/boot.php index c95e24dc1c..8d2d313078 100644 --- a/boot.php +++ b/boot.php @@ -6,7 +6,7 @@ ini_set('pcre.backtrack_limit', 250000); define ( 'FRIENDIKA_VERSION', '2.2.1032' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); -define ( 'DB_UPDATE_VERSION', 1073 ); +define ( 'DB_UPDATE_VERSION', 1074 ); define ( 'EOL', "
\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/database.sql b/database.sql index 4952e7c623..b11e72f6ce 100644 --- a/database.sql +++ b/database.sql @@ -52,6 +52,7 @@ CREATE TABLE IF NOT EXISTS `contact` ( `uid` int(11) NOT NULL COMMENT 'owner uid', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `self` tinyint(1) NOT NULL DEFAULT '0', + `remote_self` tinyint(1) NOT NULL DEFAULT '0', `rel` tinyint(1) NOT NULL DEFAULT '0', `duplex` tinyint(1) NOT NULL DEFAULT '0', `network` char(255) NOT NULL, diff --git a/include/items.php b/include/items.php index 9cafaea629..6593647bac 100644 --- a/include/items.php +++ b/include/items.php @@ -1260,6 +1260,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee if(! x($datarray,'author-avatar')) $datarray['author-avatar'] = $contact['thumb']; + $r = q("SELECT `uid`, `last-child`, `edited`, `body` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($item_id), intval($importer['uid']) @@ -1416,6 +1417,12 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee $datarray['last-child'] = 0; } + // This is my contact on another system, but it's really me. + // Turn this into a wall post. + + if($contact['remote_self']) + $datarray['wall'] = 1; + $datarray['parent-uri'] = $item_id; $datarray['uid'] = $importer['uid']; $datarray['contact-id'] = $contact['id']; diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 90d2e40045..0dc96f8a76 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -747,6 +747,12 @@ function dfrn_notify_post(&$a) { continue; } + // This is my contact on another system, but it's really me. + // Turn this into a wall post. + + if($contact['remote_self']) + $datarray['wall'] = 1; + $datarray['parent-uri'] = $item_id; $datarray['uid'] = $importer['importer_uid']; $datarray['contact-id'] = $importer['id']; diff --git a/update.php b/update.php index 08f1e6854e..66908b8d34 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@