Commit Graph

54 Commits

Author SHA1 Message Date
Stéphan Kochen
c36480c8a1 Store and format time in CBufLine.
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.
2011-10-27 18:25:25 +02:00
Stéphan Kochen
c3d677a4d8 Slight refactor of CBuffer & CBufLine.
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()`.
2011-10-27 18:25:25 +02:00
Stéphan Kochen
948ae2510c Rewrite Buffer to store a format string.
Will use this to allow more parameters to be inserted at the time the
buffers are flushed to the client.
2011-10-27 18:25:24 +02:00
Alexey Sokolov
e354c24ac1 Move ZNC headers into own directory.
Yes, this breaks backwards compatibility, so what?
It's already broken with network stuff anyway.
2011-09-23 03:31:58 +07:00
Kyle Fuller
fa7ec788dd Add CIRCNetwork::ExpandString 2011-09-12 16:31:30 +00:00
Kyle Fuller
0b1627c529 Make all the modules support networks 2011-08-24 19:07:32 +01:00
Alexey Sokolov
d683aea48d Merge branch 'modinfo' 2011-06-11 18:32:09 +07:00
Alexey Sokolov
262216731b Add link to wiki page from any nonextra module. 2011-06-11 18:09:56 +07:00
Un1matr1x
708366d9ae remove some more of the evil trailing white spaces & tabs 2011-06-09 21:29:13 +02:00
Kyle Fuller
d735e9d881 Remove some pointless if statements 2011-03-27 23:35:41 +01:00
Uli Schlachter
8419964165 watch: Use empty() instead of !size()
Yay for useless micro-optimizations. ;-)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-22 23:38:10 +01:00
psychon
b9b0fd4c87 Oh, shiny... NOT
(Yes, it's that time of the year again)

Signed-off-by: Uli Schlachter <psychon@znc.in>

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2260 726aef4b-f618-498e-8847-2d620e286838
2011-01-14 17:03:24 +00:00
darthgandalf
a0c0b73590 Add new parameter to OnPart module hook: part message.
Sorry for API change :)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2215 726aef4b-f618-498e-8847-2d620e286838
2010-12-30 11:28:41 +00:00
psychon
99f1efc843 Some more fun with tabs
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1966 726aef4b-f618-498e-8847-2d620e286838
2010-05-02 08:36:57 +00:00
psychon
5d9a22f6cc Use CString::Split() in more places
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1808 726aef4b-f618-498e-8847-2d620e286838
2010-03-07 11:08:26 +00:00
psychon
115b170890 Another patch by DarthGandalf, thanks
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1777 726aef4b-f618-498e-8847-2d620e286838
2010-02-19 17:06:42 +00:00
silverleo
07d7477dec It's 2010, where's my hoverboard?
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1693 726aef4b-f618-498e-8847-2d620e286838
2010-01-06 09:37:05 +00:00
silverleo
f52f4b2746 watch: Removed a bit too much in r1413.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1414 726aef4b-f618-498e-8847-2d620e286838
2009-03-07 11:24:34 +00:00
silverleo
036a140290 watch: Save the module settings as soon as they are changed.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1413 726aef4b-f618-498e-8847-2d620e286838
2009-03-07 11:16:28 +00:00
silverleo
d7aa797a49 Make watch module use ExpandString in pattern matching and split some long lines in the code.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1402 726aef4b-f618-498e-8847-2d620e286838
2009-02-27 16:11:53 +00:00
psychon
55fcaa9489 Watch: Add timestamps to the cached messages
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1333 726aef4b-f618-498e-8847-2d620e286838
2009-01-16 11:36:27 +00:00
psychon
607a7f1c16 Get rid of most strtoul() and atoi() calls and use CString's features instead
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1320 726aef4b-f618-498e-8847-2d620e286838
2009-01-04 10:48:02 +00:00
psychon
08ad0291ea Happy New Year 2009 everyone!
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1317 726aef4b-f618-498e-8847-2d620e286838
2009-01-01 12:22:21 +00:00
psychon
b7f38c4d4a Remove some code duplications and move functions into classes
This removes ReadFile(), WriteFile(), ReadLine(), Lower() and Upper() from
Utils.h and adds CFile::ReadFile().

The biggest part of this patch fixes modules to use CFile and CString instead
of these global functions.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1311 726aef4b-f618-498e-8847-2d620e286838
2008-12-30 13:05:04 +00:00
psychon
1312e6512b Make watch save its settings and add CModule::ClearNV()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1304 726aef4b-f618-498e-8847-2d620e286838
2008-12-26 15:12:25 +00:00
psychon
db21f88584 Rename OnUserAttached and OnUserDetached and add OnClientConnect
OnUserAttached is renamed to OnClientLogin and
OnUserDetached to OnClientDisconnect.
This adds some new function with different arguments for the old names to cause
warnings from -Woverloaded-virtual while compiling.

This patch also adds OnClientConnect() which is called when the low-level
raw connection is established. (No SSL-handshake was done at this point yet!)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1266 726aef4b-f618-498e-8847-2d620e286838
2008-10-29 17:26:30 +00:00
kroimon
5237a24747 Use CString::Equals() everywhere.
* (CString::CaseCmp() == 0) became CString::Equals()
* (CString::CaseCmp() != 0) became !CString::Equals()
* replaced some occurrences of strn?casecmp

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1234 726aef4b-f618-498e-8847-2d620e286838
2008-09-30 15:15:59 +00:00
psychon
02beef2e07 Use znc.in instead of znc.com
No cookie for that domain catcher at znc.com!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1181 726aef4b-f618-498e-8847-2d620e286838
2008-08-30 09:00:21 +00:00
psychon
adcca250e1 Use the new CModule::PutModule(const CTable&) in various modules
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1169 726aef4b-f618-498e-8847-2d620e286838
2008-08-24 12:51:04 +00:00
psychon
3775748270 watch: Remove the raw /watch command
There is actually a 'real' /watch command which was blocked by this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1035 726aef4b-f618-498e-8847-2d620e286838
2008-04-30 14:09:15 +00:00
psychon
f74ab87e19 And fix a shitload of trailing whitespaces and space / tab mixups in ZNC
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@959 726aef4b-f618-498e-8847-2d620e286838
2008-02-16 12:52:11 +00:00
psychon
e72c445694 Clean up includes
All the headers are now self-contained (g++ Header.h -o /dev/null).

Some system headers where moved to the .cpp they are actually needed in,
some of our own headers are includes less. (Especially MD5.h)

Headers are sorted alphabetically while in e.g. FileUtils.cpp FileUtils.h
is the first file included.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@915 726aef4b-f618-498e-8847-2d620e286838
2008-01-07 21:31:16 +00:00
psychon
eeec633e30 Update copyright header for 2008
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@910 726aef4b-f618-498e-8847-2d620e286838
2008-01-07 21:13:07 +00:00
psychon
b490b12058 Fix some gcc 4.3 warnings
These are mostly string casts, handling function's return value and some
weird warning about missing spaces on empty while loops.

These were reported by and fixed with Marcus Rueckert <darix@opensu.se>.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@904 726aef4b-f618-498e-8847-2d620e286838
2007-12-20 18:31:48 +00:00
psychon
a09a7e79f6 Switch to the copyright headers the GPLv2 wants us to have
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@843 726aef4b-f618-498e-8847-2d620e286838
2007-09-21 18:55:33 +00:00
psychon
a3b405bd07 sync from my branch rev 983 and 993:
- module api change, if module fails to load it can give back an useful error message
- give a message when client doesnt supply a password when connecting
- some minor cleanup


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@803 726aef4b-f618-498e-8847-2d620e286838
2007-05-16 22:42:00 +00:00
prozacx
e06ca0d672 Added contact info
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@753 726aef4b-f618-498e-8847-2d620e286838
2006-09-13 07:48:28 +00:00
prozacx
a9e60b43c5 Migrated away from CString::ToString() in favor of explicit constructors
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@669 726aef4b-f618-498e-8847-2d620e286838
2006-02-25 09:43:35 +00:00
prozacx
6d27d1c021 Removed const from args in a bunch of hooks
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@538 726aef4b-f618-498e-8847-2d620e286838
2005-09-26 23:09:05 +00:00
prozacx
49d71a9b55 Removed const from CNick in priv/chan hooks
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@537 726aef4b-f618-498e-8847-2d620e286838
2005-09-26 08:23:30 +00:00
prozacx
c52542e469 Moved GetDescription() into second argument of MODULEDEFS()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@366 726aef4b-f618-498e-8847-2d620e286838
2005-05-26 20:42:13 +00:00
prozacx
1437f279b5 Changed CChan reference to non-const in all hooks
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@330 726aef4b-f618-498e-8847-2d620e286838
2005-05-17 17:18:35 +00:00
prozacx
44d38ec4c9 Changed return value from bool to EModRet on most hooks
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@306 726aef4b-f618-498e-8847-2d620e286838
2005-05-15 08:27:27 +00:00
prozacx
0823b27f37 Moved CUtils::wildcmp() into CString class
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@251 726aef4b-f618-498e-8847-2d620e286838
2005-05-08 07:51:46 +00:00
prozacx
fd231e6b3a Moved CUtils::ToString() into CString class
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@249 726aef4b-f618-498e-8847-2d620e286838
2005-05-08 06:42:02 +00:00
prozacx
24950d24e4 Moved CUtils::Token() into CString class
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@244 726aef4b-f618-498e-8847-2d620e286838
2005-05-07 09:18:56 +00:00
prozacx
beb5b49b3f Changed all references to std::string over to CString
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@240 726aef4b-f618-498e-8847-2d620e286838
2005-05-05 18:11:04 +00:00
prozacx
9b3ac7cb94 Changed vChans to a reference in OnNick and OnQuit (oops)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@165 726aef4b-f618-498e-8847-2d620e286838
2005-04-23 08:10:34 +00:00
prozacx
c88b835837 Changed OnNick() and OnQuit() to take a vector<CChan*> of common channels
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@164 726aef4b-f618-498e-8847-2d620e286838
2005-04-23 07:24:58 +00:00
prozacx
45a8aca016 Changed WATCH command to ADD
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@42 726aef4b-f618-498e-8847-2d620e286838
2005-03-10 06:50:20 +00:00