From 295b865d065b12c6686592bd34739ac9d9b87978 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 6 Nov 2012 18:13:47 -0800 Subject: "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. --- include/follow.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'include/follow.php') 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 -- cgit v1.2.3