aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-10 20:08:07 -0800
committerfriendica <info@friendica.com>2012-11-10 20:08:07 -0800
commitdd00fcc7bb3a3b50bd453fddb9a88b7f74d24140 (patch)
tree60974b787b3b929e939866fa6c311e4d48684168 /mod
parentff40eabb7a45c0d012c82d1f629ae599f326d312 (diff)
downloadvolse-hubzilla-dd00fcc7bb3a3b50bd453fddb9a88b7f74d24140.tar.gz
volse-hubzilla-dd00fcc7bb3a3b50bd453fddb9a88b7f74d24140.tar.bz2
volse-hubzilla-dd00fcc7bb3a3b50bd453fddb9a88b7f74d24140.zip
starting to get into the hairy parts of zot - identity, location, and permission synchronisation. After this, messaging should be a piece of cake.
Diffstat (limited to 'mod')
-rw-r--r--mod/post.php35
-rw-r--r--mod/zfinger.php6
2 files changed, 28 insertions, 13 deletions
diff --git a/mod/post.php b/mod/post.php
index a33c44e57..ef94c9b5d 100644
--- a/mod/post.php
+++ b/mod/post.php
@@ -13,18 +13,33 @@ function post_post(&$a) {
$msgtype = ((x($_REQUEST,'type')) ? $_REQUEST['type'] : '');
- if($msgtype === 'notify') {
-
- $hub = zot_gethub($_REQUEST);
- if(! $hub) {
- $result = zot_register_hub($_REQUEST);
- if((! $result) || (! zot_gethub($_REQUEST))) {
- $ret['message'] = 'Hub not available.';
- json_return_and_die($ret);
- }
+ $hub = zot_gethub($_REQUEST);
+ if(! $hub) {
+ $result = zot_register_hub($_REQUEST);
+ if((! $result) || (! zot_gethub($_REQUEST))) {
+ $ret['message'] = 'Hub not available.';
+ json_return_and_die($ret);
}
+ }
+
+ // check which hub is primary and take action if mismatched
+
+
+ if($msgtype === 'refresh') {
+
+ // Need to pass the recipient in the message
+
+ // look up recipient
+
+ // format args
+ // $r = zot_refresh($them,$channel);
+
+ return;
+
+ }
+
+ if($msgtype === 'notify') {
- // check which hub is primary and take action if mismatched
// add to receive queue
// qreceive_add($_REQUEST);
diff --git a/mod/zfinger.php b/mod/zfinger.php
index 80411d16c..cc4b8cdd3 100644
--- a/mod/zfinger.php
+++ b/mod/zfinger.php
@@ -7,7 +7,7 @@ function zfinger_init(&$a) {
$ret = array('success' => false);
- $zguid = ((x($_REQUEST,'guid')) ? $_REQUEST['guid'] : '');
+ $zhash = ((x($_REQUEST,'guid_hash')) ? $_REQUEST['guid_hash'] : '');
$zaddr = ((x($_REQUEST,'address')) ? $_REQUEST['address'] : '');
$ztarget = ((x($_REQUEST,'target')) ? $_REQUEST['target'] : '');
$zsig = ((x($_REQUEST,'target_sig')) ? $_REQUEST['target_sig'] : '');
@@ -25,8 +25,8 @@ function zfinger_init(&$a) {
if(strlen($zguid)) {
$r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash
- where channel_guid = '%s' limit 1",
- dbesc($zguid)
+ where channel_hash = '%s' limit 1",
+ dbesc($zhash)
);
}
elseif(strlen($zaddr)) {