Commit Graph

8 Commits

Author SHA1 Message Date
Uli Schlachter
e029dded0d Fix CIRCNetwork::ExpandString()
It pretty much always returned an empty string (or rather: whatever was in the
return variable before, which is an empty string in 99% of cases).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-16 12:02:55 +02:00
Kyle Fuller
fa7ec788dd Add CIRCNetwork::ExpandString 2011-09-12 16:31:30 +00:00
Kyle Fuller
6686c0de79 Support having a nickname per network 2011-09-12 15:59:15 +00:00
Uli Schlachter
9e3019db72 Remove MODULECALL macro
Depending on which of its arguments where NULL, that macro called network / user
modules or not. While this is nice in that it avoids crashes, this behavior
actually surprised me and I'd rather have the caller explicitly say what it
wanted to do.

This macro is replaced with explicit calls to {GLOBAL,USER,NETWORKMODULECALL}.

Since there are actually module calls which do provide a CClient*, but may
happen before login (OnUnknownUserRaw() and the 3 CAP hooks), those are changed
to get the client pointer as their first argument. This should make it more
obvious that these module calls are special.

This commit should make it easier to catch bugs like the recent
OnClientDisconnected() with m_pUser == NULL.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-12 17:26:32 +02:00
Kyle Fuller
855e0778ac Destroy the CIRCSock for a network when the CIRCNetwork is destroyed 2011-09-05 20:16:10 +00:00
Kyle Fuller
bf8b1624c9 Unload user and network modules once all the clients are gone and we are disconencted from any IRC servers.
The OnIRCDisconnected module call would cause a segmentation fault
because it would try m_pNetwork->GetModules().GetNetwork(). GetModules()
would return NULL.
2011-08-31 01:22:21 +00:00
Uli Schlachter
9c9e40a3d7 Remove some IMHO dangerous functions
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>
2011-08-29 12:52:21 +02:00
Kyle Fuller
fec1a3fe91 Add CIRCNetwork which now hold each IRC Connection.
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>
2011-08-24 19:07:26 +01:00