aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-03-22 14:55:41 -0700
committerfriendica <info@friendica.com>2015-03-22 14:55:41 -0700
commitf5f194c92bf0992b3a24e7b62cf6f9556a6335c4 (patch)
tree94a6be90e816cc03bb401c308de06a50cb340faf /mod
parentb198cf69cdffd801651db12c05e5b4661ebe393f (diff)
downloadvolse-hubzilla-f5f194c92bf0992b3a24e7b62cf6f9556a6335c4.tar.gz
volse-hubzilla-f5f194c92bf0992b3a24e7b62cf6f9556a6335c4.tar.bz2
volse-hubzilla-f5f194c92bf0992b3a24e7b62cf6f9556a6335c4.zip
allow complete undo of a vote, not just a change of vote
Diffstat (limited to 'mod')
-rwxr-xr-xmod/like.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/mod/like.php b/mod/like.php
index cfd848636..d3b6f3ecf 100755
--- a/mod/like.php
+++ b/mod/like.php
@@ -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)