Improvements for following/unfollowing of Diaspora and OStatus
This commit is contained in:
parent
dd45dcbef3
commit
8983dcaa77
4 changed files with 24 additions and 18 deletions
|
@ -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']);
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue