namespace Friendica\Module;
use Friendica\BaseModule;
+use Friendica\Core\Protocol;
+use Friendica\Model\Item;
use Friendica\Model\User;
use Friendica\Network\HTTPException;
use Friendica\Protocol\Feed as ProtocolFeed;
throw new HTTPException\UnauthorizedException($this->t('Access to this profile has been restricted.'));
}
+ Item::incrementOutbound(Protocol::FEED);
+
$feed = ProtocolFeed::atom($owner, $last_update, 10, $type);
$this->httpExit($feed, Response::TYPE_ATOM);
use Friendica\App;
use Friendica\BaseModule;
+use Friendica\Core\Addon;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
use Friendica\Core\L10n;
Protocol::DFRN => intval($this->keyValue->get('stats_packets_inbound_' . Protocol::DFRN) ?? 0),
Protocol::DIASPORA => intval($this->keyValue->get('stats_packets_inbound_' . Protocol::DIASPORA) ?? 0),
Protocol::OSTATUS => intval($this->keyValue->get('stats_packets_inbound_' . Protocol::OSTATUS) ?? 0),
+ Protocol::FEED => intval($this->keyValue->get('stats_packets_inbound_' . Protocol::FEED) ?? 0),
+ Protocol::MAIL => intval($this->keyValue->get('stats_packets_inbound_' . Protocol::MAIL) ?? 0),
],
'outbound' => [
Protocol::ACTIVITYPUB => intval($this->keyValue->get('stats_packets_outbound_' . Protocol::ACTIVITYPUB) ?? 0),
Protocol::DFRN => intval($this->keyValue->get('stats_packets_outbound_' . Protocol::DFRN) ?? 0),
Protocol::DIASPORA => intval($this->keyValue->get('stats_packets_outbound_' . Protocol::DIASPORA) ?? 0),
Protocol::OSTATUS => intval($this->keyValue->get('stats_packets_outbound_' . Protocol::OSTATUS) ?? 0),
+ Protocol::FEED => intval($this->keyValue->get('stats_packets_outbound_' . Protocol::FEED) ?? 0),
+ Protocol::MAIL => intval($this->keyValue->get('stats_packets_outbound_' . Protocol::MAIL) ?? 0),
]
],
'reports' => [
]
];
+ if (Addon::isEnabled('bluesky')) {
+ $statistics['packets']['inbound'][Protocol::BLUESKY] = intval($this->keyValue->get('stats_packets_inbound_' . Protocol::BLUESKY) ?? 0);
+ $statistics['packets']['outbound'][Protocol::BLUESKY] = intval($this->keyValue->get('stats_packets_outbound_' . Protocol::BLUESKY) ?? 0);
+ }
+ if (Addon::isEnabled('tumblr')) {
+ $statistics['packets']['inbound'][Protocol::TUMBLR] = intval($this->keyValue->get('stats_packets_inbound_' . Protocol::TUMBLR) ?? 0);
+ $statistics['packets']['outbound'][Protocol::TUMBLR] = intval($this->keyValue->get('stats_packets_outbound_' . Protocol::TUMBLR) ?? 0);
+ }
+
$statistics = $this->getJobsPerPriority($statistics);
$this->jsonExit($statistics);
use Friendica\Core\Logger;
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML;
+use Friendica\Core\Protocol;
use Friendica\Model\Item;
use Friendica\Util\Strings;
use \IMAP\Connection;
return false;
}
+ Item::incrementInbound(Protocol::MAIL);
$mbox = @imap_open($mailbox, $username, $password);
$errors = imap_errors();
return [];
}
+ Item::incrementInbound(Protocol::MAIL);
$search1 = @imap_search($mbox, 'UNDELETED FROM "' . $email_addr . '"', SE_UID);
if (!$search1) {
$search1 = [];
Logger::debug("Found mails from ".$email_addr);
}
+ Item::incrementInbound(Protocol::MAIL);
$search2 = @imap_search($mbox, 'UNDELETED TO "' . $email_addr . '"', SE_UID);
if (!$search2) {
$search2 = [];
Logger::debug("Found mails to ".$email_addr);
}
+ Item::incrementInbound(Protocol::MAIL);
$search3 = @imap_search($mbox, 'UNDELETED CC "' . $email_addr . '"', SE_UID);
if (!$search3) {
$search3 = [];
public static function getMessage($mbox, int $uid, string $reply, array $item): array
{
$ret = $item;
-
+ Item::incrementInbound(Protocol::MAIL);
$struc = (($mbox && $uid) ? @imap_fetchstructure($mbox, $uid, FT_UID) : null);
if (!$struc) {
//$message = '<html><body>' . $html . '</body></html>';
//$message = html2plain($html);
Logger::notice('notifier: email delivery to ' . $addr);
+ Item::incrementOutbound(Protocol::MAIL);
return mail($addr, $subject, $body, $headers);
}
}
$cookiejar = tempnam(System::getTempPath(), 'cookiejar-onepoll-');
+ Item::incrementInbound(Protocol::FEED);
$curlResult = DI::httpClient()->get($contact['poll'], HttpClientAccept::FEED_XML, [HttpClientOptions::COOKIEJAR => $cookiejar, HttpClientOptions::REQUEST => HttpClientRequest::FEEDFETCHER]);
unlink($cookiejar);