]> git.mxchange.org Git - friendica.git/blobdiff - include/ostatus.php
Merge branch 'develop' of github.com:friendica/friendica into rewrites/coding-convent...
[friendica.git] / include / ostatus.php
index 1e23e7bc32c2ff2723e7289bd0071a5b971e53b7..a1da94f6a77fa915cafc613e147fb93e18fa1d54 100644 (file)
@@ -70,6 +70,7 @@ class ostatus {
                        $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `nurl` IN ('%s', '%s') AND `network` != '%s'",
                                intval($importer["uid"]), dbesc(normalise_link($author["author-link"])),
                                dbesc(normalise_link($aliaslink)), dbesc(NETWORK_STATUSNET));
+
                        if (dbm::is_result($r)) {
                                $contact = $r[0];
                                $author["contact-id"] = $r[0]["id"];
@@ -79,6 +80,7 @@ class ostatus {
                        // Should not happen
                        $contact = dba::fetch_first("SELECT * FROM `contact` WHERE `uid` = ? AND `addr` = ? AND `network` != ?",
                                        $importer["uid"], $addr, NETWORK_STATUSNET);
+
                        if (dbm::is_result($contact)) {
                                $author["contact-id"] = $contact["id"];
                                $author["author-link"] = $contact["url"];
@@ -87,17 +89,20 @@ class ostatus {
 
                $avatarlist = array();
                $avatars = $xpath->query("atom:author/atom:link[@rel='avatar']", $context);
-               foreach($avatars AS $avatar) {
+               foreach ($avatars AS $avatar) {
                        $href = "";
                        $width = 0;
-                       foreach($avatar->attributes AS $attributes) {
-                               if ($attributes->name == "href")
+                       foreach ($avatar->attributes AS $attributes) {
+                               if ($attributes->name == "href") {
                                        $href = $attributes->textContent;
-                               if ($attributes->name == "width")
+                               }
+                               if ($attributes->name == "width") {
                                        $width = $attributes->textContent;
+                               }
                        }
-                       if (($width > 0) AND ($href != ""))
+                       if (($width > 0) AND ($href != "")) {
                                $avatarlist[$width] = $href;
+                       }
                }
                if (count($avatarlist) > 0) {
                        krsort($avatarlist);
@@ -105,8 +110,9 @@ class ostatus {
                }
 
                $displayname = $xpath->evaluate('atom:author/poco:displayName/text()', $context)->item(0)->nodeValue;
-               if ($displayname != "")
+               if ($displayname != "") {
                        $author["author-name"] = $displayname;
+               }
 
                $author["owner-name"] = $author["author-name"];
                $author["owner-link"] = $author["author-link"];
@@ -446,7 +452,7 @@ class ostatus {
                                        foreach ($category->attributes AS $attributes) {
                                                if ($attributes->name == "term") {
                                                        $term = $attributes->textContent;
-                                                       if(strlen($item["tag"])) {
+                                                       if (strlen($item["tag"])) {
                                                                $item["tag"] .= ',';
                                                        }
                                                        $item["tag"] .= "#[url=".App::get_baseurl()."/search?tag=".$term."]".$term."[/url]";
@@ -1146,6 +1152,7 @@ class ostatus {
                                continue;
                        }
 
+                       /// @TODO One statment is okay (until if () )
                        $arr = array();
                        $arr["network"] = $details["network"];
                        $arr["uri"] = $single_conv->id;
@@ -2211,7 +2218,7 @@ class ostatus {
 
                $owner = $r[0];
 
-               if(!strlen($last_update))
+               if (!strlen($last_update))
                        $last_update = 'now -30 days';
 
                $check_date = datetime_convert('UTC','UTC',$last_update,'Y-m-d H:i:s');