- std::string topic;
-
- if (IS_LOCAL(user))
- {
- /* XXX: we need two string copies for a local topic, because we cant
- * let a module see the topic as longer than it actually is
- */
- int MOD_RESULT = 0;
-
- topic.assign(parameters[1], 0, ServerInstance->Config->Limits.MaxTopic);
- FOREACH_RESULT(I_OnLocalTopicChange,OnLocalTopicChange(user,Ptr,topic));
- if (MOD_RESULT)
- return CMD_FAILURE;
-
- Ptr->topic.assign(topic, 0, ServerInstance->Config->Limits.MaxTopic);
- }
- else
- {
- /* Sneaky shortcut, one string copy for a remote topic */
- Ptr->topic.assign(parameters[1], 0, ServerInstance->Config->Limits.MaxTopic);
- }
-
- Ptr->setby.assign(ServerInstance->Config->FullHostInTopic ?
- user->GetFullHost() : user->nick,
- 0, 128);
+ // Access checks are skipped for non-local users
+ if (!IS_LOCAL(user))
+ {
+ c->SetTopic(user, parameters[1]);
+ return CMD_SUCCESS;
+ }