aboutsummaryrefslogtreecommitdiffstats
path: root/mod/acl.php
diff options
context:
space:
mode:
authorVasudev Kamath <kamathvasudev@gmail.com>2012-04-27 22:43:26 +0530
committerVasudev Kamath <kamathvasudev@gmail.com>2012-04-27 22:43:26 +0530
commit214ec91a3f2c5fec6cced93f669b3a9725f0e40a (patch)
treed05fd4c7e65cc89cf46d8347a2d0e6df135ed864 /mod/acl.php
parentf1d84c10458986a0a014f844e784617401764b29 (diff)
parent4b92e3543c9af26e590cfecf561ff7483e66e6c9 (diff)
downloadvolse-hubzilla-214ec91a3f2c5fec6cced93f669b3a9725f0e40a.tar.gz
volse-hubzilla-214ec91a3f2c5fec6cced93f669b3a9725f0e40a.tar.bz2
volse-hubzilla-214ec91a3f2c5fec6cced93f669b3a9725f0e40a.zip
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'mod/acl.php')
-rw-r--r--mod/acl.php39
1 files changed, 35 insertions, 4 deletions
diff --git a/mod/acl.php b/mod/acl.php
index fe353d1eb..c23ee1a67 100644
--- a/mod/acl.php
+++ b/mod/acl.php
@@ -38,6 +38,22 @@ function acl_init(&$a){
intval(local_user())
);
$contact_count = (int)$r[0]['c'];
+ }
+ elseif ($type == 'm') {
+
+ // autocomplete for Private Messages
+
+ $r = q("SELECT COUNT(`id`) AS c FROM `contact`
+ WHERE `uid` = %d AND `self` = 0
+ AND `blocked` = 0 AND `pending` = 0
+ AND `network` IN ('%s','%s','%s') $sql_extra2" ,
+ intval(local_user()),
+ dbesc(NETWORK_DFRN),
+ dbesc(NETWORK_ZOT),
+ dbesc(NETWORK_DIASPORA)
+ );
+ $contact_count = (int)$r[0]['c'];
+
} else {
$contact_count = 0;
}
@@ -83,6 +99,23 @@ function acl_init(&$a){
ORDER BY `name` ASC ",
intval(local_user())
);
+ }
+ elseif($type == 'm') {
+ $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
+ WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0
+ AND `network` IN ('%s','%s','%s')
+ $sql_extra2
+ ORDER BY `name` ASC ",
+ intval(local_user()),
+ dbesc(NETWORK_DFRN),
+ dbesc(NETWORK_ZOT),
+ dbesc(NETWORK_DIASPORA)
+ );
+ }
+ else
+ $r = array();
+
+ if(count($r)) {
foreach($r as $g){
$contacts[] = array(
"type" => "c",
@@ -93,11 +126,9 @@ function acl_init(&$a){
"link" => $g['url'],
"nick" => ($g['attag']) ? $g['attag'] : $g['nick'],
);
- }
-
+ }
}
-
-
+
$items = array_merge($groups, $contacts);
$o = array(