aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Share.php
diff options
context:
space:
mode:
authornobody <nobody@zotlabs.com>2021-07-06 05:02:52 -0700
committernobody <nobody@zotlabs.com>2021-07-06 05:02:52 -0700
commit73b53675b1a339cfd950845279438e35b4e2dc7c (patch)
tree6b433b3f21585230bfbc71d955c8a8bcc82dd5e8 /Zotlabs/Lib/Share.php
parentefda8aac1d7d90fd7eda4a449332eedf74342951 (diff)
parent9b9ac5054fcc424a556f366284501882b1e02e9e (diff)
downloadvolse-hubzilla-73b53675b1a339cfd950845279438e35b4e2dc7c.tar.gz
volse-hubzilla-73b53675b1a339cfd950845279438e35b4e2dc7c.tar.bz2
volse-hubzilla-73b53675b1a339cfd950845279438e35b4e2dc7c.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'Zotlabs/Lib/Share.php')
-rw-r--r--Zotlabs/Lib/Share.php42
1 files changed, 21 insertions, 21 deletions
diff --git a/Zotlabs/Lib/Share.php b/Zotlabs/Lib/Share.php
index b4cd5a194..81f378d0d 100644
--- a/Zotlabs/Lib/Share.php
+++ b/Zotlabs/Lib/Share.php
@@ -8,13 +8,13 @@ class Share {
public function __construct($post_id) {
-
+
if(! $post_id)
return;
-
+
if(! (local_channel() || remote_channel()))
return;
-
+
$r = q("SELECT * from item left join xchan on author_xchan = xchan_hash WHERE id = %d LIMIT 1",
intval($post_id)
);
@@ -23,26 +23,26 @@ class Share {
if(($r[0]['item_private']) && ($r[0]['xchan_network'] !== 'rss'))
return;
-
+
$sql_extra = item_permissions_sql($r[0]['uid']);
-
+
$r = q("select * from item where id = %d $sql_extra",
intval($post_id)
);
if(! $r)
return;
-
+
if($r[0]['mimetype'] !== 'text/bbcode')
return;
-
+
/** @FIXME eventually we want to post remotely via rpost on your home site */
// When that works remove this next bit:
-
+
if(! local_channel())
return;
xchan_query($r);
-
+
$this->item = $r[0];
return;
}
@@ -66,14 +66,14 @@ class Share {
'address' => $this->item['author']['xchan_addr'],
'network' => $this->item['author']['xchan_network'],
'link' => [
- [
- 'rel' => 'alternate',
- 'type' => 'text/html',
+ [
+ 'rel' => 'alternate',
+ 'type' => 'text/html',
'href' => $this->item['author']['xchan_url']
],
[
- 'rel' => 'photo',
- 'type' => $this->item['author']['xchan_photo_mimetype'],
+ 'rel' => 'photo',
+ 'type' => $this->item['author']['xchan_photo_mimetype'],
'href' => $this->item['author']['xchan_photo_m']
]
]
@@ -84,14 +84,14 @@ class Share {
'address' => $this->item['owner']['xchan_addr'],
'network' => $this->item['owner']['xchan_network'],
'link' => [
- [
- 'rel' => 'alternate',
- 'type' => 'text/html',
+ [
+ 'rel' => 'alternate',
+ 'type' => 'text/html',
'href' => $this->item['owner']['xchan_url']
],
[
- 'rel' => 'photo',
- 'type' => $this->item['owner']['xchan_photo_mimetype'],
+ 'rel' => 'photo',
+ 'type' => $this->item['owner']['xchan_photo_mimetype'],
'href' => $this->item['owner']['xchan_photo_m']
]
]
@@ -117,7 +117,7 @@ class Share {
$object = json_decode($this->item['obj'],true);
$photo_bb = $object['body'];
}
-
+
if (strpos($this->item['body'], "[/share]") !== false) {
$pos = strpos($this->item['body'], "[share");
$bb = substr($this->item['body'], $pos);
@@ -126,7 +126,7 @@ class Share {
"' profile='" . $this->item['author']['xchan_url'] .
"' avatar='" . $this->item['author']['xchan_photo_s'] .
"' link='" . $this->item['plink'] .
- "' auth='" . ((in_array($this->item['author']['xchan_network'], ['zot6', 'zot'])) ? 'true' : 'false') .
+ "' auth='" . (($this->item['author']['xchan_network'] === 'zot6') ? 'true' : 'false') .
"' posted='" . $this->item['created'] .
"' message_id='" . $this->item['mid'] .
"']";