]> git.mxchange.org Git - friendica.git/blobdiff - include/dfrn.php
Merge remote-tracking branch 'friendica/develop' into develop
[friendica.git] / include / dfrn.php
index 27be0c32a24c7e74312054b9f8edb4a0514a61b5..fef9ae2fedf07611858821eb6afb8ff2e2afd444 100644 (file)
@@ -105,8 +105,9 @@ class dfrn {
                        dbesc($owner_nick)
                );
 
-               if(! dbm::is_result($r))
+               if (! dbm::is_result($r)) {
                        killme();
+               }
 
                $owner = $r[0];
                $owner_id = $owner['uid'];
@@ -139,8 +140,9 @@ class dfrn {
                                intval($owner_id)
                        );
 
-                       if(! dbm::is_result($r))
+                       if (! dbm::is_result($r)) {
                                killme();
+                       }
 
                        $contact = $r[0];
                        require_once('include/security.php');
@@ -1159,7 +1161,7 @@ class dfrn {
 
                // Until now we aren't serving different sizes - but maybe later
                $avatarlist = array();
-               // @todo check if "avatar" or "photo" would be the best field in the specification
+               /// @todo check if "avatar" or "photo" would be the best field in the specification
                $avatars = $xpath->query($element."/atom:link[@rel='avatar']", $context);
                foreach($avatars AS $avatar) {
                        $href = "";
@@ -1379,7 +1381,7 @@ class dfrn {
 
                $objxml = $obj_doc->saveXML($obj_element);
 
-               // @todo This isn't totally clean. We should find a way to transform the namespaces
+               /// @todo This isn't totally clean. We should find a way to transform the namespaces
                $objxml = str_replace("<".$element.' xmlns="http://www.w3.org/2005/Atom">', "<".$element.">", $objxml);
                return($objxml);
        }
@@ -1463,7 +1465,7 @@ class dfrn {
                        dbesc(normalise_link($suggest["url"])),
                        intval($suggest["uid"])
                );
-               if(dbm::is_result($r))
+               if (dbm::is_result($r))
                        return false;
 
                // Do we already have an fcontact record for this person?
@@ -1474,7 +1476,7 @@ class dfrn {
                        dbesc($suggest["name"]),
                        dbesc($suggest["request"])
                );
-               if(dbm::is_result($r)) {
+               if (dbm::is_result($r)) {
                        $fid = $r[0]["id"];
 
                        // OK, we do. Do we already have an introduction for this person ?
@@ -1482,7 +1484,7 @@ class dfrn {
                                intval($suggest["uid"]),
                                intval($fid)
                        );
-                       if(dbm::is_result($r))
+                       if (dbm::is_result($r))
                                return false;
                }
                if(!$fid)
@@ -1497,7 +1499,7 @@ class dfrn {
                        dbesc($suggest["name"]),
                        dbesc($suggest["request"])
                );
-               if(dbm::is_result($r))
+               if (dbm::is_result($r))
                        $fid = $r[0]["id"];
                else
                        // database record did not get created. Quietly give up.
@@ -1525,7 +1527,7 @@ class dfrn {
                        "to_email"     => $importer["email"],
                        "uid"          => $importer["importer_uid"],
                        "item"         => $suggest,
-                       "link"         => $a->get_baseurl()."/notifications/intros",
+                       "link"         => App::get_baseurl()."/notifications/intros",
                        "source_name"  => $importer["name"],
                        "source_link"  => $importer["url"],
                        "source_photo" => $importer["photo"],
@@ -1746,7 +1748,7 @@ class dfrn {
                                LIMIT 1",
                                dbesc($item["parent-uri"])
                        );
-                       if(dbm::is_result($r)) {
+                       if (dbm::is_result($r)) {
                                $r = q("SELECT `item`.`forum_mode`, `item`.`wall` FROM `item`
                                        INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
                                        WHERE `item`.`uri` = '%s' AND (`item`.`parent-uri` = '%s' OR `item`.`thr-parent` = '%s')
@@ -1758,7 +1760,7 @@ class dfrn {
                                        dbesc($r[0]["parent-uri"]),
                                        intval($importer["importer_uid"])
                                );
-                               if(dbm::is_result($r))
+                               if (dbm::is_result($r))
                                        $is_a_remote_action = true;
                        }
 
@@ -1792,8 +1794,6 @@ class dfrn {
         * @param int $posted_id The record number of item record that was just posted
         */
        private function do_poke($item, $importer, $posted_id) {
-               $a = get_app();
-
                $verb = urldecode(substr($item["verb"],strpos($item["verb"], "#")+1));
                if(!$verb)
                        return;
@@ -1813,7 +1813,7 @@ class dfrn {
                                }
                        }
 
-                       if($Blink && link_compare($Blink,$a->get_baseurl()."/profile/".$importer["nickname"])) {
+                       if($Blink && link_compare($Blink,App::get_baseurl()."/profile/".$importer["nickname"])) {
 
                                // send a notification
                                notification(array(
@@ -1824,7 +1824,7 @@ class dfrn {
                                        "to_email"     => $importer["email"],
                                        "uid"          => $importer["importer_uid"],
                                        "item"         => $item,
-                                       "link"         => $a->get_baseurl()."/display/".urlencode(get_item_guid($posted_id)),
+                                       "link"         => App::get_baseurl()."/display/".urlencode(get_item_guid($posted_id)),
                                        "source_name"  => stripslashes($item["author-name"]),
                                        "source_link"  => $item["author-link"],
                                        "source_photo" => ((link_compare($item["author-link"],$importer["url"]))
@@ -1898,7 +1898,7 @@ class dfrn {
                                        dbesc($item["verb"]),
                                        dbesc($item["parent-uri"])
                                );
-                               if(dbm::is_result($r))
+                               if (dbm::is_result($r))
                                        return false;
 
                                $r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `author-link` = '%s' AND `verb` = '%s' AND `thr-parent` = '%s' AND NOT `deleted` LIMIT 1",
@@ -1907,7 +1907,7 @@ class dfrn {
                                        dbesc($item["verb"]),
                                        dbesc($item["parent-uri"])
                                );
-                               if(dbm::is_result($r))
+                               if (dbm::is_result($r))
                                        return false;
                        } else
                                $is_like = false;
@@ -1923,7 +1923,7 @@ class dfrn {
                                                intval($importer["importer_uid"])
                                        );
 
-                                       if(!dbm::is_result($r))
+                                       if (!dbm::is_result($r))
                                                return false;
 
                                        // extract tag, if not duplicate, add to parent item
@@ -2195,7 +2195,7 @@ class dfrn {
                                                dbesc($item["uri"]),
                                                intval($importer["uid"])
                                        );
-                                       if(dbm::is_result($r))
+                                       if (dbm::is_result($r))
                                                $ev["id"] = $r[0]["id"];
 
                                        $event_id = event_store($ev);
@@ -2216,7 +2216,7 @@ class dfrn {
                }
 
                // Update content if 'updated' changes
-               if(dbm::is_result($r)) {
+               if (dbm::is_result($r)) {
                        if (self::update_content($r[0], $item, $importer, $entrytype))
                                logger("Item ".$item["uri"]." was updated.", LOGGER_DEBUG);
                        else
@@ -2238,7 +2238,7 @@ class dfrn {
                                        intval($posted_id),
                                        intval($importer["importer_uid"])
                                );
-                               if(dbm::is_result($r)) {
+                               if (dbm::is_result($r)) {
                                        $parent = $r[0]["parent"];
                                        $parent_uri = $r[0]["parent-uri"];
                                }
@@ -2326,7 +2326,7 @@ class dfrn {
                                intval($importer["uid"]),
                                intval($importer["id"])
                        );
-               if(!dbm::is_result($r)) {
+               if (!dbm::is_result($r)) {
                        logger("Item with uri ".$uri." from contact ".$importer["id"]." for user ".$importer["uid"]." wasn't found.", LOGGER_DEBUG);
                        return;
                } else {
@@ -2420,7 +2420,7 @@ class dfrn {
                                                        dbesc($item["parent-uri"]),
                                                        intval($importer["uid"])
                                        );
-                                       if(dbm::is_result($r)) {
+                                       if (dbm::is_result($r)) {
                                                q("UPDATE `item` SET `last-child` = 1 WHERE `id` = %d",
                                                        intval($r[0]["id"])
                                                );