]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
Vier: Further improvements.
[friendica.git] / include / items.php
index 5ad89d8c180d9afeeb3e20706db2e1aeb4651cfd..4ef26fbda8a9fc6885a05b4dcac1ce6d86097ece 100755 (executable)
@@ -379,10 +379,12 @@ function title_is_body($title, $body) {
 
        $title = strip_tags($title);
        $title = trim($title);
+       $title = html_entity_decode($title, ENT_QUOTES, 'UTF-8');
        $title = str_replace(array("\n", "\r", "\t", " "), array("","","",""), $title);
 
        $body = strip_tags($body);
        $body = trim($body);
+       $body = html_entity_decode($body, ENT_QUOTES, 'UTF-8');
        $body = str_replace(array("\n", "\r", "\t", " "), array("","","",""), $body);
 
        if (strlen($title) < strlen($body))
@@ -793,6 +795,8 @@ function get_atom_elements($feed,$item) {
        // There is some better way to parse this array - but it didn't worked for me.
        $child = $item->feed->data["child"][SIMPLEPIE_NAMESPACE_ATOM_10]["feed"][0]["child"][SIMPLEPIE_NAMESPACE_ATOM_10]["entry"][0]["child"]["http://activitystrea.ms/spec/1.0/"][object][0]["child"];
        if (is_array($child)) {
+               logger('get_atom_elements: Looking for status.net repeated message');
+
                $message = $child["http://activitystrea.ms/spec/1.0/"]["object"][0]["child"][SIMPLEPIE_NAMESPACE_ATOM_10]["content"][0]["data"];
                $author = $child[SIMPLEPIE_NAMESPACE_ATOM_10]["author"][0]["child"][SIMPLEPIE_NAMESPACE_ATOM_10];
                $uri = $author["uri"][0]["data"];
@@ -801,6 +805,8 @@ function get_atom_elements($feed,$item) {
                $avatar = $avatar["href"];
 
                if (($name != "") and ($uri != "") and ($avatar != "") and ($message != "")) {
+                       logger('get_atom_elements: fixing sender of repeated message');
+
                        $res["owner-name"] = $res["author-name"];
                        $res["owner-link"] = $res["author-link"];
                        $res["owner-avatar"] = $res["author-avatar"];
@@ -3289,7 +3295,7 @@ function new_follower($importer,$contact,$datarray,$item,$sharing = false) {
        if(is_array($contact)) {
                if(($contact['network'] == NETWORK_OSTATUS && $contact['rel'] == CONTACT_IS_SHARING)
                        || ($sharing && $contact['rel'] == CONTACT_IS_FOLLOWER)) {
-                       $r = q("UPDATE `contact` SET `rel` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1",
+                       $r = q("UPDATE `contact` SET `rel` = %d, `writable` = 1 WHERE `id` = %d AND `uid` = %d LIMIT 1",
                                intval(CONTACT_IS_FRIEND),
                                intval($contact['id']),
                                intval($importer['uid'])