aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--boot.php2
-rw-r--r--database.sql11
-rw-r--r--include/poller.php2
-rw-r--r--mod/pubsub.php4
-rw-r--r--update.php4
5 files changed, 18 insertions, 5 deletions
diff --git a/boot.php b/boot.php
index 9ebdef1bf..5baaa218f 100644
--- a/boot.php
+++ b/boot.php
@@ -2,7 +2,7 @@
set_time_limit(0);
-define ( 'BUILD_ID' , 1004 );
+define ( 'BUILD_ID' , 1005 );
define ( 'EOL', "<br />\r\n");
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
diff --git a/database.sql b/database.sql
index fd709878d..78c7d27c2 100644
--- a/database.sql
+++ b/database.sql
@@ -69,6 +69,9 @@ CREATE TABLE IF NOT EXISTS `contact` (
`confirm` text NOT NULL,
`aes_allow` tinyint(1) NOT NULL DEFAULT '0',
`ret-aes` tinyint(1) NOT NULL DEFAULT '0',
+ `usehub` tinyint(1) NOT NULL DEFAULT '0',
+ `subhub` tinyint(1) NOT NULL DEFAULT '0',
+ `hub-verify` char(255) NOT NULL,
`last-update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`name-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`uri-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -80,7 +83,13 @@ CREATE TABLE IF NOT EXISTS `contact` (
`rating` tinyint(1) NOT NULL DEFAULT '0',
`reason` text NOT NULL,
`profile-id` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`)
+ PRIMARY KEY (`id`),
+ KEY `uid` (`uid`),
+ KEY `self` (`self`),
+ KEY `issued-id` (`issued-id`),
+ KEY `dfrn-id` (`dfrn-id`),
+ KEY `blocked` (`blocked`),
+ KEY `readonly` (`readonly`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
diff --git a/include/poller.php b/include/poller.php
index 986c00913..b9ef0d93a 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -23,7 +23,7 @@
$contacts = q("SELECT * FROM `contact`
WHERE ( `dfrn-id` != '' OR (`issued-id` != '' AND `duplex` = 1))
- AND `self` = 0 AND `blocked` = 0 AND `readonly` = 0 AND `usehub` = 0 ORDER BY RAND()");
+ AND `self` = 0 AND `blocked` = 0 AND `readonly` = 0 AND `subhub` = 0 ORDER BY RAND()");
if(! count($contacts))
killme();
diff --git a/mod/pubsub.php b/mod/pubsub.php
index 65705069a..1e6add935 100644
--- a/mod/pubsub.php
+++ b/mod/pubsub.php
@@ -67,7 +67,7 @@ function pubsub_init(&$a) {
if(($hub_mode === 'unsubscribe') && (! strlen($hub_verify)))
hub_return(false, '');
- $r = q("UPDATE `contact` SET `usehub` = %d WHERE `id` = %d LIMIT 1",
+ $r = q("UPDATE `contact` SET `subhub` = %d WHERE `id` = %d LIMIT 1",
intval($subscribe),
intval($contact['id'])
);
@@ -93,7 +93,7 @@ function pubsub_post(&$a) {
$importer = $r[0];
- $r = q("SELECT * FROM `contact` WHERE `usehub` = 1 AND `id` = %d AND `uid` = %d AND `blocked` = 0 LIMIT 1",
+ $r = q("SELECT * FROM `contact` WHERE `subhub` = 1 AND `id` = %d AND `uid` = %d AND `blocked` = 0 LIMIT 1",
intval($contact_id),
intval($importer['uid'])
);
diff --git a/update.php b/update.php
index 6b0bc770e..5d2210107 100644
--- a/update.php
+++ b/update.php
@@ -29,4 +29,8 @@ function update_1003() {
q("ALTER TABLE `contact` ADD `hub-verify` CHAR( 255 ) NOT NULL AFTER `usehub`");
q("ALTER TABLE `contact` ADD INDEX ( `uid` ) , ADD INDEX ( `self` ), ADD INDEX ( `issued-id` ), ADD INDEX ( `dfrn-id` )");
q("ALTER TABLE `contact` ADD INDEX ( `blocked` ), ADD INDEX ( `readonly` )");
+}
+
+function update_1004() {
+ q("ALTER TABLE `contact` ADD `subhub` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `usehub`");
} \ No newline at end of file