]> git.mxchange.org Git - friendica.git/blobdiff - mod/dfrn_request.php
Merge pull request #5418 from MrPetovan/task/5410-move-dba-to-src
[friendica.git] / mod / dfrn_request.php
index e8bc5092625a9033c62afd2afd965bc96c961ac8..8713785ad4e983410bc836b24a52aa486d94595d 100644 (file)
@@ -15,8 +15,8 @@
 use Friendica\App;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
-use Friendica\Core\PConfig;
 use Friendica\Core\System;
+use Friendica\Database\dba;
 use Friendica\Database\DBM;
 use Friendica\Model\Contact;
 use Friendica\Model\Group;
@@ -189,7 +189,6 @@ function dfrn_request_post(App $a)
                                }
 
                                // (ignore reply, nothing we can do it failed)
-                               // Old: goaway(Profile::zrl($dfrn_url));
                                goaway($forwardurl);
                                return; // NOTREACHED
                        }
@@ -263,13 +262,9 @@ function dfrn_request_post(App $a)
                if (DBM::is_result($r)) {
                        foreach ($r as $rr) {
                                if (!$rr['rel']) {
-                                       q("DELETE FROM `contact` WHERE `id` = %d AND NOT `self`",
-                                               intval($rr['cid'])
-                                       );
+                                       dba::delete('contact', ['id' => $rr['cid'], 'self' => false]);
                                }
-                               q("DELETE FROM `intro` WHERE `id` = %d",
-                                       intval($rr['iid'])
-                               );
+                               dba::delete('intro', ['id' => $rr['iid']]);
                        }
                }
 
@@ -581,7 +576,6 @@ function dfrn_request_content(App $a)
                                                'dfrn_id'  => $r[0]['issued-id'],
                                                'intro_id' => $intro[0]['id'],
                                                'duplex'   => (($r[0]['page-flags'] == PAGE_FREELOVE) ? 1 : 0),
-                                               'activity' => intval(PConfig::get($r[0]['uid'], 'system', 'post_newfriend'))
                                        ];
                                        dfrn_confirm_post($a, $handsfree);
                                }
@@ -617,7 +611,7 @@ function dfrn_request_content(App $a)
                } elseif (x($_GET, 'address') && ($_GET['address'] != "")) {
                        $myaddr = $_GET['address'];
                } elseif (local_user()) {
-                       if (strlen($a->path)) {
+                       if (strlen($a->urlpath)) {
                                $myaddr = System::baseUrl() . '/profile/' . $a->user['nickname'];
                        } else {
                                $myaddr = $a->user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);