From 80894752a760dbfb2fb44dfc8c7f8e317adba1c1 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 22 Jun 2023 16:40:05 +0100 Subject: Make JoinUser return a Membership instead of a Channel. --- src/modules/m_ojoin.cpp | 10 +++++----- src/modules/m_sajoin.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_ojoin.cpp b/src/modules/m_ojoin.cpp index f12dd8b5e..6538ed981 100644 --- a/src/modules/m_ojoin.cpp +++ b/src/modules/m_ojoin.cpp @@ -54,19 +54,19 @@ public: active = true; // override is false because we want OnUserPreJoin to run - Channel* channel = Channel::JoinUser(user, parameters[0], false); + Membership* memb = Channel::JoinUser(user, parameters[0], false); active = false; - if (channel) + if (memb) { - ServerInstance->SNO.WriteGlobalSno('a', user->nick+" used OJOIN to join "+channel->name); + ServerInstance->SNO.WriteGlobalSno('a', user->nick+" used OJOIN to join "+memb->chan->name); if (notice) - channel->WriteRemoteNotice(user->nick + " joined on official network business."); + memb->chan->WriteRemoteNotice(user->nick + " joined on official network business."); } else { - channel = ServerInstance->Channels.Find(parameters[0]); + Channel* channel = ServerInstance->Channels.Find(parameters[0]); if (!channel) return CmdResult::FAILURE; diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index 100cf7186..def956b41 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -87,8 +87,8 @@ public: LocalUser* localuser = IS_LOCAL(dest); if (localuser) { - chan = Channel::JoinUser(localuser, channel, true); - if (chan) + Membership* memb = Channel::JoinUser(localuser, channel, true); + if (memb) { ServerInstance->SNO.WriteGlobalSno('a', user->nick+" used SAJOIN to make "+dest->nick+" join "+channel); return CmdResult::SUCCESS; -- cgit v1.3.1-10-gc9f91