aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-04-04 16:56:49 -0700
committerfriendica <info@friendica.com>2014-04-04 16:56:49 -0700
commit97f0424b1819394a774d6edd076990b006a0168a (patch)
treea36caaeccffc6c8bb91e1c1100e3541b5c13fffc
parent22cdfef21635f01088acbc1538c99a761a86f22d (diff)
downloadvolse-hubzilla-97f0424b1819394a774d6edd076990b006a0168a.tar.gz
volse-hubzilla-97f0424b1819394a774d6edd076990b006a0168a.tar.bz2
volse-hubzilla-97f0424b1819394a774d6edd076990b006a0168a.zip
introduce a connection type called 'ifpending' for number 6 of issue #395 - so that we can still have an unconditional 'pending' link. Needs testing before integrating with the nav menu
-rw-r--r--include/nav.php2
-rw-r--r--mod/connections.php20
2 files changed, 21 insertions, 1 deletions
diff --git a/include/nav.php b/include/nav.php
index 3aa50226d..6a28ebe93 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -162,7 +162,7 @@ EOT;
$nav['home']['mark'] = array('', t('Mark all channel notifications seen'), '','');
- $nav['intros'] = array('connections/pending', t('Intros'), "", t('New Connections'));
+ $nav['intros'] = array('connections/pending', t('Connections'), "", t('Connections'));
$nav['notifications'] = array('notifications/system', t('Notices'), "", t('Notifications'));
diff --git a/mod/connections.php b/mod/connections.php
index dbdcbdc93..99a4d6969 100644
--- a/mod/connections.php
+++ b/mod/connections.php
@@ -212,6 +212,26 @@ function connections_content(&$a) {
$pending = true;
nav_set_selected('intros');
break;
+ case 'ifpending':
+ $r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and not (abook_flags & %d) and not (xchan_flags & %d ) and (abook_flags & %d) and not (abook_flags & %d)",
+ intval(local_user()),
+ intval(ABOOK_FLAG_SELF),
+ intval(XCHAN_FLAGS_DELETED),
+ intval(ABOOK_FLAG_PENDING),
+ intval(ABOOK_FLAG_IGNORED)
+ );
+ if($r && $r[0]['total']) {
+ $search_flags = ABOOK_FLAG_PENDING;
+ $head = t('New');
+ $pending = true;
+ nav_set_selected('intros');
+ }
+ else {
+ $head = t('All');
+ $search_flags = 0;
+ $all = true;
+ }
+ break;
case 'unconnected':
$search_flags = ABOOK_FLAG_UNCONNECTED;
$head = t('Unconnected');