From 2a5b6277a4ed1a809c0ed7a31499d801956a53c6 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Wed, 14 Jun 2017 21:06:45 +0100 Subject: [PATCH] Expose token and a bool to tell if it's a pastie page to mustache. --- src/kamokan_impl/pastie_response.cpp | 2 ++ src/kamokan_impl/response.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/kamokan_impl/pastie_response.cpp b/src/kamokan_impl/pastie_response.cpp index a56569a..7219a21 100644 --- a/src/kamokan_impl/pastie_response.cpp +++ b/src/kamokan_impl/pastie_response.cpp @@ -182,6 +182,8 @@ namespace kamokan { boost::get(parContext["pastie"]) ); parContext["self_destructed"] = pastie_info.self_destructed; + parContext["pastie_token"] = token; + parContext["pastie_page"] = true; } std::string PastieResponse::on_mustache_retrieve() { diff --git a/src/kamokan_impl/response.cpp b/src/kamokan_impl/response.cpp index 3e72496..3f33954 100644 --- a/src/kamokan_impl/response.cpp +++ b/src/kamokan_impl/response.cpp @@ -174,6 +174,7 @@ namespace kamokan { statuslog->info("Sending response"); SPDLOG_TRACE(statuslog, "Preparing mustache dictionary"); mstch::map mustache_context { + {"pastie_page", false}, {"version", boost::string_view{STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR) "." STRINGIZE(VERSION_PATCH)}}, {"tawashi_version", tawashi::version()}, {"base_uri", base_uri()},