From: Michael Vogel Date: Wed, 13 Apr 2016 20:21:23 +0000 (+0200) Subject: Bugfix: "default_group" behaviour wasn't implemented correctly X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=535f382c4ef81d92d6d867dec6c8f57ebbff61bc;p=friendica.git Bugfix: "default_group" behaviour wasn't implemented correctly --- 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);