]> git.mxchange.org Git - friendica.git/commitdiff
Show "Redmatrix" as network name.
authorMichael Vogel <icarus@dabo.de>
Thu, 16 Jul 2015 08:09:59 +0000 (10:09 +0200)
committerMichael Vogel <icarus@dabo.de>
Thu, 16 Jul 2015 08:09:59 +0000 (10:09 +0200)
include/api.php
include/contact_selectors.php
include/identity.php
include/items.php
include/onepoll.php
include/socgraph.php
mod/contacts.php
mod/nogroup.php
mod/viewcontacts.php
object/Item.php

index b5d8f9cf3d8c5d7407a319897bdb488e8061513a..1069835817bfa367810ed54df2ca3a669866a772 100644 (file)
                }
 
                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']),
                                $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"]);
                                $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']).')');
 
                }
 
                                $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
index c04b07fb64e60f70e1735b78aa8a7fb7a00b19c2..f0ac87a09f32b4f3e7759cec13acc5c5568137c0 100644 (file)
@@ -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;
 }
index bf5d9692746af48091ce2b584be3f06b5cf2203e..b584896d36c5474372245231cb58df6a707c0260 100644 (file)
@@ -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
index cba1ae236c9929e7aa6d8e6f3b475f8ca7a321da..848c21df366d405d16a00b24eaadbd0b36c58847 100644 (file)
@@ -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);
index d1f41d65f57e425808fe2d997f5b35c6560127c1..9723fadd5135d6a04b1dca75f0838ff844ee6836 100644 (file)
@@ -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;
        }
 
index 23db35cabd885fdb41006c817920fa523d09f06d..1e1b6076f25ded7178d63b0ae44ffaa6038b224b 100644 (file)
@@ -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);
 
index 6ee9a4a92b23165e2df3a49cfb4583482d14e338..ffb9f1a4614f6730b4af8d6242f25d6479527d34 100644 (file)
@@ -505,7 +505,7 @@ function contacts_content(&$a) {
 
                $poll_enabled = in_array($contact['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_FEED, NETWORK_MAIL, NETWORK_MAIL2));
 
-               $nettype = sprintf( t('Network type: %s'),network_to_name($contact['network']));
+               $nettype = sprintf( t('Network type: %s'),network_to_name($contact['network'], $contact["url"]));
 
                $common = count_common_friends(local_user(),$contact['id']);
                $common_text = (($common) ? sprintf( tt('%d contact in common','%d contacts in common', $common),$common) : '');
@@ -806,7 +806,7 @@ function _contact_detail_for_template($rr){
                'sparkle' => $sparkle,
                'itemurl' => $rr['url'],
                'url' => $url,
-               'network' => network_to_name($rr['network']),
+               'network' => network_to_name($rr['network'], $rr['url']),
        );
-       
-}
\ No newline at end of file
+
+}
index 24d99a59b6c01a0c071828c0f6ce8ede42b93fc3..adbcfcb5154d37cbcadd23e1e1c48ede9a0b022b 100644 (file)
@@ -43,13 +43,13 @@ function nogroup_content(&$a) {
                                'id' => $rr['id'],
                                'alt_text' => $alt_text,
                                'dir_icon' => $dir_icon,
-                               'thumb' => $rr['thumb'], 
+                               'thumb' => $rr['thumb'],
                                'name' => $rr['name'],
                                'username' => $rr['name'],
                                'sparkle' => $sparkle,
                                'itemurl' => $rr['url'],
                                'url' => $url,
-                               'network' => network_to_name($rr['network']),
+                               'network' => network_to_name($rr['network'], $url),
                        );
                }
        }
@@ -59,8 +59,8 @@ function nogroup_content(&$a) {
                '$header' => t('Contacts who are not members of a group'),
                '$contacts' => $contacts,
                '$paginate' => paginate($a),
-       )); 
-       
+       ));
+
        return $o;
 
 }
index 3a6c48a3b2fab619688999c7e751796785ce2456..b84856701dbe041e5d5255461e37336f0aa96f4c 100644 (file)
@@ -68,7 +68,7 @@ function viewcontacts_content(&$a) {
                        'url' => $url,
                        'sparkle' => '',
                        'itemurl' => $rr['url'],
-                       'network' => network_to_name($rr['network']),
+                       'network' => network_to_name($rr['network'], $rr['url']),
                );
        }
 
index 7f9762581c4268fddfae478fb280c013bcf4e92c..8d364e6023040e8d0ed00b0ad6e31fce33a8d1cd 100644 (file)
@@ -4,6 +4,7 @@ if(class_exists('Item'))
 
 require_once('object/BaseObject.php');
 require_once('include/text.php');
+require_once('include/diaspora.php');
 require_once('boot.php');
 
 /**
@@ -82,7 +83,6 @@ class Item extends BaseObject {
         */
        public function get_template_data($alike, $dlike, $thread_level=1) {
                require_once("mod/proxy.php");
-               require_once("include/diaspora.php");
 
                $result = array();
 
@@ -368,7 +368,7 @@ class Item extends BaseObject {
                         'postopts' => $langstr,
                         'edited' => $edited,
                        'network' => $item["item_network"],
-                       'network_name' => network_to_name($item['item_network']),
+                       'network_name' => network_to_name($item['item_network'], $profile_link),
                );
 
                $arr = array('item' => $item, 'output' => $tmp_item);