/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2015 Attila Molnar <attilamolnar@hush.com>
+ * Copyright (C) 2018 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2015, 2018 Attila Molnar <attilamolnar@hush.com>
*
* 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
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)
{
if (memb->getRank() < notifyrank)
continue;
+ // Caps are only set on local users
+ LocalUser* const localuser = static_cast<LocalUser*>(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);
}
}
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);
}
};