Use User::getOwnerDataById in mod/unfollow
This commit is contained in:
parent
e25c579c76
commit
76b40cf05e
1 changed files with 4 additions and 6 deletions
|
@ -10,6 +10,7 @@ use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
|
use Friendica\Model\User;
|
||||||
|
|
||||||
function unfollow_post()
|
function unfollow_post()
|
||||||
{
|
{
|
||||||
|
@ -45,12 +46,9 @@ function unfollow_post()
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("SELECT `contact`.*, `user`.* FROM `contact` INNER JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
$owner = User::getOwnerDataById($uid);
|
||||||
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
|
if ($owner) {
|
||||||
intval($uid)
|
Contact::terminateFriendship($owner, $contact);
|
||||||
);
|
|
||||||
if (DBA::isResult($r)) {
|
|
||||||
Contact::terminateFriendship($r[0], $contact);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sharing-only contacts get deleted as there no relationship any more
|
// Sharing-only contacts get deleted as there no relationship any more
|
||||||
|
|
Loading…
Reference in a new issue