From: Zach Prezkuta Date: Fri, 13 Jul 2012 15:09:01 +0000 (-0600) Subject: allow live updates for unlikes and undislikes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=88711deceb1f3c1187c6aa649adcfdeed45a9016;p=friendica.git allow live updates for unlikes and undislikes --- diff --git a/js/main.js b/js/main.js index 885e042aa3..a5ce894601 100644 --- a/js/main.js +++ b/js/main.js @@ -357,9 +357,9 @@ function dolike(ident,verb) { unpause(); $('#like-rotator-' + ident.toString()).show(); - $.get('like/' + ident.toString() + '?verb=' + verb ); - if(timer) clearTimeout(timer); - timer = setTimeout(NavUpdate,3000); + $.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate ); +// if(timer) clearTimeout(timer); +// timer = setTimeout(NavUpdate,3000); liking = 1; } diff --git a/mod/like.php b/mod/like.php index 8fe0cf7353..aaa85928c7 100755 --- a/mod/like.php +++ b/mod/like.php @@ -117,7 +117,7 @@ function like_content(&$a) { $like_item = $r[0]; // Already voted, undo it - $r = q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1", + $r = q("UPDATE `item` SET `deleted` = 1, `unseen` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1", dbesc(datetime_convert()), intval($like_item['id']) ); diff --git a/mod/network.php b/mod/network.php index 5f009dacd1..3d8fa7c144 100644 --- a/mod/network.php +++ b/mod/network.php @@ -616,7 +616,8 @@ function network_content(&$a, $update = 0) { if($update) { $r = q("SELECT `parent` AS `item_id`, `contact`.`uid` AS `contact_uid` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 + WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND + (`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "') and `item`.`moderated` = 0 and `item`.`unseen` = 1 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 $sql_extra3 $sql_extra $sql_nets ", diff --git a/mod/profile.php b/mod/profile.php index 24e03d6eac..b142943c1e 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -204,6 +204,8 @@ function profile_content(&$a, $update = 0) { $r = q("SELECT distinct(parent) AS `item_id`, `contact`.`uid` AS `contact-uid` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` + WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND + (`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "') WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0 and `item`.`unseen` = 1 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0