From 9196c9eef091e7f4a41fbc9452521d6ca2de55a3 Mon Sep 17 00:00:00 2001 From: friendica Date: Fri, 22 Aug 2014 21:37:08 -0700 Subject: We really can't do this without a hubloc. I was hoping we could, but notifier is setup to take hublocs, not xchans. --- boot.php | 2 +- include/notifier.php | 2 +- include/zot.php | 5 +++-- install/database.sql | 2 ++ install/update.php | 14 +++++++++++++- mod/import.php | 5 +++-- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/boot.php b/boot.php index f8bd29f37..a6e5fc0b4 100755 --- a/boot.php +++ b/boot.php @@ -47,7 +47,7 @@ define ( 'RED_PLATFORM', 'Red Matrix' ); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R'); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1123 ); +define ( 'DB_UPDATE_VERSION', 1124 ); define ( 'EOL', '
' . "\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/include/notifier.php b/include/notifier.php index 9d5c7cb8e..180a538bc 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -382,7 +382,7 @@ function notifier_run($argv, $argc){ $env_recips = (($private) ? array() : null); - $details = q("select xchan_hash, xchan_instance_url, xchan_addr, xchan_guid, xchan_guid_sig from xchan where xchan_hash in (" . implode(',',$recipients) . ")"); + $details = q("select xchan_hash, xchan_instance_url, xchan_network, xchan_addr, xchan_guid, xchan_guid_sig from xchan where xchan_hash in (" . implode(',',$recipients) . ")"); $recip_list = array(); diff --git a/include/zot.php b/include/zot.php index 41d0bc1eb..a155b2588 100644 --- a/include/zot.php +++ b/include/zot.php @@ -959,12 +959,13 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) { ); } logger('import_xchan: new hub: ' . $location['url']); - $r = q("insert into hubloc ( hubloc_guid, hubloc_guid_sig, hubloc_hash, hubloc_addr, hubloc_flags, hubloc_url, hubloc_url_sig, hubloc_host, hubloc_callback, hubloc_sitekey, hubloc_updated, hubloc_connected) - values ( '%s','%s','%s','%s', %d ,'%s','%s','%s','%s','%s','%s','%s')", + $r = q("insert into hubloc ( hubloc_guid, hubloc_guid_sig, hubloc_hash, hubloc_addr, hubloc_network, hubloc_flags, hubloc_url, hubloc_url_sig, hubloc_host, hubloc_callback, hubloc_sitekey, hubloc_updated, hubloc_connected) + values ( '%s','%s','%s','%s', '%s', %d ,'%s','%s','%s','%s','%s','%s','%s')", dbesc($arr['guid']), dbesc($arr['guid_sig']), dbesc($xchan_hash), dbesc($location['address']), + dbesc('zot'), intval((intval($location['primary'])) ? HUBLOC_FLAGS_PRIMARY : 0), dbesc($location['url']), dbesc($location['url_sig']), diff --git a/install/database.sql b/install/database.sql index 2791f94be..104f145e5 100644 --- a/install/database.sql +++ b/install/database.sql @@ -442,6 +442,7 @@ CREATE TABLE IF NOT EXISTS `hubloc` ( `hubloc_guid_sig` text NOT NULL, `hubloc_hash` char(255) NOT NULL, `hubloc_addr` char(255) NOT NULL DEFAULT '', + `hubloc_network` char(32) NOT NULL DEFAULT '', `hubloc_flags` int(10) unsigned NOT NULL DEFAULT '0', `hubloc_status` int(10) unsigned NOT NULL DEFAULT '0', `hubloc_url` char(255) NOT NULL DEFAULT '', @@ -459,6 +460,7 @@ CREATE TABLE IF NOT EXISTS `hubloc` ( KEY `hubloc_connect` (`hubloc_connect`), KEY `hubloc_host` (`hubloc_host`), KEY `hubloc_addr` (`hubloc_addr`), + KEY `hubloc_network` (`hubloc_network`), KEY `hubloc_updated` (`hubloc_updated`), KEY `hubloc_connected` (`hubloc_connected`), KEY `hubloc_status` (`hubloc_status`) diff --git a/install/update.php b/install/update.php index f7d6441dc..9e184428e 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ get_hostname()), + dbesc('zot'), intval(($seize) ? HUBLOC_FLAGS_PRIMARY : 0), dbesc(z_root()), dbesc(base64url_encode(rsa_sign(z_root(),$channel['channel_prvkey']))), -- cgit v1.2.3