aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-10-31 16:55:19 -0700
committerfriendica <info@friendica.com>2012-10-31 16:55:19 -0700
commit62a8298b549c8985a7817be046d7e25cbaf17cb5 (patch)
tree1d2a3de819567e3121f2035a03db47fcc8ed6295 /mod
parentfb173900a16938c3ab7f066e4909d50b9f764473 (diff)
downloadvolse-hubzilla-62a8298b549c8985a7817be046d7e25cbaf17cb5.tar.gz
volse-hubzilla-62a8298b549c8985a7817be046d7e25cbaf17cb5.tar.bz2
volse-hubzilla-62a8298b549c8985a7817be046d7e25cbaf17cb5.zip
starting on pinging the basic elements of federation and communication
Diffstat (limited to 'mod')
-rw-r--r--mod/abook.php18
-rw-r--r--mod/follow.php6
-rw-r--r--mod/zfinger.php4
3 files changed, 17 insertions, 11 deletions
diff --git a/mod/abook.php b/mod/abook.php
index fe0be80aa..51cebd160 100644
--- a/mod/abook.php
+++ b/mod/abook.php
@@ -24,6 +24,7 @@ function abook_init(&$a) {
}
else {
$abook_id = 0;
+ }
}
if($abook_id) {
@@ -426,8 +427,7 @@ EOT;
$search = ((x($_REQUEST,'search')) ? notags(trim($_REQUEST['search'])) : '');
-
-// $nets = ((x($_GET,'nets')) ? notags(trim($_GET['nets'])) : '');
+ $nets = ((x($_GET,'nets')) ? notags(trim($_GET['nets'])) : '');
$tabs = array(
array(
@@ -498,17 +498,21 @@ EOT;
// $sql_extra2 = ((($sort_type > 0) && ($sort_type <= CONTACT_IS_FRIEND)) ? sprintf(" AND `rel` = %d ",intval($sort_type)) : '');
- $r = q("SELECT COUNT(*) AS `total` FROM `contact`
- WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ",
- intval($_SESSION['uid']));
+ $r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash
+ where abook_channel = %d and not (abook_flags & %d) $sql_extra $sql_extra2 ",
+ intval(local_user()),
+ intval(ABOOK_FLAG_SELF)
+ );
if(count($r)) {
$a->set_pager_total($r[0]['total']);
$total = $r[0]['total'];
}
- $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ORDER BY `name` ASC LIMIT %d , %d ",
- intval($_SESSION['uid']),
+ $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook.abook_chan = xchan.xchan_hash
+ WHERE abook_channel = %d and not (abook_flags & %d) $sql_extra $sql_extra2 ORDER BY xchan_name LIMIT %d , %d ",
+ intval(local_user()),
+ intval(ABOOK_FLAG_SELF),
intval($a->pager['start']),
intval($a->pager['itemspage'])
);
diff --git a/mod/follow.php b/mod/follow.php
index 5e48174c9..0b222e505 100644
--- a/mod/follow.php
+++ b/mod/follow.php
@@ -24,10 +24,10 @@ function follow_init(&$a) {
goaway($return_url);
}
- info( t('Contact added') . EOL);
+ info( t('Channel added') . EOL);
- if(strstr($return_url,'contacts'))
- goaway($a->get_baseurl() . '/contacts/' . $contact_id);
+ if(strstr($return_url,'channel'))
+ goaway($a->get_baseurl() . '/channel/' . $result['channel_id']);
goaway($return_url);
// NOTREACHED
diff --git a/mod/zfinger.php b/mod/zfinger.php
index e76255032..2ae265df7 100644
--- a/mod/zfinger.php
+++ b/mod/zfinger.php
@@ -67,8 +67,10 @@ function zfinger_init(&$a) {
$ret['hubs'][] = array(
'primary' => (($hub['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) ? true : false),
'url' => $hub['hubloc_url'],
+ 'url_sig' => $hub['hubloc_url_sig'],
/// hmmm we probably shouldn't sign somebody else's hub. FIXME
- 'url_sig' => base64url_encode(rsa_sign($hub['hubloc_url'],$e['channel_prvkey'])),
+ 'url_sig2' => base64url_encode(rsa_sign($hub['hubloc_url'],$e['channel_prvkey'])),
+ 'host' => $hub['hubloc_host'],
'callback' => $hub['hubloc_callback'],
'sitekey' => $hub['hubloc_sitekey']
);