Improvements for following/unfollowing of Diaspora and OStatus

This commit is contained in:
Michael 2017-09-23 14:48:27 +00:00
commit 8983dcaa77
4 changed files with 24 additions and 18 deletions

View file

@ -348,7 +348,16 @@ function _contact_archive($contact_id, $orig_record) {
function _contact_drop($contact_id, $orig_record) {
$a = get_app();
terminate_friendship($a->user,$a->contact,$orig_record);
$r = q("SELECT `contact`.*, `user`.* FROM `contact` INNER JOIN `user` ON `contact`.`uid` = `user`.`uid`
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
intval($a->user['uid'])
);
if (!dbm::is_result($r)) {
return;
}
$self = ""; // Unused parameter
terminate_friendship($r[0], $self, $orig_record);
contact_remove($orig_record['id']);
}

View file

@ -32,7 +32,7 @@ function unfollow_post(App $a) {
if (!dbm::is_result($contact)) {
notice(t("Contact wasn't found or can't be unfollowed."));
} else {
if (in_array($contact['network'], array(NETWORK_OSTATUS))) {
if (in_array($contact['network'], array(NETWORK_OSTATUS, NETWORK_DIASPORA))) {
$r = q("SELECT `contact`.*, `user`.* FROM `contact` INNER JOIN `user` ON `contact`.`uid` = `user`.`uid`
WHERE `user`.`uid` = %d AND `contact`.`self` LIMIT 1",
intval($uid)