Commit Graph

91 Commits

Author SHA1 Message Date
psychon 9933ba9c3e Use CString::TrimRight() to make this code more readable
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1321 726aef4b-f618-498e-8847-2d620e286838
2009-01-05 11:45:12 +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
silverleo 3538290068 Show client IP in debug when username is not available.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1315 726aef4b-f618-498e-8847-2d620e286838
2008-12-31 13:49:29 +00:00
silverleo d84b9c6e9e Add OnUnknownUserRaw() global module call.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1314 726aef4b-f618-498e-8847-2d620e286838
2008-12-31 12:22:38 +00:00
silverleo 110485eaaf Changed ping timers and timeout settings to use more reasonable values. Also changed timeout type for irc and client sockets.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1297 726aef4b-f618-498e-8847-2d620e286838
2008-12-21 09:03:04 +00:00
psychon d97ef37d27 Bugfix: Only reply to a client's MODE request if we actually know the answer
(Plus some indent fixup)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1290 726aef4b-f618-498e-8847-2d620e286838
2008-12-13 17:01:55 +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 18ce52e32d Limit the maximal read buffer space that is used for every socket
CSocket caches the data read from a socket and then looks for lines in there.
If there is no line end, this buffer can grow quite large. This patch now
closes sockets if they get a huge read buffer.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1233 726aef4b-f618-498e-8847-2d620e286838
2008-09-30 14:43:51 +00:00
kroimon 051e1f81d8 Enhanced the /znc command to optionally accept commands.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1228 726aef4b-f618-498e-8847-2d620e286838
2008-09-29 13:33:15 +00:00
kroimon b757a318f1 Introduced CString::TrimPrefix() and CString::CaseCmp() for parsing targets.
Dropped all occurences of strncasecmp() and
simplified the detection of messages targeting modules.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1226 726aef4b-f618-498e-8847-2d620e286838
2008-09-28 19:30:20 +00:00
psychon fd92e65b70 Add CClient::PutStatus(const CTable&) and use it everywhere
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1222 726aef4b-f618-498e-8847-2d620e286838
2008-09-28 12:05:49 +00:00
kroimon d6c34d2441 Fixed the CALLMOD macro in Client.cpp
Simple copy&paste error

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1221 726aef4b-f618-498e-8847-2d620e286838
2008-09-28 11:53:30 +00:00
kroimon cc00aa23c2 Removed thousands of redundant checks for m_pUser in CClient::ReadLine().
We already checked for it on line 144 which should be enough.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1220 726aef4b-f618-498e-8847-2d620e286838
2008-09-28 01:03:06 +00:00
kroimon 3b8134c3b0 Another whitespace/tab mixup fix.
Hopefully the last one...
Again, no functional changes in this commit.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1219 726aef4b-f618-498e-8847-2d620e286838
2008-09-27 14:42:34 +00:00
kroimon f1e6a41d83 Ignore messages to ourself when being disconnected from IRC.
This suppresses "Your message to [yournick] got lost,..." messages when lagbars try to send notices to their own nick but ZNC is disconnected from IRC.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1211 726aef4b-f618-498e-8847-2d620e286838
2008-09-20 16:00:26 +00:00
psychon 0316c6a1df Add OnUserTopicRequest() for topic requests
OnUserTopic() used to try to handle this, but it really failed to...


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1185 726aef4b-f618-498e-8847-2d620e286838
2008-09-02 12:39:18 +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 d4cd78a43b Instead of (ab)using a CClient for listening, use an own class this job
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1178 726aef4b-f618-498e-8847-2d620e286838
2008-08-29 18:51:08 +00:00
psychon ecabbd2bcd Fix some of the direct module calls in Client.cpp
OnModCTCP(), OnModCommand() and OnModNotice() are now called through a
preprocessor macro that does all the magic. This fixes a couple of bugs:
- the m_pUser member of global modules for OnModNotice() was wrong
- OnModCTCP() wasn't called for global modules
- Finally handle 'throw UNLOAD' for all of this three module calls


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1162 726aef4b-f618-498e-8847-2d620e286838
2008-08-22 12:48:56 +00:00
psychon 03e34ac6e6 Remove KeepNick
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1151 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 11:34:11 +00:00
psychon 3ec3f07523 Move CClient's UserCommand() and HelpUser() into a new file ClientCommand.cpp
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1150 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 10:38:24 +00:00
psychon 13dd3996d5 Remove some unused arguments and unimplemented functions
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1146 726aef4b-f618-498e-8847-2d620e286838
2008-07-24 10:14:41 +00:00
psychon 48d53876d6 Even more weird and broken clients sending even more and broken stuff
PART :#channel... Why do IRCds even parse this correctly? :(
Oh and yeah, it's eggdrop.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1145 726aef4b-f618-498e-8847-2d620e286838
2008-07-23 15:05:35 +00:00
psychon cd8318370a Some weird clients might send a nickmask prefix, handle this correctly
*cough* eggdrop is evil *cough*

Thanks to dare for debugging this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1144 726aef4b-f618-498e-8847-2d620e286838
2008-07-23 13:36:04 +00:00
psychon 10210e4619 Don't throw any exceptions in CModules::LoadModule() on version mismatch
This also removes all the code catching those exceptions. There was nothing
which justified these exceptions and removing them doesn't hurt.

ByeBye CException::EX_BadModVersion


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1137 726aef4b-f618-498e-8847-2d620e286838
2008-07-17 12:01:44 +00:00
psychon 3c1e610cf5 Make CClient::GetNickMask() always return a valid nickmask
The recent removal of CUser::m_bIRCConnected lead to a bug here which is now
fixed.
In addition to this, this function now also works properly for users without
a vhost.

Oh and in User.cpp: Make sure CUser::GetIRCServer() returns an empty string
when we are no longer connected to an IRCd.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1134 726aef4b-f618-498e-8847-2d620e286838
2008-07-14 10:44:37 +00:00
psychon 31feec2c9f Use CZNC::Auth() to authenticate IRC clients
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1115 726aef4b-f618-498e-8847-2d620e286838
2008-07-07 18:35:41 +00:00
psychon 5e0c652b9a Add the remote ip to the info CAuthBase got
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1112 726aef4b-f618-498e-8847-2d620e286838
2008-07-07 18:24:38 +00:00
psychon 9e6d05a0bd Remove some unneeded includes from DCCBounce.h
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1106 726aef4b-f618-498e-8847-2d620e286838
2008-06-27 09:27:34 +00:00
psychon bcf59c56ea Add and use CZNC::GetUptime() for getting the current uptime in human readable
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1098 726aef4b-f618-498e-8847-2d620e286838
2008-06-19 08:39:10 +00:00
psychon 78f8cce2c6 Add 'Uptime' command to *znc
ToDo: Use some readable format for displaying the uptime. Seconds just
don't make it.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1095 726aef4b-f618-498e-8847-2d620e286838
2008-06-17 07:52:56 +00:00
psychon 0a7b69080a Remove an unneeded call to CString::Token()
Thanks to x-x for this patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1092 726aef4b-f618-498e-8847-2d620e286838
2008-06-11 10:06:17 +00:00
psychon 442ef47c56 Add OnUserTopic module call
Patch by SilverLeo


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1086 726aef4b-f618-498e-8847-2d620e286838
2008-06-06 14:27:57 +00:00
psychon e1bf2d21ca Disconnect unauthed connections after a timeout of 60 secs
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1067 726aef4b-f618-498e-8847-2d620e286838
2008-05-24 17:09:25 +00:00
psychon 1e64901f0e Don't disconnect unauthed clients which use something else than PASS, USER or NICK
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1066 726aef4b-f618-498e-8847-2d620e286838
2008-05-24 17:08:23 +00:00
psychon b294891993 Don't allow users with 'DenyLoadMod' set to use 'ListAvailableModules'
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1063 726aef4b-f618-498e-8847-2d620e286838
2008-05-24 17:00:10 +00:00
psychon ff7a6c231a Remove some unneedef #ifdef's
MODULECALL doesn't need to be wrapped in #ifdef _MODULES, since main.h
already does this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1049 726aef4b-f618-498e-8847-2d620e286838
2008-05-10 15:09:46 +00:00
psychon 01bc68b1cb Move ChangeDir() and MakeDir() from CUtils to CDir
Those function were not modified. Only change is the name.

Those *Dir() functions really made no sense in CUtils when there is FileUtils
stuff. They really fit much better into here. I'll bet they'll make new friends
fast. I mean, why shouldn't they?
Uhm... sorry ;)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1044 726aef4b-f618-498e-8847-2d620e286838
2008-05-08 16:58:32 +00:00
psychon 6857394d71 Remove CString::ToKBytes()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1039 726aef4b-f618-498e-8847-2d620e286838
2008-05-05 21:39:09 +00:00
psychon 4ada00f542 Format traffic stats to not show bytes, but stuff like KiB and MiB etc
This adds CString::ToByteStr() for such jobs!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1038 726aef4b-f618-498e-8847-2d620e286838
2008-05-05 21:33:34 +00:00
psychon c4f1eb3da3 Print a warning if a msg / notice gets lost because we are not connected to IRC
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1032 726aef4b-f618-498e-8847-2d620e286838
2008-04-25 16:30:11 +00:00
psychon c64d7bc108 Force a space between if, for, while and (
This was done via:
   sed -ir 's/if(/if (/g; s/for(/for (/g; s/while(/while (/g' \
        *.h *.cpp modules/*.cpp



git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1030 726aef4b-f618-498e-8847-2d620e286838
2008-04-20 13:08:44 +00:00
psychon 654a55a507 Send PONGs for client's PINGs if we are not connected to a server
Thanks to SilverLeo for the patch (I changed those spaces into tabs and added
some *huge* comment on top).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1016 726aef4b-f618-498e-8847-2d620e286838
2008-04-04 14:12:16 +00:00
psychon e7bb3e5daa Remove an unused var from CClient
If CClient::m_bAuthed was false, CClient::m_pUser was NULL as well and
if it was true, m_pUser wasn't NULL, too. So why not take that var for
this job?


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1003 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 08:49:33 +00:00
psychon e0cfd7958e Add some currently missing commands to /msg *status help
Thanks to SilverLeo for this patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@974 726aef4b-f618-498e-8847-2d620e286838
2008-03-01 16:22:28 +00:00
psychon 3c5802271f One of last commits added some warnings due to -Wshadow which weren't fixed yet
This fixes those warnings.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@965 726aef4b-f618-498e-8847-2d620e286838
2008-02-19 20:30:24 +00:00
psychon 8f22dcc60d Fix all those warnings from -Wshadow
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@964 726aef4b-f618-498e-8847-2d620e286838
2008-02-19 20:25:21 +00:00
psychon 0edf201efd Add /msg *status listavailmods
Thanks to SilverLeo for this patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@961 726aef4b-f618-498e-8847-2d620e286838
2008-02-17 20:06:24 +00:00