From 6631540d20068d3c4ee221518e8f430507662e27 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 22 Mar 2015 12:55:13 -0700 Subject: provide visual feedback when deleting a like by liking it again. --- mod/like.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'mod/like.php') 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) -- cgit v1.2.3