X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fonepoll.php;h=bd20cfdb5300e5347f82170d4679d1650b9adc59;hb=d905f0a3e3001496df120b685b6f2d42cc8598d2;hp=01686232cb153e1379f68466a9ac0bfde7654269;hpb=f962ecdd6483679879d7608a47dbf8549a431a8f;p=friendica.git diff --git a/include/onepoll.php b/include/onepoll.php index 01686232cb..bd20cfdb53 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -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), @@ -328,13 +331,17 @@ function onepoll_run(&$argv, &$argc){ ); if(count($r)) { - logger("Mail: Seen before ".$msg_uid." for ".$mailconf[0]['user'],LOGGER_DEBUG); - if($meta->deleted && ! $r[0]['deleted']) { - q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1", - dbesc(datetime_convert()), - intval($r[0]['id']) - ); - } + logger("Mail: Seen before ".$msg_uid." for ".$mailconf[0]['user']." UID: ".$importer_uid." URI: ".$datarray['uri'],LOGGER_DEBUG); + + // Only delete when mails aren't automatically moved or deleted + if (($mailconf[0]['action'] != 1) AND ($mailconf[0]['action'] != 3)) + if($meta->deleted && ! $r[0]['deleted']) { + q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1", + dbesc(datetime_convert()), + intval($r[0]['id']) + ); + } + switch ($mailconf[0]['action']) { case 0: logger("Mail: Seen before ".$msg_uid." for ".$mailconf[0]['user'].". Doing nothing.", LOGGER_DEBUG); @@ -423,6 +430,7 @@ function onepoll_run(&$argv, &$argc){ continue; } $datarray['body'] = escape_tags($r['body']); + $datarray['body'] = limit_body_size($datarray['body']); logger("Mail: Importing ".$msg_uid." for ".$mailconf[0]['user']);