1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 02:46:37 +02:00

Store the setter and ts for all modes and try to restore them.

This is mostly for preserving channel list mode info.
This commit is contained in:
Sadie Powell
2025-05-03 17:07:07 +01:00
parent c955941413
commit 010beb52b1
26 changed files with 341 additions and 218 deletions
+6 -6
View File
@@ -220,15 +220,15 @@ public:
}
std::vector<Anope::string> modelist = { "+" };
for (const auto &[mname, mvalue] : c->GetModes())
for (const auto &[mname, mdata] : c->GetModes())
{
auto *cm = ModeManager::FindChannelModeByName(mname);
if (!cm || cm->type == MODE_LIST)
continue;
modelist.front().push_back(cm->mchar);
if (!mvalue.empty())
modelist.push_back(mvalue);
if (!mdata.value.empty())
modelist.push_back(mdata.value);
}
auto &modes = root.ReplyArray("modes");
for (const auto &modeparam : modelist)
@@ -522,15 +522,15 @@ public:
root.Reply("fingerprint", u->fingerprint);
std::vector<Anope::string> modelist = { "+" };
for (const auto &[mname, mvalue] : u->GetModeList())
for (const auto &[mname, mdata] : u->GetModeList())
{
auto *um = ModeManager::FindUserModeByName(mname);
if (!um || um->type == MODE_LIST)
continue;
modelist.front().push_back(um->mchar);
if (!mvalue.empty())
modelist.push_back(mvalue);
if (!mdata.value.empty())
modelist.push_back(mdata.value);
}
auto &modes = root.ReplyArray("modes");
for (const auto &modeparam : modelist)