aboutsummaryrefslogtreecommitdiffstats
path: root/include/diaspora.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-03 21:14:24 -0700
committerfriendica <info@friendica.com>2014-09-03 21:14:24 -0700
commit96a9378fd74eb45599ef2152d55286293968b298 (patch)
tree161726b8d5a2ea528dbb95502ba6d4b81a1d5bc1 /include/diaspora.php
parent844087bc71f333719c1e08d807874f3ae3a7053e (diff)
downloadvolse-hubzilla-96a9378fd74eb45599ef2152d55286293968b298.tar.gz
volse-hubzilla-96a9378fd74eb45599ef2152d55286293968b298.tar.bz2
volse-hubzilla-96a9378fd74eb45599ef2152d55286293968b298.zip
this is turning into a wretched mess. It's going to get worse before it gets better, but I'm trying to do this incrementally so I don't break the whole shebang for a few days. It will get better once all the bbcode translation is done in a single place (cross fingers), and we can just sign the post once when we submit it and be done with it. If Diaspora ever implements editing of existing posts we'll have to go back and do the whole wretched mess over again.
Diffstat (limited to 'include/diaspora.php')
-rwxr-xr-xinclude/diaspora.php31
1 files changed, 20 insertions, 11 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index fabcafa79..ae2c1184a 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -2278,20 +2278,29 @@ function diaspora_send_status($item,$owner,$contact,$public_batch = false) {
$body = str_replace("\n\n\n", "\n\n", $body);
} while ($oldbody != $body);
+ if($item['diaspora_meta']) {
+ $j = json_decode($item['diaspora_meta'],true);
+ if($j && $j['body']) {
+ $body = xmlify($j['body']);
+ }
+ }
+ else {
+ $body = xmlify(html_entity_decode(bb2diaspora($body)));
- // convert to markdown
- $body = xmlify(html_entity_decode(bb2diaspora($body)));
- // Adding the title
- if(strlen($title))
- $body = "## ".html_entity_decode($title)."\n\n".$body;
+ // convert to markdown
- if($item['attach']) {
- $cnt = preg_match_all('/href=\"(.*?)\"(.*?)title=\"(.*?)\"/ism',$item['attach'],$matches,PREG_SET_ORDER);
- if(cnt) {
- $body .= "\n" . t('Attachments:') . "\n";
- foreach($matches as $mtch) {
- $body .= '[' . $mtch[3] . '](' . $mtch[1] . ')' . "\n";
+ // Adding the title
+ if(strlen($title))
+ $body = "## ".html_entity_decode($title)."\n\n".$body;
+
+ if($item['attach']) {
+ $cnt = preg_match_all('/href=\"(.*?)\"(.*?)title=\"(.*?)\"/ism',$item['attach'],$matches,PREG_SET_ORDER);
+ if(cnt) {
+ $body .= "\n" . t('Attachments:') . "\n";
+ foreach($matches as $mtch) {
+ $body .= '[' . $mtch[3] . '](' . $mtch[1] . ')' . "\n";
+ }
}
}
}