diff options
author | Simon L'nu <simon.lnu@gmail.com> | 2012-03-06 14:51:14 -0500 |
---|---|---|
committer | Simon L'nu <simon.lnu@gmail.com> | 2012-03-06 14:51:14 -0500 |
commit | d647dbc6af33689d0baf4bafd72031d06dcf7577 (patch) | |
tree | afd4db159aa0b36bdb1e8f17581283843bd9bcd5 /include/items.php | |
parent | 2a3aaca88ded68a8ce926577d3faea2f3ef0ab50 (diff) | |
parent | a9690dfe2d9358fcbb156644df2d12099ff798c4 (diff) | |
download | volse-hubzilla-d647dbc6af33689d0baf4bafd72031d06dcf7577.tar.gz volse-hubzilla-d647dbc6af33689d0baf4bafd72031d06dcf7577.tar.bz2 volse-hubzilla-d647dbc6af33689d0baf4bafd72031d06dcf7577.zip |
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master:
remove "smilie" expansion for Diaspora logo
prevent duplicate likes
quattro: theme settings (a bit hackish)
add img
fixes in diabook
finalise spam storage model, begin driver changes.
fixes
template proc: add variable filters
* master:
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php index 3c55fbb4f..fdff6b642 100755 --- a/include/items.php +++ b/include/items.php @@ -1595,6 +1595,14 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) if((activity_match($datarray['verb'],ACTIVITY_LIKE)) || (activity_match($datarray['verb'],ACTIVITY_DISLIKE))) { $datarray['type'] = 'activity'; $datarray['gravity'] = GRAVITY_LIKE; + // only one like or dislike per person + $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1", + intval($datarray['uid']), + intval($datarray['contact-id']), + dbesc($datarray['verb']) + ); + if($r && count($r)) + continue; } if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) { @@ -2148,6 +2156,14 @@ function local_delivery($importer,$data) { $datarray['type'] = 'activity'; $datarray['gravity'] = GRAVITY_LIKE; $datarray['last-child'] = 0; + // only one like or dislike per person + $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1", + intval($datarray['uid']), + intval($datarray['contact-id']), + dbesc($datarray['verb']) + ); + if($r && count($r)) + continue; } if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) { @@ -2297,6 +2313,15 @@ function local_delivery($importer,$data) { if(($datarray['verb'] == ACTIVITY_LIKE) || ($datarray['verb'] == ACTIVITY_DISLIKE)) { $datarray['type'] = 'activity'; $datarray['gravity'] = GRAVITY_LIKE; + // only one like or dislike per person + $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1", + intval($datarray['uid']), + intval($datarray['contact-id']), + dbesc($datarray['verb']) + ); + if($r && count($r)) + continue; + } if(($datarray['verb'] === ACTIVITY_TAG) && ($datarray['object-type'] === ACTIVITY_OBJ_TAGTERM)) { |