aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-29 18:15:13 -0800
committerfriendica <info@friendica.com>2012-11-29 18:15:13 -0800
commit7082d198c299debf633436c3fea0c0873de73199 (patch)
treedf7096f672e28186303b6c032f9ff76a6a300ef0 /include
parente1380525841509ae9bf05c11bf27f655567e63ae (diff)
downloadvolse-hubzilla-7082d198c299debf633436c3fea0c0873de73199.tar.gz
volse-hubzilla-7082d198c299debf633436c3fea0c0873de73199.tar.bz2
volse-hubzilla-7082d198c299debf633436c3fea0c0873de73199.zip
Now if you follow somebody it will create an abook entry on the other site with blocked,ignored, and pending set. No "friend notifications" yet.
Diffstat (limited to 'include')
-rw-r--r--include/notifier.php4
-rw-r--r--include/zot.php36
2 files changed, 31 insertions, 9 deletions
diff --git a/include/notifier.php b/include/notifier.php
index 21f587708..da3cf35a6 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -42,7 +42,7 @@ require_once('include/html2plain.php');
* and ITEM_ID is the id of the item in the database that needs to be sent to others.
*
* ZOT
- * permission_updated abook_id
+ * permission_update abook_id
* relay item_id (item was relayed to owner, we will deliver it as owner)
*
*/
@@ -114,6 +114,8 @@ function notifier_run($argv, $argc){
}
}
}
+
+ return;
}
diff --git a/include/zot.php b/include/zot.php
index 318948ccc..88568f09f 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -248,18 +248,38 @@ function zot_refresh($them,$channel = null) {
$their_perms = $their_perms | intval($global_perms[$k][1]);
}
}
-
- $r = q("update abook set abook_their_perms = %d
- where abook_xchan = '%s' and abook_channel = %d
- and not (abook_flags & %d) limit 1",
- intval($their_perms),
+dbg(1);
+ $r = q("select * from abook where abook_xchan = '%s' and abook_channel = %d and not (abook_flags & %d) limit 1",
dbesc($x['hash']),
intval($channel['channel_id']),
intval(ABOOK_FLAG_SELF)
);
-
- if(! $r)
- logger('abook update failed');
+ if($r) {
+ $y = q("update abook set abook_their_perms = %d
+ where abook_xchan = '%s' and abook_channel = %d
+ and not (abook_flags & %d) limit 1",
+ intval($their_perms),
+ dbesc($x['hash']),
+ intval($channel['channel_id']),
+ intval(ABOOK_FLAG_SELF)
+ );
+ if(! $y)
+ logger('abook update failed');
+ }
+ else {
+ $y = q("insert into abook ( abook_account, abook_channel, abook_xchan, abook_their_perms, abook_created, abook_updated, abook_flags ) values ( %d, %d, '%s', %d, '%s', '%s', %d )",
+ intval($channel['channel_account_id']),
+ intval($channel['channel_id']),
+ dbesc($x['hash']),
+ intval($their_perms),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ intval(ABOOK_FLAG_BLOCKED|ABOOK_FLAG_IGNORED|ABOOK_FLAG_PENDING)
+ );
+ if($y)
+ logger("New introduction received for {$channel['channel_name']}");
+ }
+dbg(0);
}
return true;