From d6a79abb68aeaecf19fbdfceae63196d5d3f1ba6 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 e3a3dcd78..1ceeef605 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 d0411a466..2461bf035 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);