+ return false;
+}
+
+/**
+ * @brief Checks for users who should be notified
+ *
+ * @param int $itemid ID of the item for which the check should be done
+ */
+function check_user_notification($itemid) {
+ // fetch all users in the thread
+ $users = dba::p("SELECT DISTINCT(`contact`.`uid`) FROM `item`
+ INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` != 0
+ WHERE `parent` IN (SELECT `parent` FROM `item` WHERE `id`=?)", $itemid);
+ while ($user = dba::fetch($users)) {
+ check_item_notification($itemid, $user['uid']);
+ }
+ dba::close($users);