aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xboot.php7
-rw-r--r--install/database.sql4
-rw-r--r--install/update.php10
-rw-r--r--mod/connect.php3
-rw-r--r--mod/zfinger.php12
5 files changed, 30 insertions, 6 deletions
diff --git a/boot.php b/boot.php
index 2323e302c..eeddf8162 100755
--- a/boot.php
+++ b/boot.php
@@ -43,7 +43,7 @@ require_once('include/taxonomy.php');
define ( 'RED_PLATFORM', 'Red Matrix' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1063 );
+define ( 'DB_UPDATE_VERSION', 1064 );
define ( 'EOL', '<br />' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@@ -190,13 +190,10 @@ define ( 'PAGE_HIDDEN', 0x0001 );
define ( 'PAGE_AUTOCONNECT', 0x0002 );
define ( 'PAGE_APPLICATION', 0x0004 );
define ( 'PAGE_DIRECTORY_CHANNEL', 0x0008 ); // system channel used for directory synchronisation
+define ( 'PAGE_PREMIUM', 0x0010 );
define ( 'PAGE_REMOVED', 0x8000 );
-//define ( 'PAGE_FREELOVE', 3 );
-//define ( 'PAGE_BLOG', 4 );
-//define ( 'PAGE_PRVGROUP', 5 );
-
/**
* Photo types
diff --git a/install/database.sql b/install/database.sql
index cefb081d1..dbffbf59b 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -926,6 +926,8 @@ CREATE TABLE IF NOT EXISTS `xchan` (
`xchan_addr` char(255) NOT NULL DEFAULT '',
`xchan_url` char(255) NOT NULL DEFAULT '',
`xchan_connurl` char(255) NOT NULL DEFAULT '',
+ `xchan_follow` char(255) NOT NULL DEFAULT '',
+ `xchan_connpage` char(255) NOT NULL DEFAULT '',
`xchan_name` char(255) NOT NULL DEFAULT '',
`xchan_network` char(255) NOT NULL DEFAULT '',
`xchan_instance_url` char(255) NOT NULL DEFAULT '',
@@ -940,6 +942,8 @@ CREATE TABLE IF NOT EXISTS `xchan` (
KEY `xchan_url` (`xchan_url`),
KEY `xchan_flags` (`xchan_flags`),
KEY `xchan_connurl` (`xchan_connurl`),
+ KEY `xchan_follow` (`xchan_follow`),
+ KEY `xchan_connpage` (`xchan_connpage`),
KEY `xchan_instance_url` (`xchan_instance_url`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
diff --git a/install/update.php b/install/update.php
index c5eaa4f19..9beb25254 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1063 );
+define( 'UPDATE_VERSION' , 1064 );
/**
*
@@ -742,3 +742,11 @@ KEY `pelm_result` (`pelm_result`)
return UPDATE_FAILED;
}
+function update_r1063() {
+ $r = q("ALTER TABLE `xchan` ADD `xchan_follow` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `xchan_connurl` ,
+ADD `xchan_connpage` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `xchan_follow` ,
+ADD INDEX ( `xchan_follow` ), ADD INDEX ( `xchan_connpage`) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
diff --git a/mod/connect.php b/mod/connect.php
new file mode 100644
index 000000000..21d461c19
--- /dev/null
+++ b/mod/connect.php
@@ -0,0 +1,3 @@
+<?php /** @file */
+
+// Placeholder for channel sell pages
diff --git a/mod/zfinger.php b/mod/zfinger.php
index cf61233ad..d5b750537 100644
--- a/mod/zfinger.php
+++ b/mod/zfinger.php
@@ -71,6 +71,8 @@ function zfinger_init(&$a) {
$id = $e['channel_id'];
+ $special_channel = (($e['channel_pageflags'] & PAGE_PREMIUM) ? true : false);
+
$searchable = (($e['channel_pageflags'] & PAGE_HIDDEN) ? false : true);
if($e['xchan_flags'] & XCHAN_FLAGS_HIDDEN)
$searchable = false;
@@ -134,6 +136,16 @@ function zfinger_init(&$a) {
$ret['searchable'] = $searchable;
+ // premium or other channel desiring some contact with potential followers before connecting.
+ // This is a template - %s will be replaced with the follow_url we discover for the return channel.
+
+ if($special_channel)
+ $ret['connect_url'] = z_root() . '/connect/' . $e['channel_address'] . '?f=&follow=%s';
+
+ // This is a template for our follow url, %s will be replaced with a webbie
+
+ $ret['follow_url'] = z_root() . '/follow?f=&url=%s';
+
$permissions = get_all_perms($e['channel_id'],(($ztarget && $zsig)
? base64url_encode(hash('whirlpool',$ztarget . $zsig,true))
: '' ),false);