diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index 05ea67ea5..cfb0bd344 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -747,8 +747,8 @@ class Enotify { // generate a mime boundary $mimeBoundary = rand(0, 9) . "-" - .rand(10000000000, 9999999999) . "-" - .rand(10000000000, 9999999999) . "=:" + .rand(100000000, 999999999) . "-" + .rand(100000000, 999999999) . "=:" .rand(10000, 99999); // generate a multipart/alternative message header diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php index 35594ae9f..92e7d176d 100644 --- a/Zotlabs/Module/Acl.php +++ b/Zotlabs/Module/Acl.php @@ -268,15 +268,15 @@ class Acl extends \Zotlabs\Web\Controller { }); } } - if(intval(get_config('system','taganyone')) || intval(get_pconfig(local_channel(),'system','taganyone'))) { - if((count($r) < 100) && $type == 'c') { - $r2 = 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, 0 as abook_self - FROM xchan - WHERE xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc" - ); - if($r2) - $r = array_merge($r,$r2); - } + if((count($r) < 100) && $type == 'c') { + $r2 = 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, 0 as abook_self + FROM xchan + WHERE xchan_deleted = 0 and not xchan_network in ('rss','anon','unknown') $sql_extra2 order by $order_extra2 xchan_name asc" + ); + if($r2) { + $r = array_merge($r,$r2); + $r = unique_multidim_array($r,'hash'); + } } } elseif($type == 'm') { diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 8d017207b..e97ebf1d0 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -218,15 +218,13 @@ class Network extends \Zotlabs\Web\Controller { $contact_str = ''; $contacts = group_get_members($group); if($contacts) { - foreach($contacts as $c) { - if($contact_str) - $contact_str .= ','; - $contact_str .= "'" . $c['xchan'] . "'"; - } + $contact_str = ids_to_querystr($contacts,'xchan',true); } else { - $contact_str = ' 0 '; - info( t('Privacy group is empty')); + $contact_str = " '0' "; + if(! $update) { + info( t('Privacy group is empty')); + } } $item_thread_top = ''; $sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND (( author_xchan IN ( $contact_str ) OR owner_xchan in ( $contact_str )) or allow_gid like '" . protect_sprintf('%<' . dbesc($group_hash) . '>%') . "' ) and id = parent $item_normal ) "; @@ -480,7 +478,6 @@ class Network extends \Zotlabs\Web\Controller { $ordering = "commented"; if($load) { - // Fetch a page full of parent items for this page $r = q("SELECT item.parent AS item_id FROM item left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids ) diff --git a/include/oembed.php b/include/oembed.php index eee53b6c1..e677087a2 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -234,9 +234,11 @@ function oembed_fetch_url($embedurl){ if(preg_match('#\= 0) { // A more broad search has been performed already, so use those results - $(spinelement).hide(); +// var lterm = term.toLowerCase(); // Ignore case +// for(var t in contact_search.cache[bt]) { +// if(lterm.indexOf(t) >= 0) { // A more broad search has been performed already, so use those results +// $(spinelement).hide(); // Filter old results locally - var matching = contact_search.cache[bt][t].filter(function (x) { return (x.name.toLowerCase().indexOf(lterm) >= 0 || (typeof x.nick !== 'undefined' && x.nick.toLowerCase().indexOf(lterm) >= 0)); }); // Need to check that nick exists because groups don't have one - matching.unshift({taggable:false, text: term, replace: term}); - setTimeout(function() { callback(matching); } , 1); // Use "pseudo-thread" to avoid some problems - return; - } - } +// var matching = contact_search.cache[bt][t].filter(function (x) { return (x.name.toLowerCase().indexOf(lterm) >= 0 || (typeof x.nick !== 'undefined' && x.nick.toLowerCase().indexOf(lterm) >= 0)); }); // Need to check that nick exists because groups don't have one +// matching.unshift({taggable:false, text: term, replace: term}); +// setTimeout(function() { callback(matching); } , 1); // Use "pseudo-thread" to avoid some problems +// return; +// } +// } var postdata = { start:0, @@ -41,9 +41,9 @@ function contact_search(term, callback, backend_url, type, extra_channels, spine success: function(data){ // Cache results if we got them all (more information would not improve results) // data.count represents the maximum number of items - if(data.items.length -1 < data.count) { - contact_search.cache[bt][lterm] = data.items; - } +// if(data.items.length -1 < data.count) { +// contact_search.cache[bt][lterm] = data.items; +// } var items = data.items.slice(0); items.unshift({taggable:false, text: term, replace: term}); callback(items); diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 991a4c8b1..df67e9b2d 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -568,11 +568,14 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del function postSaveChanges(action, type) { if({{$auto_save_draft}}) { + var doctype = $('#jot-webpage').val(); + var postid = '-' + doctype + '-' + $('#jot-postid').val(); + if(action != 'clean') { - localStorage.setItem("post_title", $("#jot-title").val()); - localStorage.setItem("post_body", $("#profile-jot-text").val()); + localStorage.setItem("post_title" + postid, $("#jot-title").val()); + localStorage.setItem("post_body" + postid, $("#profile-jot-text").val()); if($("#jot-category").length) - localStorage.setItem("post_category", $("#jot-category").val()); + localStorage.setItem("post_category + postid", $("#jot-category").val()); } if(action == 'start') { @@ -589,9 +592,9 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del if(action == 'clean') { clearTimeout(postSaveTimer); postSaveTimer = null; - localStorage.removeItem("post_title"); - localStorage.removeItem("post_body"); - localStorage.removeItem("post_category"); + localStorage.removeItem("post_title" + postid); + localStorage.removeItem("post_body" + postid); + localStorage.removeItem("post_category" + postid); } } @@ -602,9 +605,11 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del var cleaned = false; if({{$auto_save_draft}}) { - var postTitle = localStorage.getItem("post_title"); - var postBody = localStorage.getItem("post_body"); - var postCategory = (($("#jot-category").length) ? localStorage.getItem("post_category") : ''); + var doctype = $('#jot-webpage').val(); + var postid = '-' + doctype + '-' + $('#jot-postid').val(); + var postTitle = localStorage.getItem("post_title" + postid); + var postBody = localStorage.getItem("post_body" + postid); + var postCategory = (($("#jot-category").length) ? localStorage.getItem("post_category" + postid) : ''); var openEditor = false; if(postTitle) { diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index bc9339d4c..9aa330c40 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -21,8 +21,8 @@ - - + +