diff options
author | friendica <info@friendica.com> | 2012-04-23 18:28:33 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-04-23 18:28:33 -0700 |
commit | f265863435b15ab08e3312343672ef8d43aea76e (patch) | |
tree | f5ec71e3421554f0491a5ae2094db086f8abfd9f /mod | |
parent | af7abcea2715824cbd6460a7323c8bb64bd5b829 (diff) | |
download | volse-hubzilla-f265863435b15ab08e3312343672ef8d43aea76e.tar.gz volse-hubzilla-f265863435b15ab08e3312343672ef8d43aea76e.tar.bz2 volse-hubzilla-f265863435b15ab08e3312343672ef8d43aea76e.zip |
more work on mail2 (introductions), added 'm' (mail) flag to ACL backend for autocomplete of PM recips
Diffstat (limited to 'mod')
-rw-r--r-- | mod/acl.php | 39 | ||||
-rw-r--r-- | mod/dfrn_request.php | 16 |
2 files changed, 49 insertions, 6 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( diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index 74d25adbf..79583ea18 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -392,10 +392,22 @@ function dfrn_request_post(&$a) { ); } - // contact is created. Now send an email verify form to the requestor. - // + // contact is created. Now create an introduction + $hash = random_string(); + $r = q("insert into intro ( uid, `contact-id`, knowyou, note, hash, datetime, blocked ) + values( %d , %d, %d, '%s', '%s', '%s', %d ) ", + intval($uid), + intval($contact_id), + ((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0), + dbesc(notags(trim($_POST['dfrn-request-message']))), + dbesc($hash), + dbesc(datetime_convert()), + 1 + ); + + // Next send an email verify form to the requestor. } |