]> git.mxchange.org Git - friendica.git/blobdiff - mod/contacts.php
Remove references to include/event
[friendica.git] / mod / contacts.php
index 09090e541a502e5254c726f2ca070421051d1b72..cd9021c17ec2cd4edde1b6c9b1997f92bb840f89 100644 (file)
@@ -45,6 +45,14 @@ function contacts_init(App $a)
        }
 
        if (DBM::is_result($contact)) {
+               if ($contact['self']) {
+                       if (($a->argc == 3) && intval($a->argv[1]) && ($a->argv[2] == "posts")) {
+                               goaway('profile/' . $contact['nick']);
+                       } else {
+                               goaway('profile/' . $contact['nick'] . '?tab=profile');
+                       }
+               }
+
                $a->data['contact'] = $contact;
 
                if (($a->data['contact']['network'] != "") && ($a->data['contact']['network'] != NETWORK_DFRN)) {
@@ -579,9 +587,10 @@ function contacts_content(App $a)
                        $profile_select = ContactSelector::profileAssign($contact['profile-id'], (($contact['network'] !== NETWORK_DFRN) ? true : false));
                }
 
+               /// @todo Only show the following link with DFRN when the remote version supports it
                $follow = '';
                $follow_text = '';
-               if (in_array($contact['network'], [NETWORK_DIASPORA, NETWORK_OSTATUS])) {
+               if (in_array($contact['network'], [NETWORK_DIASPORA, NETWORK_OSTATUS, NETWORK_DFRN])) {
                        if ($contact['rel'] == CONTACT_IS_FOLLOWER) {
                                $follow = System::baseUrl(true) . "/follow?url=" . urlencode($contact["url"]);
                                $follow_text = L10n::t("Connect/Follow");
@@ -939,6 +948,13 @@ function _contact_detail_for_template($rr)
                $sparkle = '';
        }
 
+       if ($rr['self']) {
+               $dir_icon = 'images/larrow.gif';
+               $alt_text = L10n::t('This is you');
+               $url = $rr['url'];
+               $sparkle = '';
+       }
+
        return [
                'img_hover' => L10n::t('Visit %s\'s profile [%s]', $rr['name'], $rr['url']),
                'edit_hover' => L10n::t('Edit contact'),