Commit Graph

2306 Commits

Author SHA1 Message Date
Kyle Fuller
0537a6cbae Add a "Get" command to the notes module which allows you to lookup a note via the key 2011-03-12 19:19:58 +00:00
Alexey Sokolov
9506d7e32b Fix copying modules data directories.
This fixes out-of-tree builds.
2011-03-06 20:50:22 +06:00
Alexey Sokolov
3d3235743d Fix permissions for modules's static data.
With cp -Rp, the files's permissions were just copied from source.
But 4c7808c5c broke that behaviour, so after copying we set permissions for new installed files.

Why "install" doesn't support installing directories? :(
2011-02-28 23:49:53 +06:00
Daniel Holbert
4c7808c5cb Remove unnecessary "-p" parameter from cp command in Makefiles, to fix checkinstall failure 2011-02-28 14:25:22 +13:00
Uli Schlachter
d44e590336 Make CUser::m_sUserName constant
Changing the user name for a CUser instance is a really, really bad idea. There
are lots of paths that depend on the user name and only few of them are fixed up
when the user name changes.

This fixes a problem where admin's "CloneUser from to" caused problems with
modules, because all modules where loaded under the old user name and thus they
read/write NV data from the wrong directory in ~/.znc/users.

Thanks to un1matr1x for reporting this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-24 19:13:06 +01:00
Alexey Sokolov
0b8f9eec42 Merge branch 'commands' of https://github.com/kylef/znc into kylef-commands 2011-02-23 11:29:44 +06:00
Alexey Sokolov
0f2265cff3 Fix install of py modules if there're no of them. 2011-02-23 10:58:30 +06:00
Alexey Sokolov
b7700fe264 Install python modules properly.
There was a bug, because of which you needed to run make install twice to get .pyc files installed.
Now just make install works.
2011-02-23 10:48:27 +06:00
Kyle Fuller
256bd91525 Fix a incorrect Doxygen comment for CModCommand::HandleCommand
OnUnknownModCommand is called if a command isn't found, and HandleHelpCommand is never called.
2011-02-23 01:58:52 +00: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
Uli Schlachter
8eda266bae Fix shell module
shell didn't compile since 6bc36d1708 because it used the
three-argument-version of CModule::PutModule(). This commit replaced that with a
call to CModule::PutUser().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-22 23:36:54 +01:00
Uli Schlachter
9da852a07f Merge remote branch 'github-kylef/nick' 2011-02-22 23:15:50 +01:00
Kyle Fuller
6bc36d1708 Make CModule::PutModule use CUser::PutModule 2011-02-22 22:08:08 +00:00
Kyle Fuller
c48f0fde3c Don't specify the ident to use for away module in PutModule 2011-02-22 20:53:50 +00:00
Uli Schlachter
4acadb3cdf Evil trailing whitespace is evil!
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-22 21:03:45 +01:00
Uli Schlachter
f3f49e1092 Merge remote branch 'github-kylef/send_raw' 2011-02-22 20:51:34 +01:00
Kyle Fuller
a93a586f53 Show a list of users in the send_raw web interface 2011-02-22 16:06:43 +00:00
Alexey Sokolov
97d3906242 Move myself to first part of AUTHORS.
psychon wants this :)
2011-02-22 22:04:58 +06:00
Kyle Fuller
d8b181718c send_raw: Add a web interface 2011-02-22 15:14:34 +00:00
Alexey Sokolov
3c2e103aad Add *.pyc and modperl/functions.cpp to .gitignore 2011-02-22 20:07:45 +06:00
Uli Schlachter
1aed330825 Fix .gitignore
The following files where incorrectly ignored:

./configure.ac
./modules/modpython/znc.py

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-22 14:57:25 +01:00
Uli Schlachter
31bbffa579 Convert admin to the new CModCommand interface
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-21 15:34:28 +01:00
Uli Schlachter
8e59fb957c Add CModule::OnUnknownModCommand()
This module hook is called to generate messages for unknown commands. This hook
has a default implementation that actually does something!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-21 15:34:25 +01:00
Uli Schlachter
ebd7e53d7f Add a generic command handling to CModule
With this, modules can use AddCommand() to register commands. CModule will
dispatch all calls to OnModCommand() to the correct command handler.

If a module calls AddHelpCommand(), it will also generate help output.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-21 15:33:59 +01:00
Uli Schlachter
cb2e50a5bd CFile: Handle paths like "~/foo"
This let's CFile expand relative-to-home paths. I "accidentally" broke
ISpoofFile with some recent commit and that is now fixed with this. This should
solve this problem for quite a lot of other places, too.

Idea (c) by DarthGandalf, thanks. :)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-20 11:14:56 +01:00
Uli Schlachter
ce10cee260 Correctly handle "~" in SSLCertFile
This works correctly because only the config writing/reading accesses
CZNC::m_sSSLCertFile directly, everything else goes through this getter.

This ChangeDir() call will also "sanitize" the path. E.g. "/foo//..//home///"
will be turned into "/home/" and stuff like that.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-20 11:14:56 +01:00
Uli Schlachter
f69aeff3d9 Some minor cleanup
This makes the code use GetISpoofFile() instead of accessing m_sISpoofFile
directly. Additonally, CFile::GetLongName() is used for printing the filepath.

(This also removes an useless if branch, because nothing here cares if
m_sISpoofFile is empty, we just need the lock file.)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-20 11:14:56 +01:00
Uli Schlachter
cd78225482 Don't expand ~ in ISpoofFile
This way, we can write the original value back to the config. Also, this "fixes"
a bug because webadmin didn't do this step.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-20 11:14:56 +01:00
Alexey Sokolov
080bf674e0 Add perl module perleval.
It allows you to evaluate perl code you /msg to it.
2011-02-19 21:37:03 +06:00
Alexey Sokolov
92304835ef Show list of common modules in --makeconfig without any question before it.
"Don't ask to ask!"
2011-02-19 21:24:50 +06:00
Uli Schlachter
fbd8d69c50 Partly revert commit 7784492
"Don't force --foreground when compiled with --enable-debug"

Instead, this is now wrapped in an #ifdef ALWAYS_RUN_IN_FOREGROUND, so that I
can use ./configure CXXFLAGS="-DALWAYS_RUN_IN_FOREGROUND".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-19 13:51:58 +01:00
Alexey Sokolov
20e771c4a2 Merge branch 'master' of github.com:znc/znc 2011-02-19 11:35:36 +06:00
Alexey Sokolov
f5fe9868e1 Provide link to wiki page from header comment of znc.conf 2011-02-19 10:04:25 +06:00
Uli Schlachter
4faad67f81 admin: Allow omitting of the user name with some commands
This changes admin to assume that an "empty username" was specified if some
arguments is empty which shouldn't be empty. This empty username is then
interpreted as meaning the current user.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 14:50:12 +01:00
Uli Schlachter
3f0e200073 Admin: Add functions for listing/adding/removing CTCP replies
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 14:50:12 +01:00
Uli Schlachter
c1bb18b9e8 Add CUser::DelCTCPReply()
This function is the counterpart for CUser::AddCTCPReply(). Guess what? It
removes an entry from CUser::m_mssCTCPReplies again! It's magic!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 14:50:12 +01:00
Uli Schlachter
2ccafaf516 Add CTable::empty
It shouldn't make any real difference (especially not for std::vector), but
"empty()" is better than using "size() == 0".

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 14:50:12 +01:00
Uli Schlachter
e7fc8fa907 CUser::AddCTCPReply(): Reject CTCP requests containing spaces
CTCP requests can't contain spaces so it's useless to specify rules for those.

This doesn't affect any of the existing callers because those use Token(0) for
generating the first argument to this function.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 14:50:12 +01:00
Uli Schlachter
4ed833abbd Remove a useless lookup
All the places that add entries to the CTCPReplies map use CString::Token(0) to
split the first token away. This means it is impossible for this to contain
spaces. Now this means that it is pointless to look up the full CTCP request in
the CTCPReplies map because it can't contain any matching item.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 14:50:12 +01:00
Alexey Sokolov
7784492234 Don't force --foreground when compiled with --enable-debug 2011-02-18 19:41:43 +06:00
Uli Schlachter
cc552fb3f5 Update to latest Csocket
We are using a vanilla version of Csocket again. Previously, our copy of
Csocket.h had a new '#include "zncconfig.h"'.

The other changes are mostly cleanup for various compiler warnings. The switch
from inet_ntoa() to inet_ntop() is for thread-safety reasons.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 11:56:39 +01:00
Uli Schlachter
32e89efa95 Fix some minor spelling weirdness
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18 10:46:53 +01:00
Uli Schlachter
2dcf79cedc Move modtcl into modules/
If you did ./configure --enable-tcl, tcl wasn't actually enabled because
--enable-extra was missing, That's less than optimal.

Just moving modtcl out of modules/extra solves this problem.

Big thanks go to zynox/kylef for noticing this!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-17 17:45:46 +01:00
Uli Schlachter
a533066dc6 Call modules for /MODE done by not-in-channel nicks
When ChanServ ops someone in a channel without joining first, znc didn't call
modules for this event, because it couldn't figure out a CNick* instance to use

Instead, the module hooks are now executed with a temporary CNick instance which
is created by CIRCSock anyway.

Big thanks to Robby for reporting this and helping me test it!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-16 12:53:06 +01:00
Nick Bebout
087f01e99b Fix URL to not point to sourceforge 2011-02-15 20:48:49 -06:00
Kyle Fuller
c7c12f0b83 CModules::OpenModule shouldn't return false 2011-02-15 20:06:50 +00:00
Kyle Fuller
e6bff0c367 Use Markdown for the README file 2011-02-14 18:36:54 +00:00
Uli Schlachter
86c0e97c85 .gitignore: Add some more rules
This now also ignores the generated files due from modpython and modperl and
some more fun.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-14 17:19:29 +01:00
Uli Schlachter
2d27386ced Merge branch 'ignore' of https://github.com/kylef/znc 2011-02-14 17:10:41 +01:00
Alexey Sokolov
9cbd494588 Merge branch 'master' of github.com:znc/znc 2011-02-14 21:37:11 +06:00