]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #2979 from annando/issue-2772
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Thu, 1 Dec 2016 07:51:04 +0000 (08:51 +0100)
committerGitHub <noreply@github.com>
Thu, 1 Dec 2016 07:51:04 +0000 (08:51 +0100)
Issue 2772: Pending contacts should now be displayed

1  2 
include/conversation.php
include/dfrn.php

diff --combined include/conversation.php
index 1c11d10b57643635659b3ed364c880892a39aa09,f8facc5741afa028e753fdac92146ca1e878bb1a..63db42d93ad91439b552d7213dfdd1f5fe7b5ffe
@@@ -439,7 -439,7 +439,7 @@@ These Fields are not added below (yet)
  function item_joins() {
  
        return "STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND
-               NOT `contact`.`blocked`
+               (NOT `contact`.`blocked` OR `contact`.`pending`)
                LEFT JOIN `contact` AS `author` ON `author`.`id`=`item`.`author-id`
                LEFT JOIN `contact` AS `owner` ON `owner`.`id`=`item`.`owner-id`";
  }
@@@ -885,7 -885,7 +885,7 @@@ function best_link_url($item,&$sparkle,
        $clean_url = normalise_link($item['author-link']);
  
        if (local_user()) {
-               $r = q("SELECT `id` FROM `contact` WHERE `network` = '%s' AND `uid` = %d AND `nurl` = '%s' LIMIT 1",
+               $r = q("SELECT `id` FROM `contact` WHERE `network` = '%s' AND `uid` = %d AND `nurl` = '%s' AND NOT `pending` LIMIT 1",
                        dbesc(NETWORK_DFRN), intval(local_user()), dbesc(normalise_link($clean_url)));
                if ($r) {
                        $best_url = 'redir/'.$r[0]['id'];
@@@ -1064,9 -1064,6 +1064,9 @@@ function builtin_activity_puller($item
                        else
                                $conv_responses[$mode][$item['thr-parent']] ++;
  
 +                      if((local_user()) && (local_user() == $item['uid']) && ($item['self']))
 +                              $conv_responses[$mode][$item['thr-parent'] . '-self'] = 1;
 +
                        $conv_responses[$mode][$item['thr-parent'] . '-l'][] = $url;
  
                        // there can only be one activity verb per item so if we found anything, we can stop looking
@@@ -1446,7 -1443,6 +1446,7 @@@ function get_responses($conv_responses,
                $ret[$v] = array();
                $ret[$v]['count'] = ((x($conv_responses[$v],$item['uri'])) ? $conv_responses[$v][$item['uri']] : '');
                $ret[$v]['list']  = ((x($conv_responses[$v],$item['uri'])) ? $conv_responses[$v][$item['uri'] . '-l'] : '');
 +              $ret[$v]['self']  = ((x($conv_responses[$v],$item['uri'])) ? $conv_responses[$v][$item['uri'] . '-self'] : '0');
                if(count($ret[$v]['list']) > MAX_LIKERS) {
                        $ret[$v]['list_part'] = array_slice($ret[$v]['list'], 0, MAX_LIKERS);
                        array_push($ret[$v]['list_part'], '<a href="#" data-toggle="modal" data-target="#' . $v . 'Modal-'
diff --combined include/dfrn.php
index 9cbf05ece2bf4da3374e1bc64c580ad55968e85d,49af5b2acb8ea8ea201597c9ebefa50705f81210..272105128fe07a2ea4c9711a54cdf4d52deb6c67
@@@ -3,8 -3,7 +3,8 @@@
   * @file include/dfrn.php
   * @brief The implementation of the dfrn protocol
   *
 - * https://github.com/friendica/friendica/wiki/Protocol
 + * @see https://github.com/friendica/friendica/wiki/Protocol and
 + * https://github.com/friendica/friendica/blob/master/spec/dfrn2.pdf
   */
  
  require_once("include/Contact.php");
@@@ -194,7 -193,7 +194,7 @@@ class dfrn 
                        `sign`.`signed_text`, `sign`.`signature`, `sign`.`signer`
                        FROM `item` USE INDEX (`uid_wall_changed`, `uid_type_changed`) $sql_post_table
                        STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
-                       AND NOT `contact`.`blocked`
+                       AND (NOT `contact`.`blocked` OR `contact`.`pending`)
                        LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id`
                        WHERE `item`.`uid` = %d AND `item`.`visible` AND NOT `item`.`moderated` AND `item`.`parent` != 0
                        AND `item`.`wall` AND `item`.`changed` > '%s'