diff options
author | Adam <Adam@anope.org> | 2012-06-18 05:04:30 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-06-18 05:04:30 -0400 |
commit | 2dec8e767a70def4b9b04a96ae4f75e4d1013038 (patch) | |
tree | 36f5b551ff359a578e17d5e7d2f486970d759a7b /modules/commands/cs_clone.cpp | |
parent | 873d4287de57f7f9caa23cb2c9265d1ad2804aba (diff) |
Allow userless command sources
Diffstat (limited to 'modules/commands/cs_clone.cpp')
-rw-r--r-- | modules/commands/cs_clone.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp index be6907b81..99c635c8f 100644 --- a/modules/commands/cs_clone.cpp +++ b/modules/commands/cs_clone.cpp @@ -28,7 +28,7 @@ public: const Anope::string &target = params[1]; Anope::string what = params.size() > 2 ? params[2] : ""; - User *u = source.u; + User *u = source.GetUser(); ChannelInfo *ci = cs_findchan(params[0]); if (ci == NULL) { @@ -36,7 +36,7 @@ public: return; } - if (!ci->AccessFor(u).HasPriv("SET")) + if (!source.AccessFor(ci).HasPriv("SET")) { source.Reply(ACCESS_DENIED); return; @@ -48,7 +48,7 @@ public: source.Reply(CHAN_X_NOT_REGISTERED, target.c_str()); return; } - if (!IsFounder(u, ci) || !IsFounder(u, target_ci)) + if (!source.IsFounder(ci) || !source.IsFounder(target_ci)) { source.Reply(ACCESS_DENIED); return; @@ -71,7 +71,7 @@ public: target_ci->c->CheckModes(); ChannelMode *cm; - if (u->FindChannel(target_ci->c) != NULL) + if (u && u->FindChannel(target_ci->c) != NULL) { /* On most ircds you do not receive the admin/owner mode till its registered */ if ((cm = ModeManager::FindChannelModeByName(CMODE_OWNER))) @@ -155,7 +155,7 @@ public: return; } - Log(LOG_COMMAND, u, this, ci) << "to clone " << (what.empty() ? "everything from it" : what) << " to " << target_ci->name; + Log(LOG_COMMAND, source, this, ci) << "to clone " << (what.empty() ? "everything from it" : what) << " to " << target_ci->name; return; } |