]> git.mxchange.org Git - friendica.git/blobdiff - include/onepoll.php
no more googlegroups
[friendica.git] / include / onepoll.php
index 2abd41b7898d9bb14669f72ac604d0e11b15f067..f66a48dd46a6d4c831ecafe6f5160b466f9c51e8 100644 (file)
@@ -18,7 +18,7 @@ function onepoll_run(&$argv, &$argc){
   
        if(is_null($db)) {
            @include(".htconfig.php");
-       require_once("dba.php");
+       require_once("include/dba.php");
            $db = new dba($db_host, $db_user, $db_pass, $db_data);
        unset($db_host, $db_user, $db_pass, $db_data);
        };
@@ -252,6 +252,9 @@ function onepoll_run(&$argv, &$argc){
 
                $stat_writeable = ((($contact['notify']) && ($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['rel'] == CONTACT_IS_FRIEND)) ? 1 : 0);
 
+               if($contact['network'] === NETWORK_OSTATUS && get_pconfig($importer_uid,'system','ostatus_autofriend'))
+                       $stat_writeable = 1;
+
                if($stat_writeable != $contact['writable']) {
                        q("UPDATE `contact` SET `writable` = %d WHERE `id` = %d LIMIT 1",
                                intval($stat_writeable),
@@ -335,7 +338,7 @@ function onepoll_run(&$argv, &$argc){
                                                                        intval($r[0]['id'])
                                                                );
                                                        }
-                                                       /*switch ($mailconf[0]['action']) {
+                                                       switch ($mailconf[0]['action']) {
                                                                case 0:
                                                                        logger("Mail: Seen before ".$msg_uid." for ".$mailconf[0]['user'].". Doing nothing.", LOGGER_DEBUG);
                                                                        break;
@@ -353,7 +356,7 @@ function onepoll_run(&$argv, &$argc){
                                                                        if ($mailconf[0]['movetofolder'] != "")
                                                                                imap_mail_move($mbox, $msg_uid, $mailconf[0]['movetofolder'], FT_UID);
                                                                        break;
-                                                       }*/
+                                                       }
                                                        continue;
                                                }
 
@@ -398,14 +401,15 @@ function onepoll_run(&$argv, &$argc){
                                                // Is it a reply?
                                                $reply = ((substr(strtolower($datarray['title']), 0, 3) == "re:") or
                                                        (substr(strtolower($datarray['title']), 0, 3) == "re-") or
-                                                       (raw_refs != ""));
+                                                       ($raw_refs != ""));
 
                                                // Remove Reply-signs in the subject
                                                $datarray['title'] = RemoveReply($datarray['title']);
 
                                                // 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 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));
                                                        if(count($r))