#include "inspircd.h"
#include "xline.h"
-already_sent_t LocalUser::already_sent_id = 0;
-
bool User::IsNoticeMaskSet(unsigned char sm)
{
if (!isalpha(sm))
ServerInstance->Logs->Log("USERS", LOG_DEBUG, "New UUID for user: %s", uuid.c_str());
- if (!ServerInstance->Users->uuidlist.insert(std::make_pair(uuid, this)).second)
- throw CoreException("Duplicate UUID "+std::string(uuid)+" in User constructor");
+ // Do not insert FakeUsers into the uuidlist so FindUUID() won't return them which is the desired behavior
+ if (type != USERTYPE_SERVER)
+ {
+ if (!ServerInstance->Users.uuidlist.insert(std::make_pair(uuid, this)).second)
+ throw CoreException("Duplicate UUID in User constructor: " + uuid);
+ }
}
LocalUser::LocalUser(int myfd, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* servaddr)
return this->cached_fullrealhost;
}
-InviteList& LocalUser::GetInviteList()
-{
- RemoveExpiredInvites();
- return invites;
-}
-
-bool LocalUser::RemoveInvite(Channel* chan)
-{
- Invitation* inv = Invitation::Find(chan, this);
- if (inv)
- {
- delete inv;
- return true;
- }
- return false;
-}
-
-void LocalUser::RemoveExpiredInvites()
-{
- Invitation::Find(NULL, this);
-}
-
bool User::HasModePermission(unsigned char, ModeType)
{
return true;
CullResult LocalUser::cull()
{
- ClearInvites();
eh.cull();
return User::cull();
}
{
// Fake users don't quit, they just get culled.
quitting = true;
- // Fake users are not inserted into UserManager::clientlist, they're only in the uuidlist
- // and they are removed from there by the linking mod when the server splits
+ // Fake users are not inserted into UserManager::clientlist or uuidlist, so we don't need to modify those here
return User::cull();
}
if (text.length() > ServerInstance->Config->Limits.MaxLine - 2)
{
// this should happen rarely or never. Crop the string at 512 and try again.
- std::string try_again(0, ServerInstance->Config->Limits.MaxLine - 2);
+ std::string try_again(text, 0, ServerInstance->Config->Limits.MaxLine - 2);
Write(try_again);
return;
}
FOREACH_MOD(OnBuildNeighborList, (this, include_chans, exceptions));
// Get next id, guaranteed to differ from the already_sent field of all users
- const already_sent_t newid = ++LocalUser::already_sent_id;
+ const already_sent_t newid = ServerInstance->Users.NextAlreadySentId();
// Handle exceptions first
for (std::map<User*, bool>::const_iterator i = exceptions.begin(); i != exceptions.end(); ++i)