aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/network.php')
-rw-r--r--include/network.php64
1 files changed, 43 insertions, 21 deletions
diff --git a/include/network.php b/include/network.php
index 9f68d3df3..0dd10e29b 100644
--- a/include/network.php
+++ b/include/network.php
@@ -595,8 +595,6 @@ function parse_xml_string($s,$strict = true) {
function scale_external_images($s, $include_link = true, $scale_replace = false) {
- $a = get_app();
-
// Picture addresses can contain special characters
$s = htmlspecialchars_decode($s, ENT_COMPAT);
@@ -1168,6 +1166,10 @@ function discover_by_webbie($webbie) {
if(! $x)
$probe_old = true;
+
+ if((! $dfrn) && (! $has_salmon))
+ $probe_old = true;
+
if($probe_old) {
$y = old_webfinger($webbie);
if($y) {
@@ -1614,8 +1616,6 @@ function fetch_xrd_links($url) {
function scrape_vcard($url) {
- $a = get_app();
-
$ret = array();
logger('scrape_vcard: url=' . $url);
@@ -1695,8 +1695,6 @@ function scrape_vcard($url) {
function scrape_feed($url) {
- $a = get_app();
-
$ret = array();
$level = 0;
$x = z_fetch_url($url,false,$level,array('novalidate' => true));
@@ -1815,8 +1813,6 @@ function service_plink($contact, $guid) {
function format_and_send_email($sender,$xchan,$item) {
- require_once('include/enotify.php');
-
$title = $item['title'];
$body = $item['body'];
@@ -1835,7 +1831,7 @@ function format_and_send_email($sender,$xchan,$item) {
$tpl = get_markup_template('email_notify_html.tpl');
$email_html_body = replace_macros($tpl,array(
'$banner' => $banner,
- '$notify_icon' => Zotlabs\Project\System::get_notify_icon(),
+ '$notify_icon' => Zotlabs\Lib\System::get_notify_icon(),
'$product' => $product,
'$preamble' => '',
'$sitename' => $sitename,
@@ -1881,7 +1877,7 @@ function format_and_send_email($sender,$xchan,$item) {
// use the EmailNotification library to send the message
- enotify::send(array(
+ Zotlabs\Lib\Enotify::send(array(
'fromName' => $product,
'fromEmail' => $sender_email,
'replyTo' => $sender_email,
@@ -1912,10 +1908,13 @@ function do_delivery($deliveries) {
$deliver = array();
foreach($deliveries as $d) {
+ if(! $d)
+ continue;
+
$deliver[] = $d;
if(count($deliver) >= $deliveries_per_process) {
- proc_run('php','include/deliver.php',$deliver);
+ Zotlabs\Daemon\Master::Summon(array('Deliver',$deliver));
$deliver = array();
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
@@ -1925,7 +1924,7 @@ function do_delivery($deliveries) {
// catch any stragglers
if($deliver)
- proc_run('php','include/deliver.php',$deliver);
+ Zotlabs\Daemon\Master::Summon(array('Deliver',$deliver));
}
@@ -1933,9 +1932,6 @@ function do_delivery($deliveries) {
function get_site_info() {
- global $db;
- global $a;
-
$register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
$directory_mode = Array('DIRECTORY_MODE_NORMAL', 'DIRECTORY_MODE_PRIMARY', 'DIRECTORY_MODE_SECONDARY', 256 => 'DIRECTORY_MODE_STANDALONE');
@@ -1971,7 +1967,7 @@ function get_site_info() {
$r = q("select * from addon where hidden = 0");
if(count($r))
foreach($r as $rr)
- $visible_plugins[] = $rr['name'];
+ $visible_plugins[] = $rr['aname'];
}
sort($visible_plugins);
@@ -1983,8 +1979,8 @@ function get_site_info() {
$site_info = get_config('system','info');
$site_name = get_config('system','sitename');
if(! get_config('system','hidden_version_siteinfo')) {
- $version = Zotlabs\Project\System::get_project_version();
- $tag = Zotlabs\Project\System::get_std_version();
+ $version = Zotlabs\Lib\System::get_project_version();
+ $tag = Zotlabs\Lib\System::get_std_version();
if(@is_dir('.git') && function_exists('shell_exec')) {
$commit = trim( @shell_exec('git log -1 --format="%h"'));
@@ -2020,7 +2016,7 @@ function get_site_info() {
$data = Array(
'version' => $version,
'version_tag' => $tag,
- 'server_role' => Zotlabs\Project\System::get_server_role(),
+ 'server_role' => Zotlabs\Lib\System::get_server_role(),
'commit' => $commit,
'url' => z_root(),
'plugins' => $visible_plugins,
@@ -2034,8 +2030,8 @@ function get_site_info() {
'locked_features' => $locked_features,
'admin' => $admin,
'site_name' => (($site_name) ? $site_name : ''),
- 'platform' => Zotlabs\Project\System::get_platform_name(),
- 'dbdriver' => $db->getdriver(),
+ 'platform' => Zotlabs\Lib\System::get_platform_name(),
+ 'dbdriver' => DBA::$dba->getdriver(),
'lastpoll' => get_config('system','lastpoll'),
'info' => (($site_info) ? $site_info : ''),
'channels_total' => $channels_total_stat,
@@ -2143,3 +2139,29 @@ function get_repository_version($branch = 'master') {
return '?.?';
}
+
+function network_to_name($s) {
+
+ $nets = array(
+ NETWORK_DFRN => t('Friendica'),
+ NETWORK_FRND => t('Friendica'),
+ NETWORK_OSTATUS => t('OStatus'),
+ NETWORK_GNUSOCIAL => t('GNU-Social'),
+ NETWORK_FEED => t('RSS/Atom'),
+ NETWORK_MAIL => t('Email'),
+ NETWORK_DIASPORA => t('Diaspora'),
+ NETWORK_FACEBOOK => t('Facebook'),
+ NETWORK_ZOT => t('Zot'),
+ NETWORK_LINKEDIN => t('LinkedIn'),
+ NETWORK_XMPP => t('XMPP/IM'),
+ NETWORK_MYSPACE => t('MySpace'),
+ );
+
+ call_hooks('network_to_name', $nets);
+
+ $search = array_keys($nets);
+ $replace = array_values($nets);
+
+ return str_replace($search,$replace,$s);
+
+}