mirror of
https://github.com/friendica/friendica
synced 2025-04-27 05:10:10 +00:00
Show "Redmatrix" as network name.
This commit is contained in:
parent
74a2f58efb
commit
fca8aecc9b
10 changed files with 36 additions and 30 deletions
|
@ -505,7 +505,7 @@
|
|||
}
|
||||
|
||||
require_once('include/contact_selectors.php');
|
||||
$network_name = network_to_name($uinfo[0]['network']);
|
||||
$network_name = network_to_name($uinfo[0]['network'], $uinfo[0]['url']);
|
||||
|
||||
$ret = Array(
|
||||
'id' => intval($r[0]['id']),
|
||||
|
@ -996,9 +996,9 @@
|
|||
$status_info["entities"] = $converted["entities"];
|
||||
|
||||
if (($lastwall['item_network'] != "") AND ($status["source"] == 'web'))
|
||||
$status_info["source"] = network_to_name($lastwall['item_network']);
|
||||
elseif (($lastwall['item_network'] != "") AND (network_to_name($lastwall['item_network']) != $status_info["source"]))
|
||||
$status_info["source"] = trim($status_info["source"].' ('.network_to_name($lastwall['item_network']).')');
|
||||
$status_info["source"] = network_to_name($lastwall['item_network'], $user_info['url']);
|
||||
elseif (($lastwall['item_network'] != "") AND (network_to_name($lastwall['item_network'], $user_info['url']) != $status_info["source"]))
|
||||
$status_info["source"] = trim($status_info["source"].' ('.network_to_name($lastwall['item_network'], $user_info['url']).')');
|
||||
|
||||
// "uid" and "self" are only needed for some internal stuff, so remove it from here
|
||||
unset($status_info["user"]["uid"]);
|
||||
|
@ -1095,9 +1095,9 @@
|
|||
$user_info["status"]["entities"] = $converted["entities"];
|
||||
|
||||
if (($lastwall['item_network'] != "") AND ($user_info["status"]["source"] == 'web'))
|
||||
$user_info["status"]["source"] = network_to_name($lastwall['item_network']);
|
||||
if (($lastwall['item_network'] != "") AND (network_to_name($lastwall['item_network']) != $user_info["status"]["source"]))
|
||||
$user_info["status"]["source"] = trim($user_info["status"]["source"].' ('.network_to_name($lastwall['item_network']).')');
|
||||
$user_info["status"]["source"] = network_to_name($lastwall['item_network'], $user_info['url']);
|
||||
if (($lastwall['item_network'] != "") AND (network_to_name($lastwall['item_network'], $user_info['url']) != $user_info["status"]["source"]))
|
||||
$user_info["status"]["source"] = trim($user_info["status"]["source"].' ('.network_to_name($lastwall['item_network'], $user_info['url']).')');
|
||||
|
||||
}
|
||||
|
||||
|
@ -2214,9 +2214,9 @@
|
|||
$status["entities"] = $converted["entities"];
|
||||
|
||||
if (($item['item_network'] != "") AND ($status["source"] == 'web'))
|
||||
$status["source"] = network_to_name($item['item_network']);
|
||||
else if (($item['item_network'] != "") AND (network_to_name($item['item_network']) != $status["source"]))
|
||||
$status["source"] = trim($status["source"].' ('.network_to_name($item['item_network']).')');
|
||||
$status["source"] = network_to_name($item['item_network'], $user_info['url']);
|
||||
else if (($item['item_network'] != "") AND (network_to_name($item['item_network'], $user_info['url']) != $status["source"]))
|
||||
$status["source"] = trim($status["source"].' ('.network_to_name($item['item_network'], $user_info['url']).')');
|
||||
|
||||
|
||||
// Retweets are only valid for top postings
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
require_once('include/diaspora.php');
|
||||
|
||||
function contact_profile_assign($current,$foreign_net) {
|
||||
|
||||
|
@ -70,7 +70,7 @@ function contact_poll_interval($current, $disabled = false) {
|
|||
}
|
||||
|
||||
|
||||
function network_to_name($s) {
|
||||
function network_to_name($s, $profile = "") {
|
||||
|
||||
$nets = array(
|
||||
NETWORK_DFRN => t('Friendica'),
|
||||
|
@ -97,6 +97,10 @@ function network_to_name($s) {
|
|||
$search = array_keys($nets);
|
||||
$replace = array_values($nets);
|
||||
|
||||
return str_replace($search,$replace,$s);
|
||||
$networkname = str_replace($search,$replace,$s);
|
||||
|
||||
if (($s == NETWORK_DIASPORA) AND ($profile != "") AND diaspora_is_redmatrix($profile))
|
||||
$networkname = t("Redmatrix");
|
||||
|
||||
return $networkname;
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ if(! function_exists('profile_sidebar')) {
|
|||
if (($profile['network'] != "") AND ($profile['network'] != NETWORK_DFRN)) {
|
||||
require_once('include/contact_selectors.php');
|
||||
if ($profile['url'] != "")
|
||||
$profile['network_name'] = '<a href="'.$profile['url'].'">'.network_to_name($profile['network'])."</a>";
|
||||
$profile['network_name'] = '<a href="'.$profile['url'].'">'.network_to_name($profile['network'], $profile['url'])."</a>";
|
||||
else
|
||||
$profile['network_name'] = network_to_name($profile['network']);
|
||||
} else
|
||||
|
|
|
@ -2977,9 +2977,6 @@ function item_is_remote_self($contact, &$datarray) {
|
|||
$datarray['private'] = 0;
|
||||
}
|
||||
|
||||
//if (!isset($datarray["app"]) OR ($datarray["app"] == ""))
|
||||
// $datarray["app"] = network_to_name($contact['network']);
|
||||
|
||||
if ($contact['network'] != NETWORK_FEED) {
|
||||
// Store the original post
|
||||
$r = item_store($datarray2, false, false);
|
||||
|
|
|
@ -92,6 +92,10 @@ function onepoll_run(&$argv, &$argc){
|
|||
);
|
||||
|
||||
if(! count($contacts)) {
|
||||
// Maybe it is a Redmatrix account. Then we can fetch their contacts via poco
|
||||
$contacts = q("SELECT `id`, `poco` FROM `contact` WHERE `id` = %d AND `poco` != ''", intval($contact_id));
|
||||
if ($contacts)
|
||||
poco_load($contacts[0]['id'],$importer_uid,0,$contacts[0]['poco']);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -124,8 +124,9 @@ function poco_load($cid,$uid = 0,$zcid = 0,$url = null) {
|
|||
$keywords = implode(", ", $tag);
|
||||
|
||||
// If you query a Friendica server for its profiles, the network has to be Friendica
|
||||
if ($uid == 0)
|
||||
$network = NETWORK_DFRN;
|
||||
// To-Do: It could also be a Redmatrix server
|
||||
//if ($uid == 0)
|
||||
// $network = NETWORK_DFRN;
|
||||
|
||||
poco_check($profile_url, $name, $network, $profile_photo, $about, $location, $gender, $keywords, $connect_url, $updated, $generation, $cid, $uid, $zcid);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue