aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-02-07 14:49:09 -0800
committerfriendica <info@friendica.com>2013-02-07 14:49:09 -0800
commitce2fd234618366d13c8ba6991c2f2b1d88d36c90 (patch)
tree3c98dab1ee1365e68f27f6a25d49396b66d92df6
parent1e665f4da10dcd948241994a64f325c45762049a (diff)
downloadvolse-hubzilla-ce2fd234618366d13c8ba6991c2f2b1d88d36c90.tar.gz
volse-hubzilla-ce2fd234618366d13c8ba6991c2f2b1d88d36c90.tar.bz2
volse-hubzilla-ce2fd234618366d13c8ba6991c2f2b1d88d36c90.zip
this should fix the auto-friend stuff
-rw-r--r--include/zot.php8
-rw-r--r--mod/connections.php1
2 files changed, 6 insertions, 3 deletions
diff --git a/include/zot.php b/include/zot.php
index 5afa9d496..31974a8c6 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -272,8 +272,9 @@ function zot_refresh($them,$channel = null) {
intval($channel['channel_id']),
intval(ABOOK_FLAG_SELF)
);
+
if($r) {
- $y = q("update abook set abook_their_perms = %d
+ $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),
@@ -291,8 +292,9 @@ function zot_refresh($them,$channel = null) {
intval($channel['channel_id']),
intval(ABOOK_FLAG_SELF)
);
+
if($z)
- $default_perms = intval($z[0]['my_perms']);
+ $default_perms = intval($z[0]['abook_my_perms']);
$y = q("insert into abook ( abook_account, abook_channel, abook_xchan, abook_their_perms, abook_my_perms, abook_created, abook_updated, abook_flags ) values ( %d, %d, '%s', %d, %d, '%s', '%s', %d )",
intval($channel['channel_account_id']),
@@ -304,7 +306,9 @@ function zot_refresh($them,$channel = null) {
dbesc(datetime_convert()),
intval(($default_perms) ? 0 : ABOOK_FLAG_PENDING)
);
+
if($y) {
+
logger("New introduction received for {$channel['channel_name']}");
if($default_perms) {
// send back a permissions update for auto-friend/auto-permissions
diff --git a/mod/connections.php b/mod/connections.php
index 158d2fd23..f16c13bab 100644
--- a/mod/connections.php
+++ b/mod/connections.php
@@ -113,7 +113,6 @@ function connections_post(&$a) {
else
notice( t('Failed to update connection record.') . EOL);
-
if((x($a->data,'abook')) && $a->data['abook']['abook_my_perms'] != $abook_my_perms
&& (! ($a->data['abook']['abook_flags'] & ABOOK_FLAG_SELF))) {
proc_run('php', 'include/notifier.php', 'permission_update', $contact_id);