aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/notifier.php20
-rw-r--r--mod/acl.php21
-rw-r--r--mod/item.php21
-rw-r--r--version.inc2
4 files changed, 41 insertions, 23 deletions
diff --git a/include/notifier.php b/include/notifier.php
index 4b387513b..dbae6211c 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -265,23 +265,9 @@ function notifier_run($argv, $argc){
if($target_item['item_restrict'] & ITEM_DELETED)
logger('notifier: target item ITEM_DELETED', LOGGER_DEBUG);
- if($target_item['item_restrict'] & ITEM_DELAYED_PUBLISH) {
- logger('notifier: target item ITEM_DELAYED_PUBLISH', LOGGER_DEBUG);
- return;
- }
-
- if($target_item['item_restrict'] & ITEM_WEBPAGE) {
- logger('notifier: target item ITEM_WEBPAGE', LOGGER_DEBUG);
- return;
- }
-
- if($target_item['item_restrict'] & ITEM_BUILDBLOCK) {
- logger('notifier: target item ITEM_BUILDBLOCK', LOGGER_DEBUG);
- return;
- }
-
- if($target_item['item_restrict'] & ITEM_PDL) {
- logger('notifier: target item ITEM_PDL', LOGGER_DEBUG);
+ $unforwardable = ITEM_UNPUBLISHED|ITEM_DELAYED_PUBLISH|ITEM_WEBPAGE|ITEM_BUILDBLOCK|ITEM_PDL;
+ if($target_item['item_restrict'] & $unforwardable) {
+ logger('notifier: target item not forwardable: flags ' . $target_item['item_restrict'], LOGGER_DEBUG);
return;
}
diff --git a/mod/acl.php b/mod/acl.php
index 0f997c8b8..9bd1a9eb4 100644
--- a/mod/acl.php
+++ b/mod/acl.php
@@ -55,6 +55,17 @@ function acl_init(&$a){
intval(XCHAN_FLAGS_DELETED)
);
$contact_count = (int)$r[0]['c'];
+
+ if(intval(get_config('system','taganyone')) || intval(get_pconfig(local_user(),'system','taganyone'))) {
+ if(((! $r) || (! $r[0]['total'])) && $type == 'c') {
+ $r = q("SELECT COUNT(xchan_hash) AS c FROM xchan
+ WHERE not (xchan_flags & %d ) $sql_extra2" ,
+ intval(XCHAN_FLAGS_DELETED)
+ );
+ $contact_count = (int)$r[0]['c'];
+ }
+ }
+
}
elseif ($type == 'm') {
@@ -134,7 +145,15 @@ function acl_init(&$a){
intval(ABOOK_FLAG_BLOCKED|ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED),
intval(XCHAN_FLAGS_DELETED)
);
-
+ if(intval(get_config('system','taganyone')) || intval(get_pconfig(local_user(),'system','taganyone'))) {
+ if((! $r) && $type == 'c') {
+ $r = q("SELECT substr(xchan_hash,1,18) as id, xchan_hash as hash, xchan_name as name, xchan_photo_s as micro, xchan_url as url, xchan_addr as nick, 0 as abook_their_perms, 0 as abook_flags
+ FROM xchan
+ WHERE not (xchan_flags & %d ) $sql_extra2 order by xchan_name asc" ,
+ intval(XCHAN_FLAGS_DELETED)
+ );
+ }
+ }
}
elseif($type == 'm') {
diff --git a/mod/item.php b/mod/item.php
index e88f9a2a3..be59bd4c7 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -981,24 +981,37 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) {
}
// Here we're looking for an address book entry as provided by the auto-completer
- // of the form something+nnn where nnn is an abook_id
+ // of the form something+nnn where nnn is an abook_id or the first chars of xchan_hash
if(strrpos($newname,'+')) {
//get the id
- $tagcid = intval(substr($newname,strrpos($newname,'+') + 1));
+
+ if(strrpos($tagcid,' '))
+ $tagcid = substr($tagcid,0,strrpos($tagcid,' '));
+
+ $tagcid = substr($newname,strrpos($newname,'+') + 1);
+
+ if(strlen($tagcid) < 16)
+ $abook_id = intval($tagcid);
//remove the next word from tag's name
if(strpos($name,' ')) {
$name = substr($name,0,strpos($name,' '));
}
- if($tagcid) { // if there was an id
+ if($abook_id) { // if there was an id
// select channel with that id from the logged in user's address book
$r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
- intval($tagcid),
+ intval($abook_id),
intval($profile_uid)
);
}
+ else {
+ $r = q("SELECT * FROM xchan
+ WHERE xchan_hash like '%s%%' LIMIT 1",
+ dbesc($tagcid)
+ );
+ }
}
if(! $r) {
diff --git a/version.inc b/version.inc
index f409b226a..63797b7eb 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-04-14.646
+2014-04-15.647