From 535f382c4ef81d92d6d867dec6c8f57ebbff61bc Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 13 Apr 2016 22:21:23 +0200 Subject: [PATCH] Bugfix: "default_group" behaviour wasn't implemented correctly --- include/diaspora.php | 8 +++----- include/follow.php | 5 ++--- include/items.php | 12 ++++++------ mod/dfrn_confirm.php | 5 ++--- mod/dfrn_request.php | 10 ++++------ 5 files changed, 17 insertions(+), 23 deletions(-) diff --git a/include/diaspora.php b/include/diaspora.php index e3a3dcd78c..1ceeef605e 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -1819,12 +1819,10 @@ class diaspora { return; } - $g = q("SELECT `def_gid` FROM `user` WHERE `uid` = %d LIMIT 1", - intval($importer["uid"]) - ); + $def_gid = get_default_group($importer['uid'], $ret["network"]); - if($g && intval($g[0]["def_gid"])) - group_add_member($importer["uid"], "", $contact_record["id"], $g[0]["def_gid"]); + if(intval($def_gid)) + group_add_member($importer["uid"], "", $contact_record["id"], $def_gid); if($importer["page-flags"] == PAGE_NORMAL) { diff --git a/include/follow.php b/include/follow.php index d0411a466a..2461bf0356 100644 --- a/include/follow.php +++ b/include/follow.php @@ -1,6 +1,7 @@ get_baseurl()."/contacts/".$r[0]['id']; } else $forwardurl = $a->get_baseurl()."/contacts"; @@ -394,10 +394,8 @@ function dfrn_request_post(&$a) { $contact_id = $r[0]['id']; $def_gid = get_default_group($uid, $r[0]["network"]); - if (intval($def_gid)) { - require_once('include/group.php'); + if (intval($def_gid)) group_add_member($uid, '', $contact_id, $def_gid); - } $photo = avatar_img($addr); -- 2.39.5