aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-03-25 21:32:12 -0700
committerfriendica <info@friendica.com>2013-03-25 21:32:12 -0700
commit884812bcbadc5ecdc7a38a10abfa5045667f7d2c (patch)
tree06c1f5eb973b5423e5726ae7106463571010cb4b /include/zot.php
parentd0133d6f8720d927e904f1a65706cbc83726788a (diff)
downloadvolse-hubzilla-884812bcbadc5ecdc7a38a10abfa5045667f7d2c.tar.gz
volse-hubzilla-884812bcbadc5ecdc7a38a10abfa5045667f7d2c.tar.bz2
volse-hubzilla-884812bcbadc5ecdc7a38a10abfa5045667f7d2c.zip
doco
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php61
1 files changed, 60 insertions, 1 deletions
diff --git a/include/zot.php b/include/zot.php
index 7c54e5239..78978bbf9 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -47,6 +47,9 @@ function zot_get_hubloc($arr,$primary = false) {
}
+/**
+ * obsolete
+
function zot_notify($channel,$url,$type = 'notify',$recipients = null, $remote_key = null) {
$params = array(
@@ -74,6 +77,9 @@ function zot_notify($channel,$url,$type = 'notify',$recipients = null, $remote_k
$x = z_post_url($url,$params);
return($x);
}
+*/
+
+
/*
*
@@ -117,10 +123,33 @@ function zot_build_packet($channel,$type = 'notify',$recipients = null, $remote_
}
+/**
+ * @function: zot_zot
+ * @param: string $url
+ * @param: array $data
+ *
+ * @returns: array => see z_post_url for returned data format
+ */
+
+
+
function zot_zot($url,$data) {
return z_post_url($url,array('data' => $data));
}
+/**
+ * @function: zot_finger
+ *
+ * Look up information about channel
+ * @param: string $webbie
+ * does not have to be host qualified e.g. 'foo' is treated as 'foo@thishub'
+ * @param: array $channel
+ * (optional), if supplied permissions will be enumerated specifically for $channel
+ *
+ * @returns: array => see z_post_url and mod/zfinger.php
+ */
+
+
function zot_finger($webbie,$channel) {
@@ -191,6 +220,15 @@ function zot_finger($webbie,$channel) {
}
+/**
+ * @function: zot_refresh
+ *
+ * zot_refresh is typically invoked when somebody has changed permissions of a channel and they are notified
+ * to fetch new permissions via a finger operation. This may result in a new connection (abook entry) being added to a local channel
+ * and it may result in auto-permissions being granted.
+ *
+ */
+
function zot_refresh($them,$channel = null) {
logger('zot_refresh: them: ' . print_r($them,true), LOGGER_DATA);
@@ -360,6 +398,15 @@ function zot_refresh($them,$channel = null) {
return false;
}
+/**
+ * @function: zot_gethub
+ *
+ * A guid and a url, both signed by the sender, distinguish a known sender at a known location
+ * This function looks these up to see if the channel is known. If not, we will need to verify it.
+ * @returns: array => hubloc record
+ */
+
+
function zot_gethub($arr) {
@@ -649,6 +696,18 @@ function zot_process_response($hub,$arr,$outq) {
logger('zot_process_response: ' . print_r($x,true), LOGGER_DATA);
}
+/**
+ * @function: zot_fetch
+ *
+ * We received a notification packet (in mod/post.php) that a message is waiting for us, and we've verified the sender.
+ * Now send back a pickup message, using our message tracking ID ($arr['secret']), which we will sign.
+ * The entire pickup message is encrypted with the remote site's public key.
+ * If everything checks out on the remote end, we will receive back a packet containing one or more messages,
+ * which will be processed before returning.
+ *
+ */
+
+
function zot_fetch($arr) {
logger('zot_fetch: ' . print_r($arr,true), LOGGER_DATA);
@@ -657,7 +716,7 @@ function zot_fetch($arr) {
$ret_hub = zot_gethub($arr['sender']);
if(! $ret_hub) {
- logger('zot_fetch: not ret_hub');
+ logger('zot_fetch: no hub: ' . print_r($arr['sender'],true));
return;
}