Prevent unfollowing contacts from networks not supported natively
This commit is contained in:
parent
804cfa0320
commit
92c4ca0911
|
@ -39,20 +39,18 @@ function unfollow_post()
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contact['network'] == Protocol::STATUSNET) {
|
if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
|
||||||
notice(L10n::t('Unfollowing is currently not supported by your network.'));
|
notice(L10n::t('Unfollowing is currently not supported by your network.'));
|
||||||
goaway($return_url);
|
goaway($return_url);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($contact['network'], [Protocol::OSTATUS, Protocol::DIASPORA, Protocol::DFRN])) {
|
$r = q("SELECT `contact`.*, `user`.* FROM `contact` INNER JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
||||||
$r = q("SELECT `contact`.*, `user`.* FROM `contact` INNER JOIN `user` ON `contact`.`uid` = `user`.`uid`
|
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
|
||||||
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
|
intval($uid)
|
||||||
intval($uid)
|
);
|
||||||
);
|
if (DBA::isResult($r)) {
|
||||||
if (DBA::isResult($r)) {
|
Contact::terminateFriendship($r[0], $contact);
|
||||||
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
|
||||||
|
@ -92,7 +90,7 @@ function unfollow_content(App $a)
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contact['network'] == Protocol::STATUSNET) {
|
if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
|
||||||
notice(L10n::t('Unfollowing is currently not supported by your network.'));
|
notice(L10n::t('Unfollowing is currently not supported by your network.'));
|
||||||
goaway('contacts/' . $contact['id']);
|
goaway('contacts/' . $contact['id']);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
|
|
Loading…
Reference in New Issue
Block a user