Commit Graph

161 Commits

Author SHA1 Message Date
J-P Nurmi
65f739980d CString::Starts/EndsWith(): allow specifying case sensitivity 2014-09-29 16:41:07 +02:00
J-P Nurmi
e86f43d841 Introduce CaseSensitivity enum class
The enum is a bit more verbose, but leads to more readable code:

str.Equals("foo", true)
// vs.
str.Equals("foo", CString::CaseSensitive)

Deprecate the old Equals() and leave out the length parameter
from the new version => use StartsWith() or StrCmp() instead.
2014-09-29 16:30:45 +02:00
Alexey Sokolov
227f2cfb29 Merge pull request #678 from NuclearW/batch-playback
Add ircv3.2 batch and batch channel and query buffer playback.
2014-09-28 21:37:38 +01:00
NuclearW
73b6936d6d Add ircv3.2 batch and batch channel and query buffer playback. 2014-09-28 14:57:06 -04:00
NuclearW
be27831bf1 Correct documentation for OnUnknownUserRaw 2014-09-28 00:44:30 -04:00
J-P Nurmi
fb99593f75 Allow network specific quit messages (resolves #273) 2014-09-13 23:40:22 +02:00
J-P Nurmi
c73c75181e Update Csocket to 88c633a
The unused m_bBLOCK variable has been cleaned up,
no longer causing a compile time warning.
2014-09-08 22:23:00 +02:00
Alexey Sokolov
8ec2a0940c Merge pull request #629 from jpnurmi/help
Revise *status and *controlpanel help output
2014-09-07 16:24:49 +01:00
J-P Nurmi
2e42f3103c Fix #624: Can´t rename network via webinterface 2014-09-06 23:15:50 +02:00
J-P Nurmi
aec99ea213 Revise *status help output
Make it possible to output help for given command(s) and align
casing & arguments in general help & command specific usage output.
2014-09-06 21:14:35 +02:00
J-P Nurmi
7387f00408 Get rid of the module questions during --makeconf
The following modules are enabled by default:
- global: webadmin
- user: controlpanel, chansaver
- network: simple_away

This reduces a lot makeconf noise and fixes #541.
2014-08-17 15:37:50 +02:00
Alexey Sokolov
f464066088 Merge pull request #616 from psychon/module-jobs2
Add support for CJob cancellation and necessary module support
2014-08-11 21:09:57 +01:00
Uli Schlachter
308df21511 Modules: Add a module version of CJob
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-06 15:32:41 +02:00
Uli Schlachter
1d67e87d90 CThreadPool: Add cancellation support
This adds CThreadPool::cancelJob() and cancelJobs() which can cancel a set of
jobs synchronously. These functions only return when the job was successfully
cancelled.

It tries to cancel the jobs as quickly as possible, skipping any callbacks on
CJob that were not yet called. A job that is already running can use
CJob::wasCancelled() to check if it should quit.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-06 15:15:57 +02:00
Uli Schlachter
6118ad5345 Threads.h: Add some doxygen comments
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-06 14:50:59 +02:00
Uli Schlachter
d128b41844 Threads: Add some undefined constructors etc
This is needed to "get rid" of the C++ default implementation. Yes, I know that
this can be done way nicer with C++11...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-06 14:50:58 +02:00
J-P Nurmi
14a534c953 Full-fledged query buffers
Store query buffers per query the same way it's done for channels.

This allows clients to implement persistent query buffers. Queries
remain open across clients and sessions until a client explicitly
sends a command to clear a (closed) query buffer.

A new config option AutoClearQueryBuffer that default to false
ensures behavioral backwards compatibility, and another config
MaxQueries protects from OOM eg. due to PM attacks.
2014-08-04 10:04:21 +02:00
Uli Schlachter
680935723f Fix typo in last commit
Thanks to drbean for reporting this in FreeNode/#znc.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-07-14 15:56:03 +02:00
Uli Schlachter
ba11b8eecf Less magic numbers for timeout settings
Currently the connection timeout handling of znc uses three magic numbers, each
of which is at least repeated in two unrelated places. This commits defines the
numbers in CIRCNetwork and makes the other places just use this number.

This also renames PING_TIMEOUT to PING_FREQUENCY because I feel that describes
this constant better.

I am not really happy about the name NO_TRAFFIC_TIMEOUT that is used for the
real timeout, but I couldn't think of a better name. PING_TIMEOUT isn't good
because that sounds like the time between sending a PING and the resulting
timeout.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-07-14 15:33:36 +02:00
Alexander Færøy
2521d64a1c Add PING_TIMEOUT constant to CIRCNetwork 2014-06-18 21:04:20 +02:00
Alexander Færøy
299f3aa637 Split CUserTimer into CIRCNetworkPingTimer and CIRCNetworkJoinTimer
This patch splits CUserTimer into two other timers:

CIRCNetworkPingTimer: This timer sends PING messages to connected
client's and IRC servers.

CIRCNetworkJoinTimer: This timer enforces the MaxJoin setting by only
allowing a specified amount of channels to join at the same time.

JoinChans() is modified to reset the ping timer once we hit the MaxJoin.
This allows us to call it from any function without breaking the timing
logic.
2014-06-18 21:04:20 +02:00
Alexey Sokolov
93d2eec4db Update Csocket to ef6bcb9d5c1aecd778c5a57604eabdcb5e1ee06e 2014-06-17 23:22:16 +01:00
Alexey Sokolov
a3f4f1ebd9 Merge commit 'refs/pull/557/head' of github.com:znc/znc 2014-06-01 21:06:25 +01:00
Vasily Fomin
4338ae5cc5 Show empty checkbox if module can be loaded by the topic column.
Fix const correctnes of the CModInfo::SupportsType method.
2014-06-01 21:37:39 +02:00
Alexander Færøy
db0e0995e2 Add OnJoining module hook.
This patch adds an OnJoining module hook that allows a module to allow
or disallow joining any given channel.
2014-05-29 23:10:30 +02:00
Kyle Fuller
ed7119b5bc Update to latest version of Csocket
Fixes #536
2014-04-24 19:28:37 +01:00
Kyle Fuller
5e90bc380b [Csocket] Support and default to TLSv1.2
Updates to 21ac28cc29e9256a21a9aa217e29638360c266d0 of Csocket
2014-04-20 23:35:29 +01:00
Alexey Sokolov
370659895b Increase the version number to 1.5 2014-04-14 22:48:50 +01:00
Alexey Sokolov
9cf61ac6d4 Argh, fuck it. Rename fixed (pointer) versions of OnMode to OnMode2 2014-04-12 08:51:04 +01:00
J-P Nurmi
2b0c47aa8e Add CChan::SendBuffer(client, buffer) overload
This allows interested parties eg. modules to to send a partial
buffer playback without reinventing the wheel.
2014-03-04 08:27:10 +01:00
J-P Nurmi
76bfa99dd0 Add module hooks for raw client and server messages 2014-03-04 00:24:15 +01:00
Alexey Sokolov
77652768c6 Merge pull request #493 from jpnurmi/server-time
Promote server-time formatting to Utils
2014-03-03 22:44:49 +00:00
Alexey Sokolov
7d2f74acf4 Merge pull request #500 from jpnurmi/find-chans
Add CIRCNetwork::FindChans()
2014-03-03 22:38:41 +00:00
J-P Nurmi
ed25ca21e6 Add CIRCNetwork::FindChans() 2014-03-02 23:24:34 +01:00
J-P Nurmi
5f8f747704 Add CUtils::Get/SetMessageTags() 2014-03-02 23:18:39 +01:00
J-P Nurmi
bbd84a06bf Promote server-time formatting to Utils 2014-03-02 02:01:40 +01:00
Alexey Sokolov
618d9c58a4 Fix chansaver's channel keys by adding other OnMode() hooks 2014-02-27 00:49:45 +00:00
Alexey Sokolov
1c8e9b9355 Merge pull request #485 from uu1101/uriprefix
Allow serving the web interface under a subpath
Fix #480
Fix #138
2014-02-17 00:44:37 +00:00
uu1101
88c85b0396 Add URIPrefix listener option 2014-02-16 12:45:09 +01:00
uu1101
d3ddb9b69d The Listener of a RealListener is never NULL 2014-02-15 14:57:33 +01:00
uu1101
7a9ce630ef Add CString::StartsWith and CString::EndsWith 2014-02-15 12:41:54 +01:00
Alexey Sokolov
b7592008af Merge pull request #484 from KiNgMaR/singleton
Allow more control over CZNC singleton
2014-02-08 18:03:06 +00:00
Ingmar Runge
4c505946ac Patch ZNC core for more control over singleton... 2014-02-08 01:25:28 +01:00
Ingmar Runge
13040d9c72 Fix AddServerThrottle. 2014-02-06 23:36:01 +01:00
Ingmar Runge
b3021f913e squash some compiler warnings 2014-02-06 17:52:42 +01:00
Alexey Sokolov
dbdfa1e612 Merge pull request #466 from dgw/fix-shell-timeout
Remove accidental timeout in shell module
2014-01-27 14:18:04 -08:00
Alexey Sokolov
c0a5ecb40b Add support for character encodings
Previous commit added support of it to Csocket.
When encoding is specified, core will convert incoming messages to UTF-8,
and outgoing messages from UTF-8.
When no encoding is specified, it will do nothing to bytes, like before.
This is to be changed somewhere in future, to have UTF-8 on wire by
default too.
When encoding's name starts with *, incoming messages will be treated as
UTF-8, if it is already correct UTF-8. Otherwise, it's converted.

Fix #151
Fix #366
2014-01-25 13:50:07 +00:00
Alexey Sokolov
6012cdee77 Update Csocket to e818c7b0d31b0ed71c74f9d0035b58efd73f3988
This adds support for character encodings, and decreases CPU usage in
some cases
2014-01-25 13:50:07 +00:00
dgw
38fc398c2a Remove accidental timeout in shell module 2014-01-21 00:26:01 +04:00
Wuggingston Wugsalot
adafe9d197 Added CString::Join and CString::Convert
CString::Join works like python's string join, except that it takes 2
iterators (or pointers) instead of a whole collection
CString::Convert casts a string to another type using an intermediary
stringstream.
2014-01-18 21:37:59 +00:00