aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_permchannels.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-10-29 16:35:12 +0100
committerGravatar Sadie Powell2022-10-29 16:35:12 +0100
commitdac556b55b516ee2e322a2ffba714bc92c2bbcc1 (patch)
tree4788086ae4dc3f14c8e324a86eab904207d6c356 /src/modules/m_permchannels.cpp
parentRename session registration to connection to avoid a semantic conflict. (diff)
parentAdd a workaround for a conflict between libmysqlclient and pcre. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_permchannels.cpp')
-rw-r--r--src/modules/m_permchannels.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp
index e1daac763..c2572ab12 100644
--- a/src/modules/m_permchannels.cpp
+++ b/src/modules/m_permchannels.cpp
@@ -135,11 +135,15 @@ static bool WriteDatabase(PermChannel& permchanmode, bool save_listmodes)
}
stream << "<permchannels channel=\"" << ServerConfig::Escape(chan->name)
- << "\" ts=\"" << chan->age
- << "\" topic=\"" << ServerConfig::Escape(chan->topic)
- << "\" topicts=\"" << chan->topicset
- << "\" topicsetby=\"" << ServerConfig::Escape(chan->setby)
- << "\" modes=\"" << ServerConfig::Escape(chanmodes)
+ << "\" ts=\"" << chan->age;
+ if (!chan->topic.empty())
+ {
+ // Only store the topic if one is set.
+ stream << "\" topic=\"" << ServerConfig::Escape(chan->topic)
+ << "\" topicts=\"" << chan->topicset
+ << "\" topicsetby=\"" << ServerConfig::Escape(chan->setby);
+ }
+ stream << "\" modes=\"" << ServerConfig::Escape(chanmodes)
<< "\">" << std::endl;
}