Commit Graph

2523 Commits

Author SHA1 Message Date
Uli Schlachter ce5d73c9cd admin: Fix getchan {inconfig,keepbuffer,detached}
Instead of giving a useful result, they returned their result by sometimes
omitting the first character of the option name. Whoops.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-02 18:21:50 +02:00
Uli Schlachter 013d0d2773 Drop @DEFS@ from the build system
This will only ever be set to -DHAVE_CONFIG_H. However, we shouldn't give this
flag to other people's code (e.g. through znc-config). Since we don't need it,
it's best to just drop it completely.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-02 18:21:50 +02:00
Alexey Sokolov fa7de5a11a Merge branch 'redirects' 2011-09-02 20:35:09 +07:00
Alexey Sokolov 5e73af632a Install .py files along with .pyc 2011-09-01 02:55:13 +07:00
Alexey Sokolov 8f98384512 Add a message sent to user in case of redirect. 2011-09-01 02:41:12 +07:00
Kyle Fuller d14528b59e Allow loading python modules with modpython (ex. modname/__init__.py)
Fixes #58
2011-08-31 17:26:04 +00:00
Kyle Fuller 1f16d6dc32 Let a user filter the result of help CModule::HandleHelpCommand 2011-08-31 16:26:28 +00:00
Kyle Fuller 3eaa308d28 Don't timeout bouncedcc connections, inactive bounced DCC chat's would be dropped otherwise 2011-08-31 02:09:06 +00:00
Kyle Fuller bf8b1624c9 Unload user and network modules once all the clients are gone and we are disconencted from any IRC servers.
The OnIRCDisconnected module call would cause a segmentation fault
because it would try m_pNetwork->GetModules().GetNetwork(). GetModules()
would return NULL.
2011-08-31 01:22:21 +00:00
Kyle Fuller 75d7cdffd9 Fix CALLMOD, m_pNetwork could be NULL, in this case CALLMOD would be passed a NULL network. But CALLMOD will try calling its modules anyway 2011-08-31 01:05:13 +00:00
Kyle Fuller e70b6854a3 Fix modp{erl,ython}, these modules should set a "default" module type for its submodules
These modules were broken by d48ae679c4
2011-08-30 20:50:06 +00:00
Kyle Fuller 9006fecf08 Turn stickchan into a network module, this prevents a segfault 2011-08-30 20:48:16 +00:00
Uli Schlachter 10c33112c4 Fix logging in with PASS after USER
First, we set m_sUser to the argument of USER. Later, when the PASS came in, the
username which was specified here (user/network:pass) was ignored, because
m_sUser was already set ("if (m_sUser.empty() &&" in ParseAuthLine).

The fix is to ignore if m_sUser was already set when parsing "PASS". Since this
means that the handling of PASS and USER becomes even more different, this
commit removes CClient::ParseAuthLine() again.

(The check for m_sUser.empty() can't just be dropped, because if USER comes in
after PASS, we should use the user name from PASS and ignore the USER one)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-29 13:02:55 +02:00
Uli Schlachter 9c9e40a3d7 Remove some IMHO dangerous functions
Instead, these functions are now inlined into their only caller. This should
make the user and network destruction a little saner. At least I hope so...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-29 12:52:21 +02:00
Uli Schlachter bd3e6d3f7b Partyline: Drop support for fixed channels
This doesn't fix partyline yet, but makes it a lot easier to fix.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-29 12:26:57 +02:00
Uli Schlachter 601692999d Silence some wrong compiler warnings
For every available module call implementation, we got this:

Modules.cpp: In member function ‘bool CModules::OnGetAvailableMods(std::__debug::set<CModInfo>&, CModInfo::EModuleType)’:
Modules.cpp:149:72: error: ‘pNetwork’ may be used uninitialized in this function [-Werror=uninitialized]
Modules.cpp:808:260: note: ‘pNetwork’ was declared here
Modules.cpp:148:54: error: ‘pOldUser’ may be used uninitialized in this function [-Werror=uninitialized]
Modules.cpp:808:168: note: ‘pOldUser’ was declared here

I guess GCC saw that m_pNetwork and m_pUser could be changed by the module call
to a non-NULL value which means we would really use an uninitialized value...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-29 10:24:03 +02:00
Alexey Sokolov dc332837e2 Merge pull request #61 from nbebout/master
Add ZNC systemd unit file for those distros that use systemd for their init
2011-08-27 20:37:01 -07:00
Kyle Fuller d48ae679c4 Add default types to modules 2011-08-27 17:06:52 +00:00
Kyle Fuller 98777a27af Allow loading the log module as either user, network or global 2011-08-27 17:06:47 +00:00
Kyle Fuller 8910ec5776 Allow the cert module to be loaded as a network module 2011-08-27 17:06:41 +00:00
Kyle Fuller b2e6d09bbd Perform is now a network module, but could also be loaded as a user module if the user desires
perfom
2011-08-27 17:06:39 +00:00
Kyle Fuller d3ffdbb2a6 Part the client from the channels they are in when they used /znc JumpNetwork 2011-08-25 21:17:39 +01:00
Kyle Fuller b3b4e08769 Allow a user to add networks in znc --makeconfig 2011-08-25 21:17:38 +01:00
Kyle Fuller 260421e6e8 Make modpython support network modules 2011-08-25 21:17:28 +01:00
Kyle Fuller 9a2fed6923 Turn modtcl into a network module 2011-08-24 19:07:33 +01:00
Kyle Fuller 9b746dcc31 Change the order that modules are looked up in /msg *module
The new order is as follows:
    Network Module
    User Module
    Global Module
2011-08-24 19:07:33 +01:00
Kyle Fuller 0b1627c529 Make all the modules support networks 2011-08-24 19:07:32 +01:00
Kyle Fuller ee7a2083c8 Make the *webadmin module support IRC networks 2011-08-24 19:07:32 +01:00
Kyle Fuller 0f9af26999 Support IRC networks in the *admin module 2011-08-24 19:07:32 +01:00
Kyle Fuller e3a8dd9ce8 Add support for network commands with *status 2011-08-24 19:07:32 +01:00
Kyle Fuller 8dd2a704bb Create network modules 2011-08-24 19:07:32 +01:00
Kyle Fuller 498cbf8a1e Make CNick network aware 2011-08-24 19:07:32 +01:00
Kyle Fuller da6c601e57 Make IRCSock network aware 2011-08-24 19:07:32 +01:00
Kyle Fuller ef2b2cf601 Make CClient network aware 2011-08-24 19:07:31 +01:00
Kyle Fuller 4e4e88e8fc CChans should now work on IRC networks 2011-08-24 19:07:31 +01:00
Kyle Fuller fec1a3fe91 Add CIRCNetwork which now hold each IRC Connection.
This allows a user to have multiple networks.

A user can login as a network by supplying PASS [user[/network]:]pass or
USER user[/network] on connect. A user can also switch between networks
by using /msg *status JumpNetwork <network>
2011-08-24 19:07:26 +01:00
TorrentialStorm 5512ed2ea0 Don't forward server redirects to client. 2011-08-24 17:55:59 +01:00
TorrentialStorm 960a4498f7 Don't send server redirects to client [TorrentialStorm] 2011-08-24 13:15:20 +01:00
Alexey Sokolov 88033a5b3e Save listeners as a section in znc.conf 2011-08-22 03:05:11 +07:00
Alexey Sokolov d2b005aaf8 Add an easy way to read bools and ints from config. 2011-08-22 03:02:15 +07:00
Alexey Sokolov afbd7410b1 Fix doxycomment about global mobules. 2011-08-22 00:56:56 +07:00
Alexey Sokolov fca0d83de8 Fix modpython about renaming EModuleType. 2011-08-22 00:55:45 +07:00
Uli Schlachter 288f450ea7 Save passwords as a section in znc.conf
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-21 18:01:58 +02:00
Uli Schlachter 2513149b42 Fix up indentation in config writing
This accidentally caused null bytes to be written to the config.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-21 18:01:58 +02:00
Uli Schlachter 26368a6c29 Some more cleanup to module loading
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-21 18:01:58 +02:00
Uli Schlachter 80c76c97a6 Remove GLOBALMODCONSTRUCTOR
MODCONSTRUCTOR does that job just fine (now).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-21 18:01:58 +02:00
Alexey Sokolov c2cc57cbf4 Fix compilation of modpython. 2011-08-21 21:51:28 +07:00
Alexey Sokolov b62c47c86e Add new parameter of OnModuleLoading to doxygen. 2011-08-21 21:51:11 +07:00
Uli Schlachter cce40e9f71 Move the EModuleType into CModInfo
This also renames the values to shorter and more "well sounding" names.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-21 16:30:36 +02:00
Uli Schlachter 5f53c3509f Fix some minor issues
E.g. a gcc warning about an uninitialized variable.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-08-21 15:58:01 +02:00