Default this boolean to true incase there are no networks to loop over. This
will silently drop any network modules for the user, but since there are no
networks anyway it doesn't really matter.
If connecting to a server failed without needing any time for DNS, the connect
timer would busy loop over the networks, because a network re-inserted itself
into the queue and the timer would try the network again.
Fix this by moving the connection queue to a separate instance of std::list when
the timer fires. From then on, we just iterate through that list while networks
which want to try again add themselves to the "real" connection queue instead.
We only have to make sure that any networks that are left in the old connection
queue after the timer is done get prepended to the "real" connection queue.
Signed-off-by: Uli Schlachter <psychon@znc.in>
A CIRCNetwork's destructor removes the network from its associated user's list
of networks. Now that you know this, stare at the diff until you figure out the
problem. Yeah, "ouch".
Signed-off-by: Uli Schlachter <psychon@znc.in>
If user is connected without network, try "default" network first, if it
exists. If not, try "user" network. If it doesn't exist too, just use
the first one.
Also configs converted from old configs have "default" network instead
of "user" one.
Previously, a certificate generated with --makepem expired after a year which is
weird and pointless (come on, it's self-signed!).
Signed-off-by: Uli Schlachter <psychon@znc.in>
The reason for this is so that any messages sent in *status by attaching
a new network will show up after the switched message.
<*status> Switched to efnet
<*status> You are currently disconnected from IRC. Use 'connect' to reconnect.
This fixes#96. When the last user in a partyline channel is deleted, the
channel is deleted, too. This invalidates the iterator used in OnDeleteUser().
This fix is to increase the iterator before the channel can be deleted.
After the above fix, znc still crashed due to another broken use of iterators.
When a network is deleted, it takes all its clients with it (why aren't they
just moved into the "no network"-state?"). However, deleting a CClient removes
it from the network's list of clients via CClient::Disconnect(). This resulted
in another invalid use of iterators.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Drop support for c-ares. Though Csocket still supports it, ZNC's
configure script doesn't enable it anymore.
This should fix big brokenness of c-ares library, which tried to
connect via IPv6 even when IPv6 is disabled on the system.
Also should fix github issue #37
Since this creates a new user, and then clones it. It would clear all
the networks. To fix this, I have made an option bCloneNetworks to
CUser::Clone. This replaces the bCloneChans because this is unnessecery
now.
Fixes#88
This commit does the following:
- Do not segfault on rehash
- Delete CIRCNetwork's when they are removed from config
- Update to the configs nick/altnick/realname/ident
We need a good way to speak to users, not just sending some clients some
stuff...
Thanks to Cronus` for reporting this, as notify_connect failed for him
when using broken broadcast.
Buflines need to know which part of text to wrap with the timestamp. The
second parameter to `AddLine` (and shorthands) is that text, which after
wrapping is added as the `text` parameter to `NamedFormat`.
Timestamps are formatted at the moment buffers are flushed to the
client. The client parameter to `GetLine` provides access to the User
and the new server-time capability.
This is in preparation of adding more attributes to a CBufLine. Going
forward, at least savebuf will need access to all of these to properly
serialize buffers.
Basically, instead of relying on `GetLine()` to return `false`, the
caller is now expected to check bounds himself using `Size()`.
If a client sends STARTTLS to the IRC server, once the IRC server responds
with a 670 then it will expect all future communications to happen over
TLS.