diff options
author | Friendika <info@friendika.com> | 2010-12-04 23:16:16 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2010-12-04 23:16:16 -0800 |
commit | e9a1abd133aa3db62d17ef8bdc91e8a75f4004d3 (patch) | |
tree | d48e62fd2589c56d02844249e65168e7198f3029 /include/items.php | |
parent | 4507a571d3bea1fd32337565d05230ed2b2119a9 (diff) | |
download | volse-hubzilla-e9a1abd133aa3db62d17ef8bdc91e8a75f4004d3.tar.gz volse-hubzilla-e9a1abd133aa3db62d17ef8bdc91e8a75f4004d3.tar.bz2 volse-hubzilla-e9a1abd133aa3db62d17ef8bdc91e8a75f4004d3.zip |
flatten conversation hierarchy to one level on import but preserve all thread info
in case somebody wants to write a plugin to display as multi-level thread
Diffstat (limited to 'include/items.php')
-rw-r--r-- | include/items.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php index 04b86ab3f..a4d3953f9 100644 --- a/include/items.php +++ b/include/items.php @@ -553,9 +553,14 @@ function item_store($arr) { // The content body has been through a lot of filtering and transport escaping by now. // We don't want to skip any filters, however a side effect of all this filtering - // is that ampersands will have been double encoded. + // is that ampersands and <> may have been double encoded, depending on which filter chain + // they came through. - $arr['body'] = str_replace('&amp;','&',$arr['body']); + $arr['body'] = str_replace( + array('&amp;','&gt;','&lt;'), + array('&' ,'>' ,'<'), + $arr['body'] + ); @@ -576,6 +581,16 @@ function item_store($arr) { ); if(count($r)) { + + // is the new message multi-level threaded? + // even though we don't support it now, preserve the info + // and re-attach to the conversation parent. + + if($r[0]['uri'] != $r[0]['parent-uri']) { + $arr['thr-parent'] = $arr['parent-uri']; + $arr['parent-uri'] = $r[0]['parent-uri']; + } + $parent_id = $r[0]['id']; $allow_cid = $r[0]['allow_cid']; $allow_gid = $r[0]['allow_gid']; |