Getting rid of default searxng params. Making it optional.
This commit is contained in:
@@ -7,7 +7,7 @@ function Searxng(matrixClient) {
|
|||||||
this.roomCooldowns = new Map();
|
this.roomCooldowns = new Map();
|
||||||
this.roomUserWhitelists = new Map();
|
this.roomUserWhitelists = new Map();
|
||||||
this.searxngInstance = "";
|
this.searxngInstance = "";
|
||||||
this.searxngParameters = "enabled_engines=duckduckgo images__images,google images__images,bing images__images&disabled_engines=flickr__images,nyaa__images,qwant images__images,artic__images,deviantart__images,library of congress__images,unsplash__images,openverse__images";
|
this.searxngParameters = "";
|
||||||
this.logSearches = false;
|
this.logSearches = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +228,7 @@ Searxng.prototype.handleMessage = function(event, room) {
|
|||||||
const name = toSearch.trim();
|
const name = toSearch.trim();
|
||||||
toSearch = encodeURIComponent(toSearch);
|
toSearch = encodeURIComponent(toSearch);
|
||||||
|
|
||||||
const searchURL = this.searxngInstance + "/search?category_images=1&pageno=1&time_range=&format=json&"+this.searxngParameters+"&safesearch="+(messagePieces[0] == unsafeImageSearchCmd ? "0" : "1")+"&q=" + toSearch;
|
const searchURL = this.searxngInstance + "/search?category_images=1&pageno=1&time_range=&format=json"+(this.searxngParameters.length() > 0 ? "&"+this.searxngParameters : "")+"&safesearch="+(messagePieces[0] == unsafeImageSearchCmd ? "0" : "1")+"&q=" + toSearch;
|
||||||
this.matrixClient.sendTyping(room.roomId, true, 3000);
|
this.matrixClient.sendTyping(room.roomId, true, 3000);
|
||||||
const matrixClient = this.matrixClient;
|
const matrixClient = this.matrixClient;
|
||||||
const uploadMatrixClient = this.uploadMatrixClient;
|
const uploadMatrixClient = this.uploadMatrixClient;
|
||||||
|
|||||||
Reference in New Issue
Block a user