diff options
| author | 2016-04-11 15:53:01 +0200 | |
|---|---|---|
| committer | 2016-04-11 15:53:01 +0200 | |
| commit | 2706a993b3f8ee52e2728047fad6a56f7e3cf405 (patch) | |
| tree | 30d99f78630372bbe630fcf47f2f32fc8891fbe9 /src/modules/m_permchannels.cpp | |
| parent | Merge pull request #1168 from SaberUK/master+fix-configure-cache-parser (diff) | |
Refactor topic setting logic to go through Channel::SetTopic() in all cases
- Pass topic set time and optionally the setter to SetTopic()
- Don't do anything if the topic is changed by a local user to what it is currently
Diffstat (limited to 'src/modules/m_permchannels.cpp')
| -rw-r--r-- | src/modules/m_permchannels.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/m_permchannels.cpp b/src/modules/m_permchannels.cpp index 22513abea..9a5da5ce4 100644 --- a/src/modules/m_permchannels.cpp +++ b/src/modules/m_permchannels.cpp @@ -207,16 +207,16 @@ public: c = new Channel(channel, TS); unsigned int topicset = tag->getInt("topicts"); - c->topic = tag->getString("topic"); + std::string topic = tag->getString("topic"); - if ((topicset != 0) || (!c->topic.empty())) + if ((topicset != 0) || (!topic.empty())) { if (topicset == 0) topicset = ServerInstance->Time(); - c->topicset = topicset; - c->setby = tag->getString("topicsetby"); - if (c->setby.empty()) - c->setby = ServerInstance->Config->ServerName; + std::string topicsetby = tag->getString("topicsetby"); + if (topicsetby.empty()) + topicsetby = ServerInstance->Config->ServerName; + c->SetTopic(ServerInstance->FakeClient, topic, topicset, &topicsetby); } ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Added %s with topic %s", channel.c_str(), c->topic.c_str()); |
