X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdiaspora.php;h=cfb624fdf2a075a62803649aa982658ec85f4f19;hb=6c0c9d542abaabd8000a10eb47b0921426fcd25d;hp=f2d48486788bf68145cd3dcbb22b07395b4d91f5;hpb=754de768f24872e2edf984fc22e51db70b26026b;p=friendica.git diff --git a/include/diaspora.php b/include/diaspora.php index f2d4848678..cfb624fdf2 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -319,8 +319,8 @@ class diaspora { dbesc(NETWORK_DIASPORA), dbesc($msg["author"]) ); - if($r) { - foreach($r as $rr) { + if ($r) { + foreach ($r as $rr) { logger("delivering to: ".$rr["username"]); self::dispatch($rr,$msg); } @@ -806,7 +806,7 @@ class diaspora { dbesc($guid) ); - if($r) { + if ($r) { logger("message ".$guid." already exists for user ".$uid); return $r[0]["id"]; } @@ -1278,7 +1278,7 @@ class diaspora { $r = q("SELECT `id` FROM `mail` WHERE `uri` = '%s' LIMIT 1", dbesc($message_uri) ); - if($r) { + if (dbm::is_result($r)) { logger("duplicate message already delivered.", LOGGER_DEBUG); return false; } @@ -1577,7 +1577,7 @@ class diaspora { dbesc($message_uri), intval($importer["uid"]) ); - if($r) { + if ($r) { logger("duplicate message already delivered.", LOGGER_DEBUG); return false; } @@ -2022,7 +2022,7 @@ class diaspora { FROM `item` WHERE `guid` = '%s' AND `visible` AND NOT `deleted` AND `body` != '' LIMIT 1", dbesc($guid)); - if($r) { + if ($r) { logger("reshared message ".$guid." already exists on system."); // Maybe it is already a reshared item? @@ -2290,7 +2290,7 @@ class diaspora { $body = "[img]".unxmlify($photo->remote_photo_path). unxmlify($photo->remote_photo_name)."[/img]\n".$body; - $datarray["object-type"] = ACTIVITY_OBJ_PHOTO; + $datarray["object-type"] = ACTIVITY_OBJ_IMAGE; } else { $datarray["object-type"] = ACTIVITY_OBJ_NOTE; @@ -2623,7 +2623,7 @@ class diaspora { logger("transmit: ".$logid."-".$guid." returns: ".$return_code); - if(!$return_code || (($return_code == 503) && (stristr($a->get_curl_headers(), "retry-after")))) { + if (!$return_code || (($return_code == 503) && (stristr($a->get_curl_headers(), "retry-after")))) { logger("queue message"); $r = q("SELECT `id` FROM `queue` WHERE `cid` = %d AND `network` = '%s' AND `content` = '%s' AND `batch` = %d LIMIT 1", @@ -2632,7 +2632,7 @@ class diaspora { dbesc($slap), intval($public_batch) ); - if($r) { + if ($r) { logger("add_to_queue ignored - identical item already in queue"); } else { // queue message for redelivery @@ -2925,7 +2925,7 @@ class diaspora { $p = q("SELECT `guid`, `uri`, `parent-uri` FROM `item` WHERE `uri` = '%s' LIMIT 1", dbesc($item["thr-parent"])); - if(!$p) + if (!dbm::is_result($p)) return false; $parent = $p[0]; @@ -2956,7 +2956,7 @@ class diaspora { intval($item["parent"]) ); - if (!$p) + if (!dbm::is_result($p)) return false; $parent = $p[0]; @@ -3170,7 +3170,7 @@ class diaspora { intval($item["uid"]) ); - if (!$r) { + if (!dbm::is_result($r)) { logger("conversation not found."); return; }