From 8b9acf750bde9b21551367f34e57ff549d7d3297 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 24 Oct 2018 20:22:27 +0200 Subject: autocomplete performance: this slightly changes the editor contact autocomplete behaviour. queries using *like* with a prepended % to the query string do not make use of indices. this is no big issue when we query abook but can get really slow when xchan table is involved. this commit changes the xchan table only queries to use the *str%* format. this means that the result set for channels we are not connected with will change in a way that xchan_name and xchan_addr will bematched only from the beginning of the name or address. this commit also changes textcomplete to only start the query after the 3rd character. the result set between 2 and 3 characters is mostly very different and only from 3 chars on there is a high possibility the channel we look for is already in the result. --- view/js/autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'view') diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js index aa580b163..6b77f0631 100644 --- a/view/js/autocomplete.js +++ b/view/js/autocomplete.js @@ -163,7 +163,7 @@ function string2bb(element) { // Autocomplete contacts contacts = { - match: /(^|\s)(@\!*)([^ \n]{2,})$/, + match: /(^|\s)(@\!*)([^ \n]{3,})$/, index: 3, cache: true, search: function(term, callback) { contact_search(term, callback, backend_url, 'c', extra_channels, spinelement=false); }, -- cgit v1.2.3 From 5c4fbbebe1bd633e30a907b4a188d04c2f2f4fb0 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 24 Oct 2018 20:58:25 +0200 Subject: refine stream filter and forum notification behaviour (mostly for performance). personal posts will be displayed in unthreaded mode and clicking a forum notification will show only the unseen items of the forum in unthreaded mode. group the filters in the widget - threaded at the top, unthreaded beneath. --- view/tpl/build_query.tpl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'view') diff --git a/view/tpl/build_query.tpl b/view/tpl/build_query.tpl index 2c55a8140..fcb22b605 100755 --- a/view/tpl/build_query.tpl +++ b/view/tpl/build_query.tpl @@ -31,6 +31,7 @@ var bParam_verb = "{{$verb}}"; var bParam_net = "{{$net}}"; var bParam_pf = "{{$pf}}"; + var bParam_unseen = "{{$unseen}}"; function buildCmd() { var udargs = ((page_load) ? "/load" : ""); @@ -62,6 +63,7 @@ if(bParam_net != "") bCmd = bCmd + "&net=" + bParam_net; if(bParam_page != 1) bCmd = bCmd + "&page=" + bParam_page; if(bParam_pf != 0) bCmd = bCmd + "&pf=" + bParam_pf; + if(bParam_unseen != 0) bCmd = bCmd + "&unseen=" + bParam_unseen; return(bCmd); } -- cgit v1.2.3 From 25c7e64ded56fcd8030cb898ba187be612c7b0f1 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 24 Oct 2018 23:06:32 +0200 Subject: fix get on {1} --- view/tpl/notifications_widget.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'view') diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index 9b3d7487e..f43d82301 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -143,7 +143,7 @@