zotlabs 11 months ago
parent
commit
f1ed64efe4
5 changed files with 39 additions and 14 deletions
  1. 29 4
      Zotlabs/Lib/Activity.php
  2. 4 4
      Zotlabs/Lib/ActivityStreams.php
  3. 2 2
      Zotlabs/Lib/Libsync.php
  4. 3 3
      doc/bugs.bb
  5. 1 1
      view/tpl/jot-header.tpl

+ 29 - 4
Zotlabs/Lib/Activity.php

@@ -1050,11 +1050,36 @@ class Activity {
 			$icon = z_root() . '/' . get_default_profile_photo();
 		}
 
-		if(is_array($person_obj['url']) && array_key_exists('href', $person_obj['url']))
-			$profile = $person_obj['url']['href'];
-		else
-			$profile = $url;
 
+		$links = false;
+		$profile = false;
+
+		if(is_array($person_obj['url'])) {
+			if(! array_key_exists(0,$person_obj['url'])) {
+				$links = [ $person_obj['url'] ];
+			}
+			else {
+				$links = $person_obj['url'];
+			}
+		}
+
+		if($links) {
+			foreach($links as $link) {
+				if(array_key_exists('mediaType',$link) && $link['mediaType'] === 'text/html') {
+					$profile = $link['href'];
+				}
+			}
+			if(! $profile) {
+				$profile = $links[0]['href'];
+			}
+		}
+		elseif(array_key_exists('url',$person_obj) && is_string($person_obj['url'])) {
+			$profile = $person_obj['url'];
+		}
+
+		if(! $profile) {
+			$profile = $url;
+		}
 
 		$inbox = $person_obj['inbox'];
 

+ 4 - 4
Zotlabs/Lib/ActivityStreams.php

@@ -94,17 +94,17 @@ class ActivityStreams {
 				}
 			}
 			
-			if($this->obj && $this->obj['actor'])
+			if($this->obj && is_array($this->obj) && $this->obj['actor'])
 				$this->obj['actor'] = $this->get_actor('actor',$this->obj);
-			if($this->tgt && $this->tgt['actor'])
+			if($this->tgt && is_array($this->tgt) && $this->tgt['actor'])
 				$this->tgt['actor'] = $this->get_actor('actor',$this->tgt);
 
 			$this->parent_id = $this->get_property_obj('inReplyTo');
 
-			if(! $this->parent_id) {				
+			if((! $this->parent_id) && is_array($this->obj)) {				
 				$this->parent_id = $this->obj['inReplyTo'];
 			}
-			if(! $this->parent_id) {				
+			if((! $this->parent_id) && is_array($this->obj)) {				
 				$this->parent_id = $this->obj['id'];
 			}
 		}

+ 2 - 2
Zotlabs/Lib/Libsync.php

@@ -49,7 +49,7 @@ class Libsync {
 		if(intval($channel['channel_removed']))
 			return;
 
-		$h = q("select hubloc.*, site.site_crypto from hubloc left join site on site_url = hubloc_url where hubloc_hash = '%s' and hubloc_deleted = 0",
+		$h = q("select hubloc.*, site.site_crypto from hubloc left join site on site_url = hubloc_url where hubloc_hash = '%s' and hubloc_netwoor = 'zot6' and hubloc_deleted = 0",
 			dbesc(($keychange) ? $packet['keychange']['old_hash'] : $channel['channel_hash'])
 		);
 
@@ -195,7 +195,7 @@ class Libsync {
 
 		$hashes = ids_to_querystr($l,'link',true);
 		
-		$h = q("select hubloc.*, site.site_crypto from hubloc left join site on site_url = hubloc_url where hubloc_hash in (" . protect_sprintf($hashes) . ") and hubloc_deleted = 0");
+		$h = q("select hubloc.*, site.site_crypto from hubloc left join site on site_url = hubloc_url where hubloc_hash in (" . protect_sprintf($hashes) . ") and hubloc_network = 'zot6' and hubloc_deleted = 0");
 
 		if(! $h)
 			return;

File diff suppressed because it is too large
+ 3 - 3
doc/bugs.bb


+ 1 - 1
view/tpl/jot-header.tpl

@@ -215,8 +215,8 @@ var activeCommentText = '';
 		$('#like-rotator-' + id).show();
 		$.get('{{$baseurl}}/share/' + id, function(data) {
 			$('#like-rotator-' + id).hide();
+			notificationsUpdate();
 		});
-		notificationsUpdate();
 	}