]> git.mxchange.org Git - friendica.git/commitdiff
make sure to use local avatar if we have one
authorFriendika <info@friendika.com>
Mon, 22 Nov 2010 01:36:01 +0000 (17:36 -0800)
committerFriendika <info@friendika.com>
Mon, 22 Nov 2010 01:36:01 +0000 (17:36 -0800)
include/salmon.php
mod/network.php

index 2838f2cbbf81afcd27168410c64bd5dcb18579a1..a12b7391e06cdf7a59273d2db18d5cd144bfe6e3 100644 (file)
@@ -19,10 +19,35 @@ function salmon_key($pubkey) {
 
 
 function base64url_encode($s) {
-       return strtr(base64_encode($s),'+/','-_');
+       $s = strtr(base64_encode($s),'+/','-_');
+/*
+ *  // placeholder for un-padded base64url_encode 
+ *  // per latest salmon rev
+ *
+ *  $s = str_replace('=','',$s);
+ *
+ */
+       return $s;
 }
 
 function base64url_decode($s) {
+
+/*
+ *  // Placeholder for new rev of salmon which strips base64 padding.
+ *  // PHP base64_decode handles the un-padded input without requiring this step
+ *  // Uncomment if you find you need it.
+ *
+ *     $l = strlen($s);
+ *     if(! strpos($s,'=')) {
+ *             $m = $l % 4;
+ *             if($m == 2)
+ *                     $s .= '==';
+ *             if($m == 3)
+ *                     $s .= '=';
+ *     }
+ *
+ */
+
        return base64_decode(strtr($s,'-_','+/'));
 }
 
index 59fd12c4bd3e7e440049f9678f195cbdec88b949..979a7b9162fcd387b00219cbfb4d1f1211ae516b 100644 (file)
@@ -156,7 +156,9 @@ function network_content(&$a, $update = 0) {
                        $template = $tpl;
                        $commentww = '';
                        $owner_url = $owner_photo = $owner_name = '';
+
                        $profile_url = $item['url'];
+
                        $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
 
                        if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent']))
@@ -237,8 +239,10 @@ function network_content(&$a, $update = 0) {
 
                        // Post was remotely authored.
 
-                       $profile_name = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']);
-                       $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $thumb);
+                       if((x($item,'author-link')) && ($item['url'] !== $item['author-link'])) { 
+                               $profile_name   = ((strlen($item['author-name'])) ? $item['author-name'] : $item['name']);
+                               $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $thumb);
+                       }
 
                        $profile_link = $profile_url;