aboutsummaryrefslogtreecommitdiffstats
path: root/include/follow.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-06 18:13:47 -0800
committerfriendica <info@friendica.com>2012-11-06 18:13:47 -0800
commit295b865d065b12c6686592bd34739ac9d9b87978 (patch)
tree1f00cafdc2e4867bd53af98985eb410b17d98d0b /include/follow.php
parent55df0452b60d6faf00b782a03c8cc590f08d8f94 (diff)
downloadvolse-hubzilla-295b865d065b12c6686592bd34739ac9d9b87978.tar.gz
volse-hubzilla-295b865d065b12c6686592bd34739ac9d9b87978.tar.bz2
volse-hubzilla-295b865d065b12c6686592bd34739ac9d9b87978.zip
"follow" now creates an address book entry, which means we can start tying that into the "connections" module - still have to turn the "contact edit" page from a mockup to real code, but it's all starting to flow.
Diffstat (limited to 'include/follow.php')
-rw-r--r--include/follow.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/follow.php b/include/follow.php
index b3591b8ba..686282624 100644
--- a/include/follow.php
+++ b/include/follow.php
@@ -73,6 +73,8 @@ function new_contact($uid,$url,$channel,$interactive = false) {
if(! $x['success'])
return $x;
+ $xchan_hash = $x['hash'];
+
// Do we already have an abook entry?
// go directly to the abook edit page.
@@ -100,10 +102,20 @@ function new_contact($uid,$url,$channel,$interactive = false) {
}
+ $r = q("insert into abook ( abook_account, abook_channel, abook_xchan, abook_their_perms, abook_created, abook_updated )
+ values( %d, %d, '%s', %d, '%s', '%s' ) ",
+ intval(get_account_id()),
+ intval(local_user()),
+ dbesc($xchan_hash),
+ intval($their_perms),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert())
+ );
+ if(! $r)
+ logger('mod_follow: abook creation failed');
+
- // Else create an entry
-
// Then send a ping/message to the other side