mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:35:30 +00:00
diaspora: move reshare encapsulation after tag parsing, since it seriously screws up the tag parser and reshares end up with a lot of unlinked tags.
This commit is contained in:
parent
9fcc984406
commit
fc52536ce7
2 changed files with 13 additions and 14 deletions
|
@ -1067,24 +1067,13 @@ function diaspora_reshare($importer,$xml,$msg) {
|
|||
$orig_author_photo = $person['xchan_photo_m'];
|
||||
}
|
||||
|
||||
$newbody = "[share author='" . urlencode($orig_author_name)
|
||||
. "' profile='" . $orig_author_link
|
||||
. "' avatar='" . $orig_author_photo
|
||||
. "' link='" . $orig_url
|
||||
. "' posted='" . datetime_convert('UTC','UTC',unxmlify($source_xml->post->status_message->created_at))
|
||||
. "' message_id='" . unxmlify($source_xml->post->status_message->guid)
|
||||
. "']" . $body . "[/share]";
|
||||
|
||||
|
||||
$created = unxmlify($xml->created_at);
|
||||
$private = ((unxmlify($xml->public) == 'false') ? 1 : 0);
|
||||
|
||||
$datarray = array();
|
||||
|
||||
$str_tags = '';
|
||||
|
||||
$tags = get_tags($newbody);
|
||||
|
||||
$tags = get_tags($body);
|
||||
|
||||
if(count($tags)) {
|
||||
|
||||
|
@ -1116,7 +1105,7 @@ function diaspora_reshare($importer,$xml,$msg) {
|
|||
}
|
||||
}
|
||||
|
||||
$cnt = preg_match_all('/@\[url=(.*?)\](.*?)\[\/url\]/ism',$newbody,$matches,PREG_SET_ORDER);
|
||||
$cnt = preg_match_all('/@\[url=(.*?)\](.*?)\[\/url\]/ism',$body,$matches,PREG_SET_ORDER);
|
||||
if($cnt) {
|
||||
foreach($matches as $mtch) {
|
||||
$datarray['term'][] = array(
|
||||
|
@ -1129,6 +1118,16 @@ function diaspora_reshare($importer,$xml,$msg) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$newbody = "[share author='" . urlencode($orig_author_name)
|
||||
. "' profile='" . $orig_author_link
|
||||
. "' avatar='" . $orig_author_photo
|
||||
. "' link='" . $orig_url
|
||||
. "' posted='" . datetime_convert('UTC','UTC',unxmlify($source_xml->post->status_message->created_at))
|
||||
. "' message_id='" . unxmlify($source_xml->post->status_message->guid)
|
||||
. "']" . $body . "[/share]";
|
||||
|
||||
|
||||
$plink = service_plink($contact,$guid);
|
||||
|
||||
$datarray['uid'] = $importer['channel_id'];
|
||||
|
|
|
@ -1 +1 @@
|
|||
2015-02-18.948
|
||||
2015-02-19.949
|
||||
|
|
Loading…
Reference in a new issue