Commit b9528a6c authored by Tammo Ronke's avatar Tammo Ronke

v23424324wer32sdfklj34tigkvr

parent 7da583fa
......@@ -104,11 +104,16 @@ server.get("/redirect/:address/:url", (req, res, next) => {
console.log("Not base64 encoded!");
}
if (url && address) {
address = JSON.parse(address);
bot.loadSession(address, (error, session) => {
console.log(session.userData.recentQueries);
let suggestion = suggestionStore.getSuggestionByUrl(
address,
session.userData
);
suggestionStore.addAnalytic(
address,
true,
......@@ -118,8 +123,9 @@ server.get("/redirect/:address/:url", (req, res, next) => {
});
res.setHeader("Content-Type", "text/html");
res.setHeader("Location", url);
res.writeHead(307);
res.end(`<script>window.location = '${url}';</script>`);
res.end();
next();
}
});
......@@ -37,7 +37,7 @@ const suggCard = (session, sugg) => {
builder.CardAction.openUrl(
session,
`http://localhost:3978/redirect/${base64.encode(
session.logger.address.id
JSON.stringify(session.logger.address)
)}/${base64.encode(sugg.url)}`,
"Open Website"
),
......
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