diff options
| author | Sadie Powell <sadie@witchery.services> | 2025-03-07 12:31:42 +0000 |
|---|---|---|
| committer | Sadie Powell <sadie@witchery.services> | 2025-03-07 12:31:42 +0000 |
| commit | b30bfb5d2b926fccd72dac7481486b66e203f2b7 (patch) | |
| tree | be2b5459c1397218f2a856d265ec9a8aaed83036 /modules/database | |
| parent | cccdf0431bd755ab927ce434458b831c58bc7244 (diff) | |
Import misc channel and user metadata in db_atheme.
Diffstat (limited to 'modules/database')
| -rw-r--r-- | modules/database/db_atheme.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/modules/database/db_atheme.cpp b/modules/database/db_atheme.cpp index ada5d25a6..912e7fd2c 100644 --- a/modules/database/db_atheme.cpp +++ b/modules/database/db_atheme.cpp @@ -23,6 +23,7 @@ #include "modules/os_news.h" #include "modules/os_oper.h" #include "modules/os_session.h" +#include "modules/set_misc.h" #include "modules/suspend.h" // Handles reading from an Atheme database row. @@ -1066,6 +1067,20 @@ private: ci->last_topic_time = Anope::Convert<time_t>(value, 0); else if (key.compare(0, 14, "private:stats:", 14) == 0) return HandleIgnoreMetadata(ci->name, key, value); + else if (key.find(':') == Anope::string::npos) + { + ExtensibleRef<MiscData> extref("cs_set_misc:" + key.upper()); + if (!extref) + { + Log(this) << "Unknown public metadata for " << ci->name << ": " << key << " = " << value; + return true; + } + + auto *data = extref->Set(ci); + data->object = ci->name; + data->name = key; + data->data = value; + } else Log(this) << "Unknown channel metadata for " << ci->name << ": " << key << " = " << value; @@ -1178,6 +1193,20 @@ private: data->vhost_ts = Anope::Convert<time_t>(value, 0); else if (key.compare(0, 18, "private:usercloak:", 18) == 0) data->vhost_nick[key.substr(18)] = value; + else if (key.find(':') == Anope::string::npos) + { + ExtensibleRef<MiscData> extref("ns_set_misc:" + key.upper()); + if (!extref) + { + Log(this) << "Unknown public channel metadata for " << nc->display << ": " << key << " = " << value; + return true; + } + + auto *data = extref->Set(nc); + data->object = nc->display; + data->name = key; + data->data = value; + } else Log(this) << "Unknown account metadata for " << nc->display << ": " << key << " = " << value; |
