Index: blog_reactions.module
===================================================================
--- blog_reactions.module	(Revision 122)
+++ blog_reactions.module	(Arbeitskopie)
@@ -156,7 +156,7 @@
  */
 function blog_reactions_set_items($reactions = array()) {
   foreach ($reactions as $key => $item) {
-    $exists = blog_reactions_item_exists($item->brid);
+    $exists = blog_reactions_item_exists($item);
     if ($exists) {
       blog_reactions_update_item($item);
     }
@@ -188,10 +188,14 @@
 }
 
 /**
- * Load single reaction item
+ * Checks whether this blog reaction already exists.
  */
-function blog_reactions_item_exists($brid) {
-  $result = db_result(db_query("SELECT COUNT(brid) as count FROM {blog_reactions} WHERE brid='%s'", $brid));
+function blog_reactions_item_exists($item) {
+  $brid = $item->brid;
+  $href = $item->href;
+  $result_brid = db_result(db_query_range("SELECT COUNT(brid) as count FROM {blog_reactions} WHERE brid='%s'", $brid, 0, 1));
+  $result_href = db_result(db_query_range("SELECT COUNT(brid) as count FROM {blog_reactions} WHERE href='%s'", $href, 0, 1));
+  $result = $result_brid || $result_href;
   return $result ? TRUE : FALSE;
 }
 
@@ -451,4 +455,4 @@
 function theme_blog_reactions_block_item($data) {
   $items[] = l($data->title ? strip_tags($data->title) : 'n/a', url($data->link['href'])) .'<br />'. t('@time ago', array('@time' => format_interval(time() - $data->published)));
   return theme('item_list', $items);
-}
\ No newline at end of file
+}
