summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-01-20 09:52:38 +0000
committerPeter Powell <petpow@saberuk.com>2019-01-20 09:52:38 +0000
commit0a1f9bc59494a532a91bc9c8afcecb31ece656ee (patch)
tree2b011cf6bcf822eb1a8a67f35156da2dd7116fc5 /src
parent0a9c72335a3d3dea286382ad3e7635a05713d7cc (diff)
Call the OnUserInit hook from earlier in UserManager::AddUser.
This fixes messages being lost when sending them to a user who has only just connected to the server.
Diffstat (limited to 'src')
-rw-r--r--src/usermanager.cpp3
-rw-r--r--src/users.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index a70a00085..053a308cb 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -76,6 +76,7 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs
this->clientlist[New->nick] = New;
this->AddClone(New);
this->local_users.push_front(New);
+ FOREACH_MOD(OnUserInit, (New));
if (!SocketEngine::AddFd(eh, FD_WANT_FAST_READ | FD_WANT_EDGE_WRITE))
{
@@ -162,8 +163,6 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs
FOREACH_MOD(OnSetUserIP, (New));
if (New->quitting)
return;
-
- FOREACH_MOD(OnUserInit, (New));
}
void UserManager::QuitUser(User* user, const std::string& quitreason, const std::string* operreason)
diff --git a/src/users.cpp b/src/users.cpp
index a0b9c9d03..eb87824fc 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -804,7 +804,11 @@ void LocalUser::Write(const ClientProtocol::SerializedMessage& text)
void LocalUser::Send(ClientProtocol::Event& protoev)
{
if (!serializer)
+ {
+ ServerInstance->Logs->Log("USERS", LOG_DEBUG, "BUG: LocalUser::Send() called on %s who does not have a serializer!",
+ GetFullRealHost().c_str());
return;
+ }
// In the most common case a static LocalUser field, sendmsglist, is passed to the event to be
// populated. The list is cleared before returning.