diff --git a/contrib/backends/nntpchan-daemon/libnntpchan/nntp_handler.cpp b/contrib/backends/nntpchan-daemon/libnntpchan/nntp_handler.cpp index a4c675f..6ecf4b0 100644 --- a/contrib/backends/nntpchan-daemon/libnntpchan/nntp_handler.cpp +++ b/contrib/backends/nntpchan-daemon/libnntpchan/nntp_handler.cpp @@ -169,6 +169,7 @@ void NNTPServerHandler::ArticleObtained() { m_article->close(); m_article = nullptr; + m_store.EnsureSymlinks(m_articleName); QueueLine("239 " + m_articleName); std::cerr << "stored " << m_articleName << std::endl; } diff --git a/contrib/backends/nntpchan-daemon/libnntpchan/storage.cpp b/contrib/backends/nntpchan-daemon/libnntpchan/storage.cpp index f31262c..eec66a7 100644 --- a/contrib/backends/nntpchan-daemon/libnntpchan/storage.cpp +++ b/contrib/backends/nntpchan-daemon/libnntpchan/storage.cpp @@ -80,7 +80,10 @@ bool ArticleStorage::LoadThread(Thread &thread, const std::string &rootmsgid) co void ArticleStorage::EnsureSymlinks(const std::string &msgid) const { std::string msgidhash = Blake2B_base32(msgid); - skiplist_dir(posts_skiplist_dir, msgidhash); + auto skip = skiplist_dir(skiplist_root(posts_skiplist_dir), msgidhash) / msgidhash; + auto path = fs::path("..") / fs::path("..") / fs::path("..") / MessagePath(msgid); + fs::create_symlink(path, skip); + errno = 0; } fs::path ArticleStorage::skiplist_root(const std::string &name) const { return basedir / name; }