X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_ircv3_invitenotify.cpp;h=4908fcdaf674a5c9c198a71fb9ea073cf59efb5b;hb=219f8e62623ff0c3002be764c1dbf7201d0293db;hp=3783ff33c48149e8494c984e1fabee9052dfc79c;hpb=d23c030c9a8fd58807438245a004e4aa5b7288ba;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_ircv3_invitenotify.cpp b/src/modules/m_ircv3_invitenotify.cpp index 3783ff33c..4908fcdaf 100644 --- a/src/modules/m_ircv3_invitenotify.cpp +++ b/src/modules/m_ircv3_invitenotify.cpp @@ -1,7 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2015 Attila Molnar + * Copyright (C) 2018 Sadie Powell + * Copyright (C) 2015, 2018 Attila Molnar * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -32,8 +33,8 @@ class ModuleIRCv3InviteNotify : public Module void OnUserInvite(User* source, User* dest, Channel* chan, time_t expiry, unsigned int notifyrank, CUList& notifyexcepts) CXX11_OVERRIDE { - std::string msg = "INVITE "; - msg.append(dest->nick).append(1, ' ').append(chan->name); + ClientProtocol::Messages::Invite invitemsg(source, dest, chan); + ClientProtocol::Event inviteevent(ServerInstance->GetRFCEvents().invite, invitemsg); const Channel::MemberMap& users = chan->GetUsers(); for (Channel::MemberMap::const_iterator i = users.begin(); i != users.end(); ++i) { @@ -47,8 +48,10 @@ class ModuleIRCv3InviteNotify : public Module if (memb->getRank() < notifyrank) continue; + // Caps are only set on local users + LocalUser* const localuser = static_cast(user); // Send and add the user to the exceptions so they won't get the NOTICE invite announcement message - user->WriteFrom(source, msg); + localuser->Send(inviteevent); notifyexcepts.insert(user); } } @@ -61,7 +64,7 @@ class ModuleIRCv3InviteNotify : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Provides the invite-notify IRCv3.2 extension", VF_VENDOR); + return Version("Provides the IRCv3 invite-notify client capability.", VF_VENDOR); } };