]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/DFRN.php
Merge pull request #8629 from annando/item-insert
[friendica.git] / src / Protocol / DFRN.php
index 47272bf6c3dd5caba989aaad631d033d528a84ea..7d8bc9dc59be756c84686e3db5639c418c86f8e3 100644 (file)
@@ -1996,7 +1996,7 @@ class DFRN
                        }
 
                        $fields = ['title' => $item['title'] ?? '', 'body' => $item['body'] ?? '',
-                                       'tag' => $item['tag'] ?? '', 'changed' => DateTimeFormat::utcNow(),
+                                       'changed' => DateTimeFormat::utcNow(),
                                        'edited' => DateTimeFormat::utc($item["edited"])];
 
                        $condition = ["`uri` = ? AND `uid` IN (0, ?)", $item["uri"], $importer["importer_uid"]];
@@ -2384,7 +2384,11 @@ class DFRN
                // We store the data from "dfrn:diaspora_signature" in a different table, this is done in "Item::insert"
                $dsprsig = XML::unescape(XML::getFirstNodeValue($xpath, "dfrn:diaspora_signature/text()", $entry));
                if ($dsprsig != "") {
-                       $item["dsprsig"] = $dsprsig;
+                       $signature = json_decode(base64_decode($dsprsig));
+                       // We don't store the old style signatures anymore that also contained the "signature" and "signer"
+                       if (!empty($signature->signed_text) && empty($signature->signature) && empty($signature->signer)) {
+                               $item["diaspora_signed_text"] = $signature->signed_text;
+                       }
                }
 
                $item["verb"] = XML::getFirstNodeValue($xpath, "activity:verb/text()", $entry);
@@ -2584,7 +2588,7 @@ class DFRN
                        // Turn this into a wall post.
                        $notify = Item::isRemoteSelf($importer, $item);
 
-                       $posted_id = Item::insert($item, false, $notify);
+                       $posted_id = Item::insert($item, $notify);
 
                        if ($notify) {
                                $posted_id = $notify;