Merge pull request #131 from opslag/master

feat: Make relay URL available in plugin
This commit is contained in:
Doug Hoyte
2024-12-20 14:43:03 -05:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@ void cmd_stream(const std::vector<std::string> &subArgs) {
auto &evJson = origJson.at(2); auto &evJson = origJson.at(2);
std::string okMsg; std::string okMsg;
auto res = writePolicyPlugin.acceptEvent(cfg().relay__writePolicy__plugin, evJson, EventSourceType::Stream, ws.remoteAddr, okMsg); auto res = writePolicyPlugin.acceptEvent(cfg().relay__writePolicy__plugin, evJson, EventSourceType::Stream, url, okMsg);
if (res == PluginEventSifterResult::Accept) { if (res == PluginEventSifterResult::Accept) {
downloadedIds.emplace(from_hex(evJson.at("id").get_string())); downloadedIds.emplace(from_hex(evJson.at("id").get_string()));
writer.write({ std::move(evJson), }); writer.write({ std::move(evJson), });

View File

@ -237,7 +237,7 @@ void cmd_sync(const std::vector<std::string> &subArgs) {
auto &evJson = msg.at(2); auto &evJson = msg.at(2);
std::string okMsg; std::string okMsg;
auto res = writePolicyPlugin.acceptEvent(cfg().relay__writePolicy__plugin, evJson, EventSourceType::Sync, ws.remoteAddr, okMsg); auto res = writePolicyPlugin.acceptEvent(cfg().relay__writePolicy__plugin, evJson, EventSourceType::Sync, url, okMsg);
if (res == PluginEventSifterResult::Accept) { if (res == PluginEventSifterResult::Accept) {
writer.write({ std::move(evJson), }); writer.write({ std::move(evJson), });
} else { } else {