- 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;
-
- strlcpy(topic, parameters[1].c_str(), MAXTOPIC-1);
- FOREACH_RESULT(I_OnLocalTopicChange,OnLocalTopicChange(user,Ptr,topic));
- if (MOD_RESULT)
- return CMD_FAILURE;
-
- strlcpy(Ptr->topic, topic, MAXTOPIC-1);
- }
- else
- {
- /* Sneaky shortcut, one string copy for a remote topic */
- strlcpy(Ptr->topic, parameters[1].c_str(), MAXTOPIC-1);
- }
-
- if (ServerInstance->Config->FullHostInTopic)
- strlcpy(Ptr->setby,user->GetFullHost(),127);
- else
- strlcpy(Ptr->setby,user->nick,127);
+ // Access checks are skipped for non-local users
+ if (!IS_LOCAL(user))
+ {
+ c->SetTopic(user, parameters[1]);
+ return CMD_SUCCESS;
+ }