]> git.mxchange.org Git - friendica.git/blobdiff - include/Contact.php
Rearranged the logging
[friendica.git] / include / Contact.php
index 13e11a83221e27323c0c9279ecf6dd7856d2ee9e..15b6813714f2bff59863bb98256c4c39def94956 100644 (file)
@@ -85,11 +85,12 @@ function contact_remove($id) {
 
 function terminate_friendship($user,$self,$contact) {
 
+       /// @TODO Get rid of this, include/datetime.php should care about it by itself
        $a = get_app();
 
        require_once('include/datetime.php');
 
-       if($contact['network'] === NETWORK_OSTATUS) {
+       if ($contact['network'] === NETWORK_OSTATUS) {
 
                require_once('include/ostatus.php');
 
@@ -99,16 +100,14 @@ function terminate_friendship($user,$self,$contact) {
                $item['follow'] = $contact["url"];
                $slap = ostatus::salmon($item, $user);
 
-               if((x($contact,'notify')) && (strlen($contact['notify']))) {
+               if ((x($contact,'notify')) && (strlen($contact['notify']))) {
                        require_once('include/salmon.php');
                        slapper($user,$contact['notify'],$slap);
                }
-       }
-       elseif($contact['network'] === NETWORK_DIASPORA) {
+       } elseif ($contact['network'] === NETWORK_DIASPORA) {
                require_once('include/diaspora.php');
-               diaspora::send_unshare($user,$contact);
-       }
-       elseif($contact['network'] === NETWORK_DFRN) {
+               Diaspora::send_unshare($user,$contact);
+       } elseif ($contact['network'] === NETWORK_DFRN) {
                require_once('include/dfrn.php');
                dfrn::deliver($user,$contact,'placeholder', 1);
        }
@@ -613,7 +612,7 @@ function get_contact($url, $uid = 0, $no_update = false) {
  *
  * @return string posts in HTML
  */
-function posts_from_gcontact($a, $gcontact_id) {
+function posts_from_gcontact(App $a, $gcontact_id) {
 
        require_once('include/conversation.php');
 
@@ -637,7 +636,7 @@ function posts_from_gcontact($a, $gcontact_id) {
        $r = q("SELECT `item`.`uri`, `item`.*, `item`.`id` AS `item_id`,
                        `author-name` AS `name`, `owner-avatar` AS `photo`,
                        `owner-link` AS `url`, `owner-avatar` AS `thumb`
-               FROM `item` FORCE INDEX (`gcontactid_uid_created`)
+               FROM `item`
                WHERE `gcontact-id` = %d AND $sql AND
                        NOT `deleted` AND NOT `moderated` AND `visible`
                ORDER BY `item`.`created` DESC LIMIT %d, %d",
@@ -665,7 +664,7 @@ function posts_from_gcontact($a, $gcontact_id) {
  *
  * @return string posts in HTML
  */
-function posts_from_contact_url($a, $contact_url) {
+function posts_from_contact_url(App $a, $contact_url) {
 
        require_once('include/conversation.php');