allow complete undo of a vote, not just a change of vote

This commit is contained in:
friendica 2015-03-22 14:55:41 -07:00
parent b198cf69cd
commit f5f194c92b

View File

@ -303,7 +303,7 @@ function like_content(&$a) {
$multi_undo = 1;
}
$r = q("SELECT id, parent, uid FROM item WHERE verb in ( $verbs ) AND item_restrict = 0
$r = q("SELECT id, parent, uid, verb FROM item WHERE verb in ( $verbs ) AND item_restrict = 0
AND author_xchan = '%s' AND ( parent = %d OR thr_parent = '%s') and uid = %d ",
dbesc($observer['xchan_hash']),
intval($item_id),
@ -322,6 +322,10 @@ function like_content(&$a) {
intval($rr['parent']),
intval($rr['uid'])
);
// Prior activity was a duplicate of the one we're submitting, just undo it;
// don't fall through and create another
if(activity_match($rr['verb'],$activity))
$multi_undo = false;
}
if($interactive)