+ /**
+ * @brief Find the best importer for a comment
+ *
+ * @param array $importer Array of the importer user
+ * @param string $guid The guid of the item
+ *
+ * @return array the importer that fits the best
+ */
+ private static function importer_for_comment($importer, $guid) {
+ $item = dba::fetch_first("SELECT `uid` FROM `item` WHERE `origin` AND `guid` = ? LIMIT 1", $guid);
+
+ if (dbm::is_result($item)) {
+ logger("Found user ".$item['uid']." as owner of item ".$guid, LOGGER_DEBUG);
+ $contact = dba::fetch_first("SELECT * FROM `contact` WHERE `self` AND `uid` = ?", $item['uid']);
+ if (dbm::is_result($contact)) {
+ $importer = $contact;
+ }
+ }
+ return $importer;
+ }
+