Fix oper quit messages (needed to be set to regular quit if empty) - same fix may apply to 1.2..?

git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@8910 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
w00t 2008-02-12 10:42:25 +00:00
parent d7db8eb9a8
commit c32d8a38b0

View File

@ -33,7 +33,11 @@ void CullList::AddItem(userrec* user, const char* reason, const char* o_reason)
user->quitting = true; user->quitting = true;
user->quitmsg = reason; user->quitmsg = reason;
user->operquitmsg = o_reason;
if (!*o_reason)
user->operquitmsg = reason;
else
user->operquitmsg = o_reason;
list.push_back(user); list.push_back(user);
} }
@ -54,9 +58,8 @@ int CullList::Apply()
userrec *a = (*li); userrec *a = (*li);
user_hash::iterator iter = ServerInstance->clientlist->find(a->nick); user_hash::iterator iter = ServerInstance->clientlist->find(a->nick);
const char* preset_reason = a->operquitmsg.c_str();
std::string reason = a->quitmsg; std::string reason = a->quitmsg;
std::string oper_reason = *preset_reason ? preset_reason : a->operquitmsg; std::string oper_reason = a->operquitmsg;
if (reason.length() > MAXQUIT - 1) if (reason.length() > MAXQUIT - 1)
reason.resize(MAXQUIT - 1); reason.resize(MAXQUIT - 1);