summaryrefslogtreecommitdiff
path: root/src/messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/messages.cpp')
-rw-r--r--src/messages.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/messages.cpp b/src/messages.cpp
index 4e1bcd0db..1c035238f 100644
--- a/src/messages.cpp
+++ b/src/messages.cpp
@@ -84,10 +84,9 @@ void Join::Run(MessageSource &source, const std::vector<Anope::string> &params)
ChanUserContainer *cc = it->second;
++it;
- Anope::string channame = cc->chan->name;
FOREACH_MOD(OnPrePartChannel, (user, cc->chan));
cc->chan->DeleteUser(user);
- FOREACH_MOD(OnPartChannel, (user, Channel::Find(channame), channame, ""));
+ FOREACH_MOD(OnPartChannel, (user, cc->chan, cc->chan->name, ""));
}
continue;
}
@@ -284,16 +283,15 @@ void Part::Run(MessageSource &source, const std::vector<Anope::string> &params)
while (sep.GetToken(channel))
{
- Reference<Channel> c = Channel::Find(channel);
+ Channel *c = Channel::Find(channel);
if (!c || !u->FindChannel(c))
continue;
Log(u, c, "part") << "Reason: " << (!reason.empty() ? reason : "No reason");
FOREACH_MOD(OnPrePartChannel, (u, c));
- Anope::string ChannelName = c->name;
c->DeleteUser(u);
- FOREACH_MOD(OnPartChannel, (u, c, ChannelName, !reason.empty() ? reason : ""));
+ FOREACH_MOD(OnPartChannel, (u, c, c->name, !reason.empty() ? reason : ""));
}
}