Commit 332649d1 authored by Tammo Ronke's avatar Tammo Ronke

v23424324wer32sdfklj34tigkv<sdflkaj34tiojr

parent 26e75af6
......@@ -116,7 +116,7 @@ server.get("/redirect/:address/:url", (req, res, next) => {
session.userData
);
suggestionStore.addAnalytic(
suggestionStore.setAnalytic(
address,
true,
suggestion.rating,
......
......@@ -5,7 +5,9 @@ var answers = require("../speech/answers");
module.exports = [
(session, args, next) => {
session.send(
answers.formatedRandomAnswer("recent.loading", [session.userData.name])
answers.formatedRandomAnswer("recent.loading", [
session.userData.name
])
);
setTimeout(() => next(), 700);
},
......
......@@ -21,7 +21,12 @@ module.exports = [
const suggCards = (session, args) => {
let cards = [];
args.forEach(element => {
cards.push(suggCard(session, element));
let img = GSearch.getImg(element.title);
if (!img) {
img =
"https://www.google.com/s2/favicons?domain_url=" + element.url;
}
cards.push(suggCard(session, element, img));
});
return new builder.Message(session)
......@@ -29,10 +34,10 @@ const suggCards = (session, args) => {
.attachments(cards);
};
const suggCard = (session, sugg) => {
const suggCard = (session, sugg, img) => {
return new builder.ThumbnailCard(session)
.title(sugg.title)
.images([builder.CardImage.create(session, GSearch.getImg(sugg.title))])
.images([builder.CardImage.create(session, img)])
.buttons([
builder.CardAction.openUrl(
session,
......
......@@ -27,7 +27,7 @@ var addHistory = (suggestions, userData) => {
var getSuggestionByUrl = (url, userData) => {
if (!userData.recentQueries) userData.recentQueries = [];
return userData.recentQueries.find(s => s.url === url);
return userData.recentQueries.filter(value => value.url != url)[0];
};
var addQuery = (query, userData) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment