]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/DFRN.php
Move FSuggest to depository
[friendica.git] / src / Protocol / DFRN.php
index 8c511c2cd5fbe1b1225e3ab04e5501501b8f9a4c..a9918bbd02337e6a4da4a3b9d590450998b7643f 100644 (file)
@@ -1352,7 +1352,7 @@ class DFRN
                }
 
                // Quit if we already have an introduction for this person
-               if (DBA::exists('intro', ['uid' => $uid, 'suggest-cid' => $cid])) {
+               if (DI::intro()->suggestionExistsForUser($cid, $uid)) {
                        return false;
                }
 
@@ -1366,10 +1366,13 @@ class DFRN
                $suggest['title'] = '';
                $suggest['body'] = $note;
 
-               $hash = Strings::getRandomHex();
-               $fields = ['uid' => $suggest['uid'], 'suggest-cid' => $cid, 'contact-id' => $suggest['cid'],
-                       'note' => $suggest['body'], 'hash' => $hash, 'datetime' => DateTimeFormat::utcNow(), 'blocked' => false];
-               DBA::insert('intro', $fields);
+               DI::intro()->save(DI::introFactory()->createNew(
+                       $suggest['uid'],
+                       $suggest['cid'],
+                       $suggest['body'],
+                       null,
+                       $cid
+               ));
 
                DI::notify()->createFromArray([
                        'type'  => Notification\Type::SUGGEST,