]> git.mxchange.org Git - friendica.git/blobdiff - include/onepoll.php
remote-self: Seting the author name to the owner name
[friendica.git] / include / onepoll.php
index 12fab4c90c0e08dcbb4088cb600edbd497d8624a..9052937fdca03d05bd713107d70b9742edd35389 100644 (file)
@@ -58,9 +58,9 @@ function onepoll_run(&$argv, &$argc){
        }
 
        // Test
-       $lockpath = get_config('system','lockpath');
+       $lockpath = get_lockpath();
        if ($lockpath != '') {
-               $pidfile = new pidfile($lockpath, 'onepoll'.$contact_id.'.lck');
+               $pidfile = new pidfile($lockpath, 'onepoll'.$contact_id);
                if($pidfile->is_already_running()) {
                        logger("onepoll: Already running for contact ".$contact_id);
                        exit;
@@ -112,7 +112,7 @@ function onepoll_run(&$argv, &$argc){
 
        $importer_uid = $contact['uid'];
 
-       $r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` LEFT JOIN `user` on `contact`.`uid` = `user`.`uid` WHERE `user`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
+       $r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` INNER JOIN `user` on `contact`.`uid` = `user`.`uid` WHERE `user`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
                intval($importer_uid)
        );
        if(! count($r))
@@ -330,6 +330,8 @@ function onepoll_run(&$argv, &$argc){
                                                logger("Mail: Parsing mail ".$msg_uid, LOGGER_DATA);
 
                                                $datarray = array();
+                                               $datarray['verb'] = ACTIVITY_POST;
+                                               $datarray['object-type'] = ACTIVITY_OBJ_NOTE;
        //                                      $meta = email_msg_meta($mbox,$msg_uid);
        //                                      $headers = email_msg_headers($mbox,$msg_uid);
 
@@ -423,7 +425,6 @@ function onepoll_run(&$argv, &$argc){
 
                                                // If it seems to be a reply but a header couldn't be found take the last message with matching subject
                                                if(!x($datarray,'parent-uri') and $reply) {
-                                                       //$r = q("SELECT `uri` , `parent-uri` FROM `item` WHERE MATCH (`title`) AGAINST ('".'"%s"'."' IN BOOLEAN MODE) AND `uid` = %d ORDER BY `created` DESC LIMIT 1",
                                                        $r = q("SELECT `uri` , `parent-uri` FROM `item` WHERE `title` = \"%s\" AND `uid` = %d ORDER BY `created` DESC LIMIT 1",
                                                                dbesc(protect_sprintf($datarray['title'])),
                                                                intval($importer_uid));