Commit Graph

2038 Commits

Author SHA1 Message Date
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 8c24ebb641 Webadmin: Remove the special rule for CVS and ignore .svn instead
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1043 726aef4b-f618-498e-8847-2d620e286838
2008-05-08 13:45:16 +00:00
psychon 8cf12e8931 Clean up FileUtils.h
This removes some commented out functions and it also
removes CFir::Exists() since CFile::IsDir() does exactly
the same job (and it uses fewer syscalls for that).



git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1042 726aef4b-f618-498e-8847-2d620e286838
2008-05-08 13:32:34 +00:00
psychon 005af9c2c3 CString::Split(): Skip empty tokens at the beginning for bAllowEmpty = false
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1041 726aef4b-f618-498e-8847-2d620e286838
2008-05-08 13:23:47 +00:00
psychon 5665fd872d Update to latest Csocket
This breaks (& fixes again, as far as ZNC itself is concerened) API!


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1040 726aef4b-f618-498e-8847-2d620e286838
2008-05-06 14:47:13 +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 7d0314f416 *Always* forward our own nick changes to clients
Thanks to SilverLeo for finding and debugging this one.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1037 726aef4b-f618-498e-8847-2d620e286838
2008-05-04 14:55:21 +00:00
psychon 311d20495f Call setsid() after forking
This way we get rid of our controlling terminal.
Now ZNC won't stay in the session of the shell anymore...


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1036 726aef4b-f618-498e-8847-2d620e286838
2008-05-04 14:08:10 +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 3dd274f6a6 Make znc-buildmod report failures via exit code
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1034 726aef4b-f618-498e-8847-2d620e286838
2008-04-29 18:29:59 +00:00
psychon fe361f7a18 Display a better error message if znc.conf cannot be opened
If znc.conf was a regular file which we just couldn't open (chmod 0), ZNC
reported that it was already running on this config.
This patch fixes this message.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1033 726aef4b-f618-498e-8847-2d620e286838
2008-04-29 12:15:48 +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 c0a91af22e Makefile.in: Use $(bindir) instead of $(prefix)/bin
Also this removes a double 'prefix :=' line.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1031 726aef4b-f618-498e-8847-2d620e286838
2008-04-25 16:27:00 +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 b0a1714b86 Remove useless spaces inside of braces "( stuff )"
This was generated via the following command:

  cat <file> | \
  tr "\n" "€"| \
  sed -r 's/€[\t ]*\{€/ {€/g; s/\( */(/g; s/ *\)/)/g' | \
  tr "€" "\n"

Thanks to SilverLeo for producing this mess :P


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1029 726aef4b-f618-498e-8847-2d620e286838
2008-04-20 13:00:19 +00:00
psychon 0470977497 schat: Use CString's features instead of strcasecmp and friends
This also breaks long lines (longest line is now 114 chars, was 180).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1028 726aef4b-f618-498e-8847-2d620e286838
2008-04-20 12:39:21 +00:00
psychon 5822a2de75 Fix the Makefile's dependency tracking
Turns out that .depend's mtime changes when you modify files in there
and since every .cpp file depended on .depend, make regenerated everything.
Not good.

Fix this by inlining the mkdir for .depend.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1027 726aef4b-f618-498e-8847-2d620e286838
2008-04-20 12:21:26 +00:00
psychon 5c5cde9c34 Makefile: Always do dependency tracking
If you now change znc.h, every file that '#include's znc.h is *always*
regenerated.

According to [1], these compiler flags were already around with GCC 3.2, so
this change shouldn't hurt anyone.

[1] http://lists.samba.org/archive/ccache/2002q4/000003.html


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1026 726aef4b-f618-498e-8847-2d620e286838
2008-04-20 07:00:40 +00:00
psychon 8d5fa6bc3b Break some way too long lines into way less long lines
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1025 726aef4b-f618-498e-8847-2d620e286838
2008-04-18 09:25:28 +00:00
psychon 011ddfe499 Fix some stupid bug which even GCC found and warned on
Yeah, I *really* feel stupid for letting something like this slip :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1024 726aef4b-f618-498e-8847-2d620e286838
2008-04-17 15:52:55 +00:00
psychon 5f293039b5 Display better error messages if we can't connect to IRC
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1023 726aef4b-f618-498e-8847-2d620e286838
2008-04-16 19:46:26 +00:00
psychon 51dd3e2b32 Use unix EOLs (\n) instead of DOS ones (\r\n) for writing znc.conf
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1022 726aef4b-f618-498e-8847-2d620e286838
2008-04-15 14:33:37 +00:00
psychon 5a34291455 Shell: Don't send invalid nonsense like empty strings as ident
The shell module uses the current nick for that user as the ident for queries
from *shell. This makes no sense I once managed to get an empty ident, which
confused irssi badly.

Since there is no good reason to use this as ident, just use some
static string as ident instead.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1021 726aef4b-f618-498e-8847-2d620e286838
2008-04-11 12:25:41 +00:00
psychon 52f755f0fd Reuse the FD for locking the config for reading it
This saves us one whole open() :P
Honestly, this fixes some (stupid) locking problems with cygwin and shouldn't
hurt much otherwise (And no, cygwin still isn't supported yet).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1020 726aef4b-f618-498e-8847-2d620e286838
2008-04-08 18:53:05 +00:00
psychon 0afd0cf5dd Support channels other than #chan or &chan
Without this e.g. +chans are changed to #+chans in CChan::CChan()
because IsChan() pretends it's sure that this can't be a channel.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1019 726aef4b-f618-498e-8847-2d620e286838
2008-04-08 08:21:40 +00:00
psychon 5590307909 chansaver: Add all channels to the config when this module is loaded
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1018 726aef4b-f618-498e-8847-2d620e286838
2008-04-07 20:19:17 +00:00
psychon e24fdab787 Mark znc-config.in as executable, that way znc-config gets that too
This fixes something which long annoyed me :P


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1017 726aef4b-f618-498e-8847-2d620e286838
2008-04-05 17:09:30 +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
imaginos 1f4963c452 extra line breaking shit, its not supposed to be there :P
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1015 726aef4b-f618-498e-8847-2d620e286838
2008-04-03 15:43:52 +00:00
psychon f642a493a7 Fix configure on FreeBSD (It didn't find dlopen)
I guess I broke configure recently :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1014 726aef4b-f618-498e-8847-2d620e286838
2008-04-02 19:02:23 +00:00
imaginos 3583b4b5de fix state bug when connecting to a remote host thats ssl, results from a hostname that resolves to multiple ip's
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1013 726aef4b-f618-498e-8847-2d620e286838
2008-04-02 16:15:24 +00:00
psychon 6d957ed93c Use MODFLAGS instead of CXXFLAGS for the modules
This also removes the duplicate check for dlopen() in configure.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1012 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 09:09:23 +00:00
psychon 0a5d3013d2 Add OnTopic() module call
Thanks to SilverLeo, again.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1011 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 09:03:17 +00:00
psychon 3be33dd6c8 Don't create empty .registry files for module data
This command showed a *lot* of empty files in ZNC's data dir
  find ~/.znc -iname ".registry" -size 0|wc -l

Thanks to SilverLeo


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1010 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 09:01:55 +00:00
psychon 58a6a8f0e8 The disconnected warning you get on-connect should *not* be broadcasted *fix*
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1009 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 09:00:21 +00:00
psychon ffe31fccd2 Shell module: Also read incomplete lines (no trailing newline) and display them
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1008 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 08:59:13 +00:00
psychon 617e732f66 Only allow admins to load the shell module
The exception to this is if ZNC is compiled with -DMOD_SHELL_ALLOW_EVERYONE
x-x wanted this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1007 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 08:57:21 +00:00
psychon cbdfaf0ed3 Make CModule::DelNV() return false if it didn't remove anything
This fixes e.g. <*crypt> Target [543534532] deleted

Thanks to SilverLeo for the patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1006 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 08:55:44 +00:00
psychon 9b757c6f6a CUser::Clone() didn't handle the JoinTries and TimezoneOffset options *fix*
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1005 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 08:53:57 +00:00
psychon 73d8456dff Mark all FDs as close-on-exec
This marks all FDs which are valid after the function creating them returns
as close-on-exec, so that processes started from ZNC (e.g. through the shell
module) don't inherit a copy of all of our FDs.

Csocket already does this for its FDs.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1004 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 08:52:13 +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 74447ee1d1 Increase the version number to 0.055
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1002 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 06:24:38 +00:00
psychon 66711fd746 Increase the version number to 0.054
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1000 726aef4b-f618-498e-8847-2d620e286838
znc-0.054
2008-04-01 06:17:59 +00:00
imaginos 493d515490 this should fix all the ipv4/ipv6 issues, tested it on fbsd and linux
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@999 726aef4b-f618-498e-8847-2d620e286838
2008-04-01 00:22:43 +00:00
imaginos a89fa4618d removing connect() completely. replacing with hint to AI_ADDRCONFIG
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@998 726aef4b-f618-498e-8847-2d620e286838
2008-03-31 06:15:28 +00:00
imaginos a91f86d1c2 commenting out this test for now
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@997 726aef4b-f618-498e-8847-2d620e286838
2008-03-31 04:53:21 +00:00
imaginos 3933f807df wasn't being to smart here, not totally portable when specifying IPPROTO_IP, use the protocol pass in for best portability
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@996 726aef4b-f618-498e-8847-2d620e286838
2008-03-31 02:37:34 +00:00
imaginos fc191e4908 state bug, from previous fix broken vhost binding
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@995 726aef4b-f618-498e-8847-2d620e286838
2008-03-30 16:28:44 +00:00
imaginos 1fb0039732 reverse the order of dns lookup on bind vs dns lookup on remote host. this also does a check on each ip returned by getaddrinfo to be sure its able to connect to that host
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@994 726aef4b-f618-498e-8847-2d620e286838
2008-03-28 05:09:48 +00:00