Instead of giving a useful result, they returned their result by sometimes
omitting the first character of the option name. Whoops.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This will only ever be set to -DHAVE_CONFIG_H. However, we shouldn't give this
flag to other people's code (e.g. through znc-config). Since we don't need it,
it's best to just drop it completely.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The OnIRCDisconnected module call would cause a segmentation fault
because it would try m_pNetwork->GetModules().GetNetwork(). GetModules()
would return NULL.
First, we set m_sUser to the argument of USER. Later, when the PASS came in, the
username which was specified here (user/network:pass) was ignored, because
m_sUser was already set ("if (m_sUser.empty() &&" in ParseAuthLine).
The fix is to ignore if m_sUser was already set when parsing "PASS". Since this
means that the handling of PASS and USER becomes even more different, this
commit removes CClient::ParseAuthLine() again.
(The check for m_sUser.empty() can't just be dropped, because if USER comes in
after PASS, we should use the user name from PASS and ignore the USER one)
Signed-off-by: Uli Schlachter <psychon@znc.in>
Instead, these functions are now inlined into their only caller. This should
make the user and network destruction a little saner. At least I hope so...
Signed-off-by: Uli Schlachter <psychon@znc.in>
For every available module call implementation, we got this:
Modules.cpp: In member function ‘bool CModules::OnGetAvailableMods(std::__debug::set<CModInfo>&, CModInfo::EModuleType)’:
Modules.cpp:149:72: error: ‘pNetwork’ may be used uninitialized in this function [-Werror=uninitialized]
Modules.cpp:808:260: note: ‘pNetwork’ was declared here
Modules.cpp:148:54: error: ‘pOldUser’ may be used uninitialized in this function [-Werror=uninitialized]
Modules.cpp:808:168: note: ‘pOldUser’ was declared here
I guess GCC saw that m_pNetwork and m_pUser could be changed by the module call
to a non-NULL value which means we would really use an uninitialized value...
Signed-off-by: Uli Schlachter <psychon@znc.in>
This allows a user to have multiple networks.
A user can login as a network by supplying PASS [user[/network]:]pass or
USER user[/network] on connect. A user can also switch between networks
by using /msg *status JumpNetwork <network>