diff options
author | friendica <info@friendica.com> | 2015-03-22 12:55:13 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-03-22 12:55:13 -0700 |
commit | 6631540d20068d3c4ee221518e8f430507662e27 (patch) | |
tree | 4a8430ae2063d1e9397cce6315dd5b3fa691366a /mod/like.php | |
parent | 1b17b0193ec08936b5485216ba6bbe9a46ede187 (diff) | |
download | volse-hubzilla-6631540d20068d3c4ee221518e8f430507662e27.tar.gz volse-hubzilla-6631540d20068d3c4ee221518e8f430507662e27.tar.bz2 volse-hubzilla-6631540d20068d3c4ee221518e8f430507662e27.zip |
provide visual feedback when deleting a like by liking it again.
Diffstat (limited to 'mod/like.php')
-rwxr-xr-x | mod/like.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mod/like.php b/mod/like.php index dc4531fbb..cfd848636 100755 --- a/mod/like.php +++ b/mod/like.php @@ -303,7 +303,7 @@ function like_content(&$a) { $multi_undo = 1; } - $r = q("SELECT id FROM item WHERE verb in ( $verbs ) AND item_restrict = 0 + $r = q("SELECT id, parent, uid 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), @@ -316,6 +316,12 @@ function like_content(&$a) { require_once('include/items.php'); foreach($r as $rr) { drop_item($rr['id'],false,DROPITEM_PHASE1); + // set the changed timestamp on the parent so we'll see the update without a page reload + $z = q("update item set changed = '%s' where id = %d and uid = %d", + dbesc(datetime_convert()), + intval($rr['parent']), + intval($rr['uid']) + ); } if($interactive) |