1
0
mirror of https://github.com/anope/anope.git synced 2026-06-18 15:34:47 +02:00

Compare commits

...

407 Commits

Author SHA1 Message Date
Adam a762391446 Anope 2.0.2 Release 2015-03-22 15:34:50 -04:00
Adam c070a00114 Fix m_ldap_oper to build 2015-03-22 15:34:49 -04:00
Adam e7c3090a70 Fix new version stuff with empty version extra 2015-03-22 14:38:29 -04:00
Adam 5dd6326eff Merge pull request #115 from aFreshMelon/aFreshMelon-patch-1
XML-RPC responses also don't have a methodName tag
2015-03-22 13:56:07 -04:00
Adam 535ad6fd70 Merge pull request #112 from attilamolnar/2.0+inspircdmlock
InspIRCd 2.0: Ensure ircd-side mlock and topic lock state is always what we think it should be
2015-03-22 13:56:01 -04:00
Robby- 5df4ac9a98 Make the signed kick/ban message format configurable. 2015-03-22 13:44:08 -04:00
Adam 4c54a3939f Change git version name back to what it was, which the core uses 2015-03-22 10:26:53 -04:00
Adam 3d09748d1c Fix typo in Changes 2015-03-22 10:26:26 -04:00
Sebastian Barfurth 36a4be7623 XML-RPC responses also don't have a methodName tag
Following http://xmlrpc.scripting.com/spec.html
2015-03-18 19:06:08 +01:00
Adam 5fc72660e4 Merge pull request #113 from attilamolnar/2.0+openssl
m_ssl_openssl: SSL context option changes
2015-03-12 17:53:52 -04:00
Adam 303e652a35 Only apply keepmodes on channel sync
Not sure why this was this way originally, it interfears with the
chanserv +r check to determine how new the channel is because it
restores +r. This seems to still work okay, though.
2015-03-12 17:52:38 -04:00
Adam e5447a8024 Update Changes.conf and Changes 2015-03-12 17:52:38 -04:00
Attila Molnar 1bee18fcf4 m_ssl_openssl: Allow disabling SSLv3 via the config 2015-03-12 19:35:07 +01:00
Attila Molnar a57e41304f m_ssl_openssl: Set sane default context options 2015-03-12 19:35:07 +01:00
Adam e0e8147ee0 Merge pull request #114 from anope/revert-99-extemp_protected
Revert "Added kickcheck override for users with protected privs"
2015-03-12 13:30:12 -04:00
Adam 41a24afa4f Revert "Added kickcheck override for users with protected privs" 2015-03-12 13:29:50 -04:00
Adam 4266d17e8c Update cmake version parsing code to deal with recent build version changes
Update Config.cs to no longer hardcode VS generators, it seems no longer necessary.
Fix new version system, cannot return C++ types from extern C functions
2015-03-12 11:20:18 -04:00
Adam 8d3fa47ab2 Merge pull request #99 from H7-25/extemp_protected
Added kickcheck override for users with protected privs
2015-03-12 08:15:59 -04:00
Adam 64781817ac Merge pull request #105 from miwob/master+use-uid-for-svsnick
- Change SendForceNickChange() to use UIDs
2015-03-12 08:15:49 -04:00
Adam 69c18f131f Merge pull request #106 from miwob/master+SendClientIntroduction
- Update SendClientIntroduction() to use * for account names instead of ...
2015-03-12 08:15:44 -04:00
Adam e030771cbc Merge pull request #107 from miwob/master+misc-hybrid-changes
- Misc updates to the hybrid protocol modules:
2015-03-12 08:15:38 -04:00
Adam 03f05d3948 Merge pull request #111 from aFreshMelon/fix-xmlrpc-response
Correct wrong XML response tag
2015-03-12 08:15:31 -04:00
Adam 32c4908c8c Document that m_ldap_authentication:disable_register_reason blocks grouping 2015-03-12 08:01:27 -04:00
Adam c5ff7c6868 Show passlen in PASSWORD_TOO_LONG 2015-03-12 08:00:12 -04:00
Attila Molnar 89257d9bce InspIRCd 2.0: Re-set server-side topiclock when an incoming METADATA topiclock from a bursting server changes it 2015-03-11 23:46:00 +01:00
Attila Molnar e47aacad0e InspIRCd 2.0: Re-set server-side mlock when an incoming METADATA mlock from a bursting server changes it 2015-03-11 23:46:00 +01:00
Attila Molnar 72ade225a7 InspIRCd 2.0: Pass use_server_side_topiclock and use_server_side_mlock references to METADATA handler 2015-03-11 23:46:00 +01:00
Attila Molnar a52af0d260 InspIRCd 2.0: Add METADATA handler, pass everything to inspircd12/metadata 2015-03-11 23:46:00 +01:00
Adam 92920f5a1c Only matches sqlines against channels if they begin with a # 2015-03-11 14:49:03 -04:00
Peter Tseng bf727285bc SendConfirmMail: Replace %E with new email
The old mailer message said the user is changing email "to %e", which is
changing TO the OLD email. But instead, the user is actually changing
the email to the new email.

We could change %e to be the new email, but maybe some users of Anope
have already configured their messages to assume %e is the old email. So
instead, add a new %E that is replaced with the new email.
2015-03-11 14:44:38 -04:00
Adam 310e95a92e Allow cs clone to clone levels too 2015-03-11 14:36:56 -04:00
Adam 78bff86dab Make cs_clone behave closer to how the help describes it 2015-03-11 14:24:42 -04:00
Adam 3f093d708f Normalize masks given to cs_kick, use entry to match them against users 2015-03-11 12:13:08 -04:00
Adam c3cc5804c3 Normalize masks given to cs_ban, use entry to match them against users 2015-03-11 11:26:12 -04:00
Adam dc58239c8a Remove cloak prior to applying vhost in insp20 fhost handler 2015-03-11 10:48:25 -04:00
Adam b67963353f Hide set desc because set description exists 2015-03-11 09:30:02 -04:00
Adam a899c04ec2 Strip color codes when looking up fantasy commands. 2015-03-11 09:16:32 -04:00
Adam fb17bc85ea Redesign m_ldap to no longer rely on undefined behavior
Accessing the same LDAP* from multiple threads at once is always
undefined, even if one thread is just polling ldap_result.

Instead keep one thread per connection and issue blocking queries on the
thread.
2015-03-11 08:48:08 -04:00
Sebastian Barfurth 474cd7a99b Correct wrong XML response tag 2015-03-07 19:05:41 +01:00
Adam 7de4b86b7f Move GIT_VERSION define to build.h, otherwise version.h is bumped per commit which forces a rebuild 2015-02-23 20:43:22 -05:00
miwob 76337bc04a - Misc updates to the hybrid protocol modules:
- best supported version is 8.2.x
  - fixed UID message handler to cope with account names being '*'
  - minium required TS version is TS6 now
2015-02-15 21:47:55 +01:00
miwob abe232601b - Update SendClientIntroduction() to use * for account names instead of 0 2015-02-15 21:33:22 +01:00
miwob 6ada3ec871 - Change SendForceNickChange() to use UIDs 2015-02-15 21:27:01 +01:00
H7-25 61a8dd57f7 Added kickcheck override for users with protected privs 2015-02-11 08:11:25 +01:00
Adam 94427b234c Merge pull request #102 from miwob/master+protocol-missing-modes
- Added some missing user modes to the ircd-hybrid protocol module
2015-02-10 19:18:46 -05:00
Adam fb3c819bee Merge pull request #103 from miwob/master+hybrid-misc-changes
Misc changes to the ircd-hybrid protocol module:
2015-02-10 19:18:40 -05:00
Adam f0c23e80a2 Merge pull request #104 from miwob/master+anope.de_DE.po-minor-update
- Minor update to anope.de_DE.po; removed double space + proper translat...
2015-02-10 19:18:30 -05:00
miwob 1e86c46000 - Minor update to anope.de_DE.po; removed double space + proper translation 2015-02-10 22:48:22 +01:00
miwob 2f49065500 Misc changes to the ircd-hybrid protocol module:
- Increase MaxModes to 6
  - SendLogout(): send "+d *" instead of "+d 0"
  - Update copyright year
  - Removed user mode +z from supported modes
2015-02-08 12:29:16 +01:00
miwob 41ae2dbefb - Added some missing user modes to the ircd-hybrid protocol module 2015-02-07 19:08:55 +01:00
Adam f44280a9c9 Merge pull request #101 from miwob/master+hybrid-protocol-no-globops-override
- Removed SendGlobopsInternal() override as it's basically a duplicate o...
2015-02-06 17:21:33 -05:00
Adam d147db9023 Merge pull request #100 from miwob/master+hybrid-protocol-cmode-ctcp
- Update ircd-hybrid protocol module to support channel mode 'C' (no CTC...
2015-02-06 17:21:30 -05:00
miwob f484a68dee - Removed SendGlobopsInternal() override as it's basically a duplicate of SendGlobopsInternal() in protocol.c 2015-02-06 20:28:30 +01:00
miwob 8550e22167 - Update ircd-hybrid protocol module to support channel mode 'C' (no CTCPs) 2015-02-06 19:39:31 +01:00
Adam 9834518b28 Fix os_mode to handle channels going away due to mode changes, and maybe cs_mode 2015-02-05 20:16:43 -05:00
Adam 64ca357b13 Make module version system work 2015-02-03 19:38:23 -05:00
Adam dc5039e994 Properly unescape xmlrpc 2015-02-03 18:42:35 -05:00
Adam 845ca576b4 More properly track topic change sources and allow users with access to change topics through topiclock 2015-01-28 22:57:15 -05:00
Adam 2264a206d2 Check virtual mode bases better 2015-01-26 15:10:18 -05:00
Adam d324e91520 Fix negatively locking param modes in default mlock 2015-01-26 13:16:25 -05:00
Adam 9ac1b4ba01 Merge pull request #98 from flotwig/patch-1
cs_entrymsg to use SET permission, not isFounder
2015-01-11 19:38:35 -05:00
Zach Bloomquist 7e0cb6d8ef cs_entrymsg to use SET permission, not isFounder
Correcting syntax error

(i don't actually know c++)
2015-01-11 19:29:33 -05:00
Adam 3055b7272b Fix m_xmlrpc server configuration option 2015-01-10 15:37:49 -05:00
Adam 969cd5dd6c Always use source name when logging server kicks 2015-01-10 15:29:19 -05:00
Adam 1f02278a1c Log user away messages 2015-01-10 15:24:48 -05:00
Adam 32007f81cf Add networkinfo:nick_chars option to allow configuring additional characters allowed in nicknames 2015-01-10 15:19:40 -05:00
Adam 609f87d39f Include botserv/* in default Services Administrator opertype to behave like 1.8 2015-01-10 15:19:40 -05:00
Adam e88925e587 Merge pull request #94 from webczat/2.0
Fix issue 1627.
2014-12-28 20:30:36 -05:00
Adam c46ec39e50 Only disable CMP0026 if it exists 2014-12-28 20:01:11 -05:00
Adam 9b2202dfee Merge pull request #93 from alexbarton/ngircd-fix-servertoken
ngIRCd protocol module: fix servertoken
2014-12-28 18:12:38 -05:00
Adam 03f6e26550 Merge pull request #95 from webczat/2.0x
fix chanserv.cpp using Get for bool extensible items
2014-12-28 18:11:37 -05:00
Adam c554e85063 Merge pull request #96 from webczat/termfork
Anope will now fork even when not started from a tty, like init scripts.
2014-12-28 18:10:40 -05:00
Adam 2892c9580f Replace spaces in opertypes with underscores in stats o 2014-12-28 18:09:37 -05:00
Adam 3c0994a89e Fix crash when non-users register channels 2014-12-28 18:08:58 -05:00
Adam e800afcfac Fix adding regmoderated mode twice in plexus 2014-12-28 18:08:39 -05:00
Adam 2ad697898f Disable CMP0026 warnings on cmake 3 2014-12-19 18:55:50 -05:00
Michał Zegan e4068249dd Anope will now fork even when not started from a tty, like init scrpits.
It is useful for init systems or startup scripts, because it allows easily waiting until services connect to the uplink, without them forking it wouldn't be possible to tell if they finished initialization or not unless they would communicate directly with init systems like systemd.
2014-12-12 19:53:30 +01:00
Michał Zegan d45cb5451e Fix issue 1627.
It required that the FHost message was rewritten for the insp20 protocol module instead of relying on inspircd12's version.
The insp20 version internally removes +x mode on host change.
2014-12-12 03:56:38 +01:00
Michał Zegan d9c9f2a407 Changed calls to Get() for bool extensible items to HasExt in the chanserv module, remove duplication of code. 2014-12-12 03:48:00 +01:00
Adam 7213413f8b Remove os exception move 2014-12-11 19:33:06 -05:00
Adam 516211c88a Add SAVE support to inspircd20 2014-12-07 19:32:21 -05:00
Robby- d576137f28 Update the dutch language file. 2014-12-07 17:42:00 +01:00
Adam e1f5e030bc Change webpanel access add to just add via the commands, split Command::Run into two so I can do this as I need to run named commands for it 2014-12-05 20:24:27 -05:00
Adam afffeb0a1d Update Kill() calls to pass source pointer instead of name 2014-12-05 17:27:08 -05:00
Adam 4fc71bb22f Link m_ldap against ldap_r not ldap 2014-12-02 15:49:14 -05:00
Alexander Barton d4732faf41 Correctly assign nicks to their respective host servers
Use the "server token" parameter of NICK commands to find the host server and
correctly assign the nick name to this server.

This allows Anope to correctly free all nick names again when (remote) servers
leave the network, which fixes arbitrary "KILL attacks" when such nick names
reconnect later on.

Initial debugging and patch by DukePyrolator, thanks a lot!
2014-11-30 21:50:11 +01:00
Alexander Barton 95684187b6 Fix server token assignment of servers in the network
1. the directly linked server, our upstream, always has token "1", and
2. for remote servers in the network, the token and description filds
   were interchanged during registration,

therefore up to now no server could be found by Server::Find() using its
assigned server token.
2014-11-30 21:49:34 +01:00
Adam 4f33b17f96 Move automatically identified for log message to users 2014-11-25 09:00:15 -05:00
Adam 0cdab86978 Set require_oper in /os oper 2014-11-24 22:10:12 -05:00
Adam 4f76bee273 Fix sid generator generating invalid sids after sid 999 2014-11-24 22:00:30 -05:00
Adam 8557a4161a Allow 0 ttb in flood kicker 2014-11-15 08:50:37 -05:00
Adam c9008cdafa Fix access dup check to account for accounts 2014-11-15 02:13:10 -05:00
Adam 8a7793da0c Fix bahamut mode handler 2014-11-08 04:31:56 -05:00
Adam 64b332730e Fix not removing zones from server->zones 2014-11-08 04:30:27 -05:00
Adam 36837330ae Fix typo in botserv.example.conf 2014-11-06 05:40:51 -05:00
Adam 8b64e46ef1 Show access denied if /os kick can't kick the target 2014-11-04 23:54:16 -05:00
Adam c4460784c2 Allow mlock to be enforced when unsetting defcon modes 2014-11-04 01:36:27 -05:00
Adam 408ec02406 Move chan register event prior to applying final mode changes, so cs_mode can set mlock on register. #1620 2014-11-04 00:09:00 -05:00
Adam 67fc8c3416 enc_bcrypt is no longer extra because it doesn't depend on external dependencies anymore 2014-11-03 23:50:40 -05:00
Adam fb2fd9e9d3 Fix log message when enabling botserv kickers 2014-11-03 23:45:22 -05:00
Adam 527e04275f Merge pull request #91 from Alef-Burzmali/2.0+fix-addakiller
Keep the akiller's name when updating the reason.
2014-11-03 23:43:50 -05:00
Adam c895bd2e59 Merge pull request #92 from Alef-Burzmali/2.0+update-fr
Update the French translation
2014-11-03 23:37:08 -05:00
Thomas Fargeix 94b2d1ac12 Update French language file. 2014-10-29 00:08:21 +01:00
Thomas Fargeix a76e074f6d Update the French install instructions. 2014-10-28 22:59:26 +01:00
Thomas Fargeix 2f004c2aab Keep the akiller's name when updating the reason.
The name of the oper issuing an akill or a sxline could be removed by updating the reason,
even though addkiller was enabled.
2014-10-24 23:49:02 +02:00
Adam b940077553 Validate credentials sent via sasl more 2014-10-16 21:38:46 -04:00
Adam c8ded08b43 Show extended strftime output for suspend info 2014-10-14 21:17:47 -04:00
Adam 62a01dcc87 Set access masks to the case of the nick they match, if any 2014-10-14 21:09:41 -04:00
Adam 0cd3bfa24f Fix module event prioritization which was broken with the newer
auto-attach event stuff.

Also remove logically dead code from os_defcon, and make os_defcon akill
similar masks to os_session when enforcing session akills.

Fixes #1618 which relies on os_session to be prioritized before
os_defcon.
2014-10-14 18:58:55 -04:00
Adam e46bcff324 Move nick register event to make it easier for modules to determine if a newly registered nick is confirmed or not. Add confirm event. 2014-10-12 19:25:39 -04:00
Adam 67719e8db1 Add exempts and optionally allow authenticated users past m_dnsbl 2014-10-12 15:03:51 -04:00
Adam 48be41cf7b Squit uplink when I receive an squit for myself 2014-10-12 14:34:15 -04:00
Adam 5ceee5df38 Hide dumb user notice if we are quitting 2014-10-12 14:32:17 -04:00
Thomas Fargeix 1c12976958 Add an operserv/oper/modify privilege.
The operserv/oper command privilege allows to add operators
with fewer or the same privileges as ourself.
This new privilege allows to have operators who can use operserv/oper
to see the list of operators and their privileges, but cannot add new
operators.
2014-10-12 10:54:11 -04:00
Thomas Fargeix 96583892c6 Add a chanserv/access/list privilege
Replace the existing chanserv/access/list command access,
only used in cs_xop, by a privilege with the same name.

It which allows read-only access to cs_access, cs_flags, cs_xop
and cs_akick, while the already-existing chanserv/access/modify
privilege allows to modify them.
2014-10-12 10:52:48 -04:00
Robby- 0991d4e199 operserv.example.conf: Add missing permission definition to os_defcon's command. Fixes bug #1617. 2014-10-09 23:35:38 +02:00
Adam 58233fb8bc Log when memos are sent 2014-10-06 14:06:36 -04:00
Adam be928b5bbc Clean up collide timers on identify, otherwise you can login and logout before the timer tick which will still enforce the collide 2014-10-06 14:06:36 -04:00
Adam 31bc1d6b82 Don't add duplicate akills in os_session 2014-10-06 14:06:36 -04:00
Adam 829ef1b7bd Clear pending collided state on release, fixes colliding users using recover into enforcers 2014-10-06 14:06:36 -04:00
Adam b068874f40 Add a confirmation reply to ns recover on an unidentified user with svsnick 2014-10-06 14:06:36 -04:00
Adam 18b3c572f4 ngircd doesn't allow sourceless messages 2014-10-06 14:06:36 -04:00
Adam af034928cb Remove auto cmake downloader Config stuff, which randomally doesn't work on some systems for no reason 2014-10-06 14:06:36 -04:00
Adam 8d40a750cc Update INSTALL to reflect cmake requirement 2014-10-06 14:06:36 -04:00
DukePyrolator 6a3f7c01b1 changed the engine of the chanstats table from InnoDB back to MyISAM to avoid increasing the auto_increment counter on each INSERT IGNORE. For existing tables please manually run 'ALTER TABLE anope_chanstats ENGINE=MyISAM'. 2014-09-14 11:36:05 +02:00
DukePyrolator 4c2bf72cb6 fixed typo in the last commit 2014-09-14 11:12:54 +02:00
DukePyrolator 8e7b742ec7 added missing support for operonly and silentoperonly in os_defcon 2014-09-14 11:11:22 +02:00
DukePyrolator 19b47c7bae fixed a possible crashbug in the german language file 2014-09-13 13:06:56 +02:00
Adam 3bdc81348a Fix unserializing badwords to not add dupes when unserializing an existing bw object 2014-09-01 13:11:21 -04:00
Adam bf8f62c32d Change Channel::GetModeList to return a copy of the mode list, not a
pair of lower/upper bound iterators.

Sometimes when iterating the list, like in cs_mode, we can modify the
contents of it, which combined with mlock always agressively trying to
readd modes to it can do bad things.
2014-08-24 16:39:04 -04:00
Robby- d417241a5b cs_set: Fix logging for SET SUCCESSOR to correctly log overrides. 2014-08-11 20:16:42 +02:00
Adam e5cb2018e5 List opertypes in /os oper info 2014-08-03 19:15:08 -04:00
Adam df6095fed2 Make botserv fantasy override its own privilege 2014-08-03 19:10:15 -04:00
Adam 8210e82a5e Fix some botserv help entries from showing when they shouldn't 2014-08-03 19:08:12 -04:00
Adam d6d72cd803 Add cs_mode:max config option 2014-08-03 18:57:00 -04:00
Adam 063d9bf5f6 Allow "modify" in flags to be optional 2014-08-03 18:33:56 -04:00
Adam 830e8617e6 Allow "set" in topic set to be optional 2014-08-03 18:28:54 -04:00
Adam cf89e10a4c Add ms_ignore:max config option 2014-08-03 18:22:03 -04:00
Adam 6842ad36f7 Do not allow unconfirmed users to send memos or request vhosts 2014-08-03 18:05:41 -04:00
Adam 24f17de4aa Fix stats u on Windows 2014-08-03 18:03:07 -04:00
Adam bbb04d4662 Fuzzy italian signkick help 2014-08-01 16:12:41 -04:00
Robby- 20052247c3 Regenerate anope.en_US.po 2014-07-27 08:05:54 +02:00
Robby- 8b61a529a2 Update the dutch language file. 2014-07-27 07:48:50 +02:00
Robby- 1137c50095 Fix a few help messages. 2014-07-27 07:34:02 +02:00
Adam 52d422d020 Merge pull request #81 from miwob/master+invite_ts
hybrid.cpp: add our own SendInvite() which sends the channel's timestamp...
2014-07-26 13:41:47 -04:00
Adam 43c460e593 Merge pull request #85 from attilamolnar/2.0+help
Correct the help text of options:useprivmsg ("defmsg" -> "msg")
2014-07-26 13:40:58 -04:00
Adam 17ba13bc95 Use ts version of services stamp when the account is unconfirmed on Unreal as 3.2.10.4 has changed thie behavior 2014-07-26 13:28:43 -04:00
Adam 60229b15d2 When object unserialization fails (due to not having dependency objects) bump the ts to try again later. 2014-07-26 13:24:52 -04:00
Adam 3c88f3b8cf Check modetimes in CheckModes before enabling bouncy modes 2014-07-15 17:02:14 -04:00
Adam 93cb5d06db Fix channelcount with clone 2014-07-11 01:02:02 -04:00
Adam 7a64d95f7c Fix Log() calls in m_ldap_oper 2014-07-11 00:22:32 -04:00
Attila Molnar ff66e15f38 Correct the help text of options:useprivmsg ("defmsg" -> "msg") 2014-07-04 04:39:12 +02:00
Adam 07902c03fd Check that the list of items isn't NULL when destructing types 2014-06-28 23:15:59 -04:00
Adam d9949320c7 Don't try to setuid down until after we signal the parent to exit, unless we're not forking. Also don't issue the run as root warning if we're going to setuid later. 2014-06-28 23:15:59 -04:00
Robby- b0ec178e85 Merge pull request #84 from Zantox/2.0
Minor cs_unban Lang Update @Robby-
Updated HostServ Command English Language
Updated ChanServ Command English Language
Updated BotServ Command English Language
2014-06-26 22:17:51 +02:00
Zantox f753a925ad Minor cs_unban Lang Update @Robby- 2014-06-26 22:14:10 +02:00
Zantox 74dbfe0699 Updated HostServ Command English Language 2014-06-25 02:16:09 -04:00
Zantox 3bea089793 Updated ChanServ Command English Language 2014-06-25 02:09:43 -04:00
Adam ff93355af8 Hold a reference to the type in Serialize::Checker in the event it goes away, and invalidate the type pointer of objects when the type goes away 2014-06-23 15:44:06 -04:00
Zantox 8fecad3039 Updated BotServ Command English Language 2014-06-23 07:47:26 -04:00
miwob 37bd2c238e hybrid.cpp: add our own SendInvite() which sends the channel's timestamp along the INVITE command. INVITE with channel TS will be mandatory in some future release of ircd-hybrid 2014-06-19 16:27:05 +02:00
Adam 9a947fa435 Correct some language strings 2014-06-17 08:37:19 -04:00
Adam 4f7868b125 Log more when unable to backup databases in db_flatfile 2014-06-15 04:50:26 -04:00
Adam 8066378471 Fix WindowsGetLanguage() 2014-06-10 22:00:26 -04:00
Adam ab27b792b0 Track SVSKILL on unreal 2014-06-09 17:18:21 -04:00
Adam f1c3bdd55e Correct wording of log message when ldap services are created 2014-06-09 17:16:55 -04:00
Adam 08edb15bea Fix help log output example 2014-06-09 16:44:15 -04:00
Adam 56c6ef4449 Fix information leak in cs_updown 2014-06-09 16:36:49 -04:00
Adam 6526d2d8b3 Fix Windows release build with gettext 2014-06-01 13:53:32 -04:00
Adam 76ab5c2c38 Update WIN32.txt reflecting new Windows stuff 2014-05-31 23:54:50 -04:00
Adam 54e98f017c Always log when the uplink socket errors, and give possibly helpful advise 2014-05-31 21:17:46 -04:00
Adam bb7706d0f7 Anope 2.0.2-git 2014-05-31 19:09:23 -04:00
Adam 16e0b72d2d Update FindGettext.cmake for new Windows stuff and fix language.cpp
compile
2014-05-31 18:30:50 -04:00
Adam b578e32531 Anope 2.0.1 Release 2014-05-30 20:57:32 -04:00
Adam 4d8e3b847d Fix f627a3bacd, really make BotInfo::Part fire events like the normal user part message does 2014-05-30 20:57:23 -04:00
Adam eaade23f9b Update language files 2014-05-30 18:14:55 -04:00
Adam f20bac996d Fix Windows build and update library names to the newer ones.
Also fix crash on Windows when unloading a module because it threw an
exception.
2014-05-30 18:14:55 -04:00
Adam 93bfd4cbe1 Updates Changes and Changes.conf 2014-05-30 16:16:54 -04:00
Adam 6620f9e9bd Don't allow setting -y on inspircd, secureops etc will try to enforce this 2014-05-30 15:16:03 -04:00
Adam dc64cfc940 Remove version.log 2014-05-30 15:16:03 -04:00
Adam f8829783d2 Queue the grouped nicks to update when NickCore::SetDisplay is called, since they serialize the display field 2014-05-30 15:16:03 -04:00
Adam d6e600f74b Fix access check in ns_group 2014-05-30 15:16:03 -04:00
Adam 5f7113bc0e Merge pull request #80 from attilamolnar/2.0+exampleconf
Fix the name of the SSL modules in comments in modules.conf.example
2014-05-30 15:15:43 -04:00
Robby- dc4daa25a7 example.chk: Use a more reliable way to detect if services are running. 2014-05-30 18:27:15 +02:00
Robby- 0cadaedfbe Update the dutch language file. 2014-05-30 18:24:42 +02:00
Attila Molnar 11ad788dfd Fix the name of the SSL modules in comments in modules.conf.example 2014-05-30 18:12:26 +02:00
Adam 38a60d9142 Merge pull request #78 from H7-25/it_IT
Updated italian lnguage file
2014-05-28 13:48:19 -04:00
Adam e8ad509aa5 Fix dlerror() on Windows and do not abort if err is not set 2014-05-27 12:55:03 -04:00
Adam 37b3ed8ef3 Do not normalize extban masks 2014-05-27 12:55:03 -04:00
Adam a6af422184 Set timer owner for nickserv timers 2014-05-27 12:55:03 -04:00
Adam 53acb73193 Fix default db name in db_flatfifle in a couple places 2014-05-27 12:55:03 -04:00
H7-25 57f6d4f49c Updated italian language 2014-05-22 21:24:38 +02:00
Adam d0467adea2 Merge pull request #79 from Jyzee/langFR-Patch
Make command group descriptions translatable.
2014-05-22 13:21:46 -04:00
Jyzee 16924f68c0 Update french language file. 2014-05-22 19:05:25 +02:00
Jyzee d280c48e6b Regenerate french language file. 2014-05-22 19:04:26 +02:00
Jyzee f0c0daa644 Make command group descriptions translatable. 2014-05-22 19:00:56 +02:00
Adam 7a2d027e1d Fix deflanguage from 4034b3054a, this shouldn't have been removed 2014-05-21 10:47:50 -04:00
Adam f627a3bacd Core prep for p10 stuff 2014-05-21 08:50:40 -04:00
Adam 5a1257b7f0 Fix extra space in log messages with logtype channel and no source 2014-05-21 08:40:54 -04:00
Adam 866f3f32ab Speed up akill xline checks
Cache xline nick, user, host, etc instead of rebuilding it everytime its
requested. Store users ip in sockaddr form and not string form to
prevent having to rebuild sockaddrs when checking xlines.

Also do not try to convert empty config values in Config::Get as this
can be rather common if a non string configuration value is not set, and
the cost of the ConvertException is great.
2014-05-20 21:16:00 -04:00
Adam 20ce170024 Show account names in log messages 2014-05-20 12:19:26 -04:00
Adam 4034b3054a Add English language file which users can edit to modify language strings 2014-05-20 11:41:05 -04:00
Adam e581158645 Fix two compile warnings in access.cpp on newer compiles 2014-05-20 10:00:34 -04:00
Adam 01021131ca Also search channel descriptions and topics in /cs list 2014-05-20 09:52:26 -04:00
Adam 13ea98a02e Fix server usercounter not being incremented when servers are bursting 2014-05-19 22:46:28 -04:00
Adam db56a61f86 Fixup previous commit when serializing access entries 2014-05-19 22:45:45 -04:00
Adam df321a118e Fix access lists showing the wrong mask if the display nick for a group
expires but the group still exists. This can cause access entries for
nicks to not be deleted whenever the nicks are deleted.
2014-05-14 19:10:23 -04:00
Adam 1931fcf0e5 Fix webpanel mode list to only show real list modes 2014-05-13 22:59:41 -04:00
Adam 63b02b8c97 Sanitize nuh masks more to prevent the other side from rewriting them, which screws with our internal tracking of them 2014-05-13 22:57:53 -04:00
Adam 1c8a77ab9f Accept an optional reason for svspart 2014-05-13 19:52:05 -04:00
Adam 0c7d53f81e Don't show both online from's if they have the same mask in ns_info 2014-05-13 18:38:14 -04:00
Adam bcc3ae5742 Merge pull request #76 from miwob/master
Update ircd-hybrid protocol module
2014-05-13 17:50:07 -04:00
Adam 4e67e0897a Merge pull request #77 from Cronus89/patch-2
Update Paramater length for os_dns to fix DNS SET
2014-05-13 17:47:33 -04:00
Michael Wobst 76a9538441 Fix compile warning in base64.cpp:B64Encode
/home/ircd/anope/src/base64.cpp: In function ‘void Anope::B64Encode(const Anope::string&, Anope::string&)’:
/home/ircd/anope/src/base64.cpp:85: warning: ‘input’ is used uninitialized in this function
2014-05-13 18:28:53 +02:00
Cronus89 91c7862579 Update Paramater length for os_dns to fix DNS SET 2014-05-13 11:12:00 -05:00
Michael Wobst 6b6bc81999 Update ircd-hybrid protocol module 2014-05-13 18:00:10 +02:00
Adam 1f2c385bb9 Add config options to ns_suspend and cs_suspend to configure which information is shown to non opers 2014-05-01 21:03:32 -04:00
Adam d79dd0b7d7 Pass password to nick register event so modules like m_ldap_authentication can create the respective account using the decrypted password which might not always be available 2014-05-01 18:38:17 -04:00
Adam 8b2e8137f6 Merge pull request #75 from attilamolnar/2.0+inspircd-globops
InspIRCd 2.0: Recognize GLOBOPS in CAPAB CAPABILITIES
2014-05-01 18:19:23 -04:00
Adam 732466d8f4 Merge pull request #74 from attilamolnar/2.0+fix-os-stats
Fix undefined symbol error when loading os_stats, caused by 82008d50
2014-05-01 18:19:01 -04:00
Attila Molnar 3049916ade Fix undefined symbol error when loading os_stats, caused by 82008d507c 2014-04-30 01:15:10 +02:00
Attila Molnar 0afd666f22 InspIRCd 2.0: Recognize GLOBOPS in CAPAB CAPABILITIES 2014-04-29 22:55:10 +02:00
Adam 8021a53ac4 Fix misc help output to not be case sensitive 2014-04-26 18:30:54 -04:00
Adam 0663f5e412 Fire the on user quit event when bots are deleted too 2014-04-26 17:45:16 -04:00
Adam 2ee496b8ac Change the "does not expire" string in ns_group to NO_EXPIRE which is translatable 2014-04-26 17:30:58 -04:00
Adam 3abb18721b Accept non server sources for SQUIT 2014-04-26 17:21:33 -04:00
Adam 4eb0a3bdb7 Fix ModeManager::RebuildStatusModes, not all modes are in GetChannelModes() at the time this is called 2014-04-26 15:24:19 -04:00
Adam 6a03eb69eb Add "virtual mode" support
This allows fully tracking extbans and other modes set by a different
underlying mode, such as InspIRCd's namedmodes

Add two configuration options to cs_ban to configure which mode is set
and whether or not to kick banned users.

Add default "mute" fantasy command to botserv.example.conf
2014-04-25 16:51:06 -04:00
Adam 4fa2a00bd5 Close timed out proxyscan sockets better 2014-04-25 16:47:10 -04:00
Adam 82008d507c Fix Stas::Unserialize to return the instance 2014-04-25 16:46:37 -04:00
Adam 2ab4f175a8 Don't allow users to join channels they are already in 2014-04-25 16:20:23 -04:00
Adam c9473bcc67 Fix botserv/kick/bolds desc 2014-04-24 17:10:06 -04:00
Adam 75ed5a9b59 Fix os_stats counters not saving with db_sql_live. Bleh. 2014-04-24 01:50:50 -04:00
Adam f010ab7dbf Resend ircd login name on /ns set display 2014-04-24 01:40:56 -04:00
Adam 00b2cc9ce6 Require at least user@host format for akills. Fix XLine::GetHost() not returning anything if an xline only has a host 2014-04-24 01:38:45 -04:00
Adam d52cc7bcbc Bug #1587 - fix bot change not properly reintroducing clients 2014-04-24 01:25:25 -04:00
Adam 63838fa77d Merge pull request #72 from attilamolnar/2.0+svsnickfix
Fix SVSNICK target being a nick even when UIDs are available
2014-04-20 02:03:03 -04:00
Attila Molnar e36f8143e3 Fix SVSNICK target being a nick even when UIDs are available 2014-04-19 14:35:50 +02:00
Adam 72b26043b2 Remove unused event.
Mark some oper only usermodes as oper only.
Fix reading SID in TS6_SID_Retrieve
2014-04-18 02:21:06 -04:00
Adam f369157906 Use OnChanRegistered instead of OnCreateChan to set default mlocks.
Because OnCreateChan is called from ChannelInfo's constructor, during
DB loading it could cause mode locks to be unserialized without having
all channels loaded, which breaks things.
2014-04-17 16:58:04 -04:00
Adam ba46b8e4ab Merge pull request #70 from Jyzee/langFR-Patch
Update French language file.
2014-04-09 02:26:24 -04:00
Jyzee 254901aace Update French language file. 2014-04-09 07:49:14 +02:00
Adam c1c45a5db9 Do not clear all extension items tied to objects when unserializing.
Instead, pass the old object to the unserialization functions and let
them incrementally update the object.
2014-04-07 15:28:07 -04:00
Adam a65e95837f Document that memo_mail can be in nickserv defaults. These should move to memoserv.conf one day. 2014-04-06 23:13:46 -04:00
Adam 43219d3906 Do not apply module changes on rehash until after the new config has been applied. Fix renaming opertypes on reload. 2014-04-06 23:01:10 -04:00
Adam 1f8dec4c24 Fix /os mode to not require a mode when setting param modes which taken no argument when setting 2014-04-06 18:09:36 -04:00
Adam fb5c5e3442 Set minus no arg on +l in all proto mods
Set oper modes/vhost on oper too, evan after iding
Add umode +q to plexus
2014-04-02 22:37:35 -04:00
Adam e357c39774 Add travis config 2014-04-01 23:34:02 -04:00
Adam 10732baec2 Fix compile error in cs_set_misc with C++11 enabled 2014-03-31 22:41:02 -04:00
Zantox 068c6989de Small Grammar Fix 2014-03-31 20:19:03 -04:00
Adam 317d55f3f1 Fix ns_set password to read the correct parameter.
Even though 1 is past the "end" of the vector, because vectors never
shrink and due to how the command parser works, it is always less than
the capacity, and almost always contains what is in params[0] (though
this is of course implementation dependant), which is why this was not
identified sooner, as it executes cleanly under valgrind on every machine I can find.
2014-03-31 20:11:36 -04:00
Adam 1397fda786 Bump to Anope 2.0.1-git 2014-03-31 20:10:51 -04:00
Adam 4ccc478830 Anope 2.0.0 Release 2014-03-23 08:58:02 -04:00
Adam 100ecbb9be Update version.log 2014-03-23 08:57:19 -04:00
Adam cdf636e696 Regen langauge files 2014-03-23 08:57:08 -04:00
Robby- 45878bf182 SASL: Also disallow suspended nicks to login using EXTERNAL mechanism. Improve the log message for failed logins. 2014-03-22 21:14:02 +01:00
Adam f1bec3999d Do not allow SASL login to suspended nicks 2014-03-22 07:21:22 -04:00
Adam a259244297 Make bouncymodes harder to trigger by only bumping server modcount when something changes 2014-03-20 10:53:27 -04:00
Adam c1da009de3 Show a better log message when disconnecting from the uplink 2014-03-19 02:40:48 -04:00
Robby- 4f412bc213 cs_set_misc: Add missing override capability for services operators, and logging. 2014-03-19 03:05:54 +01:00
Robby- 1882916dc4 Update the dutch language file. 2014-03-17 01:15:28 +01:00
Robby- f436ce9912 m_ssl_gnutls: Fix deprecation warnings when using newer GnuTLS versions. 2014-03-17 00:58:51 +01:00
Adam ef9729fb02 Mark all channels as syncing when we connect to our uplink. They will
finish syncing later when the uplink syncs. Normally the channel state
is fully synced here anyway, except if we do not know the modes the
uplink has yet.

Also fix a related issue with resetting chanels and bouncing modes on
our clients, if this is done prior to knowing which modes exist it would
silently fail.
2014-03-14 22:13:04 -04:00
Adam 296a75f2a9 Do not allow users to add certs that other users are using. Only allow adding certfps if the user is using it. 2014-03-13 20:07:50 -04:00
Adam bce7237d9f Set LDAP_OPT_NETWORK_TIMEOUT to 0 in m_ldap to prevent the asynchronous
library cals from blocking...

Fix multiple possible null pointer derefs if modules pass null
interfaces (none currently do, but it is allowed)

Fix memory leak from results when services are destructed

Timeout queries that never come back.
2014-03-11 09:45:34 -04:00
Robby- 85834e19dc Update the dutch language file.
ns_maxemail: Bold code 2 -> 002.
2014-03-10 22:30:41 +01:00
Adam ca6b3723a9 Merge pull request #64 from ShutterQuick/2.0+hsgroupsync
2.0+hsgroupsync
2014-03-10 07:32:24 -04:00
Adam 23b1086072 Merge pull request #63 from alexbarton/ngircd-fix-KILL
ngircd protocol module: really kill users
2014-03-10 07:31:34 -04:00
Adam 860deb14ce Do not send unregistered notice to users who are logged in, even if their nick isn't registered 2014-03-10 07:26:09 -04:00
Adam 62885fa462 Set nickserv's modesonid on login too 2014-03-10 05:04:25 -04:00
Adam 3fef01e35b Fix compile error in m_sasl_dh-aes and m_sasl_dh-blowfish on unusually old g++ versions 2014-03-10 04:56:17 -04:00
Adam b0597e35ec Do not allow nickserv/ungroup to bypass ns_maxemail, and allow opers to bypass ns_maxemail 2014-03-10 04:31:08 -04:00
Adam 8d1ad6fbe5 Make nickserv/glist show the correct expire time for unconfirmed nicks 2014-03-09 22:59:16 -04:00
Adam 750569201a Add missing space to session exception expiration message 2014-03-09 22:56:25 -04:00
Adam 1a1a781b72 Remove mail:restrict as it is no longer useful. Changes nickserv/resetpass default to allow normal users to use it. 2014-03-09 10:07:13 -04:00
DukePyrolator 4b5ce8a972 irc2sql: removed the currentusers field from the chan table, keeping it updated on each join/part eats too many ressources 2014-03-09 04:55:35 +01:00
Daniel Vassdal 98cfdd26c4 ns_group: Don't require a nick param when logged in 2014-03-06 04:55:30 -08:00
Daniel Vassdal 051a42b547 hs_group: Allow automatic HS GROUP-ing on NS GROUP, and allow vhosts to be per account rather than nick. 2014-03-06 04:55:30 -08:00
Adam 220e278213 Open database files using std::ios_base::binary in db_flatfile, which Windows can require 2014-03-05 20:23:44 -05:00
Alexander Barton 547fe0da1a ngircd protocol module: really kill users
ngIRCd doesn't send a QUIT for each user KILL'ed, so kill them immediately.
2014-03-05 10:26:54 +01:00
Adam 09bec79b47 Fix 2 crashes from removing the permanent channel mode from channels which do not exist 2014-03-04 04:15:32 -05:00
Adam 55a5affcb8 Do not allow guest nicks to exceed nicklen, and use a default enforcer ident/host if none is provided 2014-03-04 04:15:32 -05:00
Robby- a8b4297023 Update the dutch language file. 2014-03-03 19:20:56 +01:00
Adam 5969362425 When unserializing channels with persist, set their ts=now. If we are supposed to lower it later we will then. 2014-03-01 22:41:45 -05:00
Adam 3ceae33b16 Convert limit and key mlocks in db_old 2014-03-01 21:56:26 -05:00
Adam 5de4c1fc97 Set +x on plexus when vhosts are activated, fix desync from /hs off 2014-03-01 21:40:47 -05:00
Adam fd109048dd Make db_old load entrymsg 2014-03-01 21:20:32 -05:00
Adam a0747516ce Export interface for cs_entrymsg 2014-03-01 21:20:18 -05:00
Adam 605e1f2a03 Make chanserv/invite show who invited you 2014-03-01 21:12:27 -05:00
Adam dc23c58869 Fix botserv help to show the correct fantasy characters 2014-03-01 21:11:58 -05:00
Adam b7e646ec83 Allow opers with chanserv/administration to use fantasy, even if they don't have the access for it 2014-03-01 20:02:17 -05:00
Adam 4d54358745 When unserializating channels and persist is set, only assign chanserv if the perm channel mode doesnt exist 2014-03-01 19:59:40 -05:00
Adam ed0882ec04 Do not enforce mlock when enforcing mlock 2014-03-01 18:39:10 -05:00
Adam 526c4e4659 Check modes after applying mlocks in db_old 2014-03-01 18:38:14 -05:00
Adam b70f72bf2b Do not allow changing the email of unconfirmed accounts 2014-03-01 04:31:52 -05:00
Adam 2ad4c1906e Fix incorrect comment in modules.example.conf 2014-03-01 04:27:45 -05:00
Adam 049760cc7e Allow svsjoin/svspart on yourself 2014-02-28 00:30:35 -05:00
Adam e2ecec31b5 Hybrid does not let us add resvs as a server, but the core expects to be able to qline bot nicks before introducing the bots as a way to prevent collisions, so try harder to find a valid bot to send resvs on startup 2014-02-27 23:21:50 -05:00
Adam fee016bb84 Handle nick collisions somewhat instead of blindly overwriting the nicks
in memory, which does weird things.

For fun different ircds implement this differently (Unreal compares
timestamps, TS6 compares timestamps and user username/host), and whether
or not we get a kill for our user also varies, so just kill everyone.

This can't really happen anyway with properly set qlines, only if
services haven't yet set the qlines, or possibly in a bot add/nick
user introduce race, or with enforcers, which not many ircds require.
2014-02-27 22:42:54 -05:00
Adam d24fb03917 Allow registration=mail forceemail=false to work, and simply give fully registered accounts to people who do not provide an email to nickserv/register 2014-02-27 04:49:28 -05:00
Adam 5adc8bfefc Do not take modes from users in channels with secureops off if we are always lowering channels timestamps to their creations 2014-02-27 04:48:48 -05:00
Adam abcf0cde5a Remove unreachable code in config.cpp, this error is caught earlier 2014-02-26 19:32:25 -05:00
Adam 8f3bd314ed Fix not detecting eols in the config reader when the end of the line is the end of a multiline comment 2014-02-26 19:26:50 -05:00
Adam e2d456d4ce Do not setuid/gid down until after modules are loaded 2014-02-26 19:24:32 -05:00
Adam 96202ae545 Log successful SASL auths 2014-02-24 22:23:12 -05:00
H7-25 2b0229d4e2 Update the italian language file 2014-02-25 03:22:55 +01:00
Adam beaa3196b3 Update Spanish translation, from Isaac Fontal <i_fontal@hotmail.com> 2014-02-24 16:14:40 -05:00
Adam b6d771a114 Anope 2.0.0-rc4 Release 2014-02-24 00:31:07 -05:00
Adam d3ed756bd0 Update version.log (why do we keep this around?) 2014-02-24 00:30:57 -05:00
Adam f8308841a6 Package dlls in src/win32 on Windows 2014-02-24 00:30:47 -05:00
Adam 1dfdf36fc3 Fix m_ssl_gnutls to send its cert. Most of this is from Attila. 2014-02-24 00:06:38 -05:00
Adam 4ac3ade126 Use a more reliable way to detect if services are running in anoperc 2014-02-23 23:08:35 -05:00
Robby- 212abeb986 webcpanel: Update copyright year.
ns_cert: Bold code 2 -> 002.
2014-02-23 23:42:43 +01:00
Robby- 7d4427c313 Regenerated language files. 2014-02-23 05:24:06 +01:00
Adam e836be489e Store a cert->account map and use it for SASL EXTERNAL and certfp auth 2014-02-22 17:46:00 -05:00
Adam 1db5c555d6 Merge pull request #58 from attilamolnar/2.0+gnutlsdep
[WIP] Make m_ssl_gnutls work with at least GnuTLS v2.8
2014-02-22 13:46:36 -05:00
Attila Molnar bb1b015103 Make m_ssl_gnutls work with at least GnuTLS v2.8 2014-02-22 16:59:10 +01:00
Robby- e42684ac39 Update italian translation, from Simos. 2014-02-22 16:40:56 +01:00
H7-25 d7de7eee60 Italian language completed translation, first release 2014-02-22 15:58:36 +01:00
Robby- 0a390ad392 Regenerated language files, and updated dutch language file. 2014-02-22 15:56:34 +01:00
Adam aa6b12c5eb Fix Windows build 2014-02-21 21:54:01 -05:00
Adam e2bd08fbff Add some missing serial updates in os_dns 2014-02-21 20:50:23 -05:00
Adam 2047934060 Regenerate Italian language file 2014-02-21 19:57:31 -05:00
Adam e07dcbff08 Update italian translation, from Simos 2014-02-21 19:57:31 -05:00
Adam e3a8a45a61 Merge pull request #56 from ShutterQuick/2.0+noxcrypt
enc_bcrypt.cpp: Get rid of the libxcrypt dependency by including code fr...
2014-02-21 19:49:29 -05:00
Lee Holmes f1ad7fd582 fix comment, activate not active 2014-02-21 20:41:41 +00:00
lethality 43f2645b32 update help info 2014-02-20 20:07:38 +00:00
Daniel Vassdal b6935e706c enc_bcrypt.cpp: Get rid of the libxcrypt dependency by including code from libxcrypt, and move enc_bcrypt out of extras 2014-02-20 11:42:20 -08:00
lethality a3c845894d Updated services crontab location 2014-02-20 17:11:11 +00:00
lethality 5933a5e9b1 Merge remote branch 'upstream/2.0' into 2.0 2014-02-18 22:24:24 +00:00
Adam 109d8f431f Do not import forbids with wildcards in their names, how 1.8 treats wildcaded forbids depends on the IRCd 2014-02-18 13:04:16 -05:00
Adam 1edb7e776b Merge pull request #54 from attilamolnar/2.0+webcpanelfix
Don't create zero length DataBlocks in BinarySocket::Write()
2014-02-18 12:59:37 -05:00
Adam 928e2e1b7c Fix loading noexpire channels in db_old 2014-02-18 12:57:31 -05:00
Adam 5a140e4898 Merge pull request #55 from attilamolnar/2.0+alphabet
Alphabetically order modules in modules.example.conf
2014-02-18 12:54:22 -05:00
Attila Molnar f64393941e Alphabetically order modules in modules.example.conf ('r' < 's' and 'w' < 'x') 2014-02-18 13:00:46 +01:00
Adam 0db81ca46a Merge pull request #52 from attilamolnar/2.0+gnutls
Add support for SSL connections powered by GnuTLS
2014-02-17 22:21:08 -05:00
Adam 7f7144de1f Merge pull request #53 from attilamolnar/2.0+reuseaddrfix
Fix setsockopt() with SO_REUSEADDR not working due to wrong argument type
2014-02-17 22:20:38 -05:00
Attila Molnar 3883716883 Turn BinarySocket::Write() into a no-op when called with l == 0 2014-02-18 03:28:02 +01:00
Attila Molnar 5beea4eb7e Fix TemplateFileServer writing empty messages resulting in zero length DataBlocks being created and later passed to SocketIO::Send()
Found while testing m_ssl_gnutls, fix suggested by @Adam-
2014-02-18 03:27:12 +01:00
Attila Molnar 2d0fdb74d1 Fix setsockopt() with SO_REUSEADDR not working due to wrong argument type 2014-02-18 02:31:01 +01:00
Adam 80588fba81 Fix os_ignore to work correctly with SQL 2014-02-17 19:43:19 -05:00
Adam ef7dc94f88 Move most of the implementation details out of os_forbid.h, fixes crashing if a module adding a forbid is unloaded without removing the forbid 2014-02-17 19:39:25 -05:00
Adam 7b4eec9748 Remove docs/IRCD, it is very outdated and no longer correct at all 2014-02-17 13:53:45 -05:00
Adam baff417652 Move encryption.h to include/modules 2014-02-17 13:53:04 -05:00
Adam 7074944810 Fix not applying ipv[46]_cidr to connecting clients in os_session, #1573 2014-02-17 13:39:49 -05:00
Attila Molnar 1c39d25cca Add m_ssl_gnutls 2014-02-17 01:12:01 +01:00
lethality f1c5c27f3f Merge branch '2.0', remote branch 'upstream/2.0' into 2.0 2014-02-16 23:49:57 +00:00
Attila Molnar 9c0134ee2c Rename m_ssl to m_ssl_openssl and update docs 2014-02-17 00:41:36 +01:00
Adam 959fee5937 Fix Windows build 2014-02-16 18:28:39 -05:00
Adam 3854a5570f Merge pull request #51 from ShutterQuick/2.0+oldforbid
db_old.cpp: Correctly import forbidden nicks and chans
2014-02-16 16:07:36 -05:00
Daniel Vassdal ab1e0ebfb3 db_old.cpp: Correctly import forbidden nicks and chans 2014-02-16 12:56:27 -08:00
Adam cffe864900 Merge pull request #50 from ShutterQuick/bcrypt
Add enc_bcrypt
2014-02-16 14:10:25 -05:00
Daniel Vassdal bc1575318b modules.example.conf: Update examples for bcrypt - also clearify that m_sasl_dh* requires openssl 2014-02-16 11:07:37 -08:00
Daniel Vassdal a71d0f6757 enc_bcrypt: Add module 2014-02-16 11:07:36 -08:00
Adam 50d7bf710e Merge pull request #48 from ShutterQuick/2.0+nnghsasl
Add SASL mechanisms DH-AES and DH-BLOWFISH
2014-02-14 19:15:43 -05:00
Daniel Vassdal d44bcef31b modules.example.conf: Add info about m_sasl_dh-aes and m_sasl_dh-blowfish 2014-02-14 16:06:24 -08:00
Daniel Vassdal c0ce71e55a m_sasl_dh-blowfish: Add module 2014-02-14 15:12:25 -08:00
Daniel Vassdal 0eeb0caf08 m_sasl_dh-aes: Add module 2014-02-14 15:12:25 -08:00
Daniel Vassdal b13bded620 sasl.h, m_sasl.cpp: Move IdentifyRequest to the header 2014-02-14 15:03:42 -08:00
Daniel Vassdal 1b1180fda6 base64.cpp: B64Decode(): Don't crash on "=" 2014-02-14 13:42:21 -08:00
Daniel Vassdal a4ecfa5bc0 Anope::string: Add .data() 2014-02-14 13:05:01 -08:00
Daniel Vassdal 3c8009b495 sasl.h, m_sasl.cpp: Add RemoveSession(), DeleteSessions(), and have active sessions closed when a Mechanism is unloaded 2014-02-14 13:05:01 -08:00
Adam ca85df2d74 Don't convert XOP access entries to levels in db_old 2014-02-14 11:10:20 -05:00
Adam 5dfa6598c2 Do not sync channels in Channel::Reset if they are in the middle of syncing, and checkmodes in Channel::Sync. Fixes channel modes sometimes not being set if always_lower_ts is on 2014-02-14 11:09:53 -05:00
Adam f428d61045 Use better command access checking in webpanel for operserv/akill 2014-02-13 19:42:02 -05:00
Adam fc50edf046 Disable m_sasl by default 2014-02-12 14:49:22 -05:00
Adam 269c2786e9 Add SASL EXTERNAL support. Thanks to ShutterQuick for fixing and testing. 2014-02-12 14:39:41 -05:00
Adam 96fc940af7 Only trim newlines and carriage returns in BufferedSocket::GetLine 2014-02-11 19:25:44 -05:00
Adam 8c8e6d464a Make initial registration notices with mail less repetitive 2014-02-11 18:08:09 -05:00
Adam 22976b8a7c Fix flags +* or -* sometimes incorrectly reporting opers as overriding when they are not 2014-02-11 17:33:28 -05:00
Robby- 4dff710361 ns_suspend: Show the setter of the suspension and the reason when manually unsuspending. 2014-02-11 03:57:15 +01:00
Robby- fe80d2cded os_modinfo: Add ability to list only extra modules. 2014-02-11 02:26:00 +01:00
Adam 16dac87841 Regenerate anope.it_IT.po 2014-02-10 10:03:38 -05:00
H7-25 30c59562e0 Update Italian language translation 2014-02-10 09:57:24 -05:00
Adam 6d61a84286 Add an opertype priv "protected" to not allow services to kick a user.
Also classify ulines as protected
2014-02-09 18:51:52 -05:00
Adam f6b8596c7b Log memoserv/sendall 2014-02-09 10:59:36 -05:00
Adam da6760f606 Properly convert suspended nicks and channels in db_old 2014-02-07 13:28:07 -05:00
Adam ad962ad759 Allow other modules to suspend nicknames and channels without having to subclass suspendinfo 2014-02-07 13:12:57 -05:00
Adam 5327becf41 Allow other modules to be able to view and modify cs and ns set_misc data 2014-02-07 13:02:20 -05:00
Adam f43c99c5cc Merge pull request #46 from ShutterQuick/patch-1
Update cs_updown.cpp
2014-02-07 12:12:52 -05:00
ShutterQuick c0a491cb06 Update cs_updown.cpp
cs_updown: Make CS DOWN remove all modes, not just one
2014-02-07 18:04:16 +01:00
Adam 66cc965fd7 Ignore nonblocking errnors on socket operations 2014-02-05 15:26:03 -05:00
Adam 2440514a7b Document a little more accurrately the privilege stuff and document why the access lists behave as they do 2014-02-05 08:46:56 -05:00
Adam fad1da81a3 Process mode changes in ns_ajoin before joining users, fixes not being able to ajoin users to +R channels on Unreal 2014-02-05 08:46:56 -05:00
Adam bb0e2a9a07 Make it easier to use fantasy without botserv, and document it 2014-02-05 08:46:51 -05:00
Adam 4f8c4f8fef Actually just allow mode clear to take any mode name 2014-02-03 10:05:13 -05:00
Adam 25957111b2 Fix typo in mode clear, exempts -> excepts 2014-02-03 08:41:27 -05:00
Adam 9a8895359a Apply the last commit to cs_list 2014-02-02 03:21:02 -05:00
Adam 53f8db0198 Merge pull request #44 from ShutterQuick/2.0+listfix
ns_list: Fix typo (NS_SUSPENDED -> SUSPENDED)
2014-02-01 11:42:08 -08:00
Daniel Vassdal f94cb7fb11 ns_list: Fix typo (NS_SUSPENDED -> SUSPENDED) 2014-02-01 11:24:52 -08:00
Adam c30fb13a0c Merge pull request #43 from ShutterQuick/2.0+ajoinfix
2.0+ajoinfix
2014-02-01 11:12:39 -08:00
Daniel Vassdal 7926238fd2 Improve IsChannelValid() 2014-02-01 10:55:12 -08:00
Daniel Vassdal 211a944210 ns_ajoin: Treat ',' as a separator. 2014-02-01 10:35:10 -08:00
Daniel Vassdal cff61617e1 commasepstream: Add a allowempty param 2014-02-01 10:31:17 -08:00
Adam 4455d4346c Merge pull request #42 from ShutterQuick/2.0+saslfix
Have SASL login in on the account name instead of nick alias
2014-01-31 02:43:26 -08:00
Daniel Vassdal 405b41ec87 protocol/(inspircd12/unreal/charybdis): Have SASL login in on the account name instead of nick alias 2014-01-31 01:41:27 -08:00
Adam bacb276181 Use TBURST on hybrid to set topics 2014-01-28 14:45:21 -05:00
Adam 4c1f6b48d8 Merge pull request #40 from attilamolnar/2.0+csclonefix
Fix cs_clone allowing users to clone a channel to itself
2014-01-26 16:08:23 -08:00
Attila Molnar 53a78c2688 Fix cs_clone allowing users to clone a channel to itself 2014-01-26 20:06:36 +01:00
Robby- e61a283c02 Update language files. 2014-01-26 16:33:28 +01:00
Adam c3302194eb Anope 2.0.0-rc3 Release 2014-01-26 01:18:38 -05:00
Adam cd184596a2 Only have extras rerun config if it was successfully run before. Config can create the build directory even if cmake isn't found. 2014-01-26 01:17:58 -05:00
Adam f28b1142f5 Correct error message in gl_global to reference the right module 2014-01-26 01:15:19 -05:00
Adam 87230c17b7 Fix extra space in the unknown command error message 2014-01-26 01:14:58 -05:00
Adam a29b7897f0 Use the SQLine reason in the kick reason for sqlined channels 2014-01-26 01:14:28 -05:00
Adam e965bc3049 Revert "Rename db_old hash plain -> none which is what 1.8 calls it"
This reverts commit 9a9ca41750.
2014-01-26 01:03:43 -05:00
Adam 01780c9e7a Fix setname handler on unreal 2014-01-25 17:58:20 -05:00
235 changed files with 31479 additions and 21490 deletions
+16
View File
@@ -0,0 +1,16 @@
language: cpp
compiler:
- gcc
before_script:
- mkdir build
- cd build
- cmake -DINSTDIR:STRING=~/services -DDEFUMASK:STRING=077 -DCMAKE_BUILD_TYPE:STRING=DEBUG -DUSE_RUN_CC_PL:BOOLEAN=ON ..
script:
- make
notifications:
irc:
- "irc.anope.org#anope-devel"
+20 -12
View File
@@ -2,6 +2,12 @@
cmake_minimum_required(VERSION 2.4 FATAL_ERROR)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
if(POLICY CMP0026)
cmake_policy(SET CMP0026 OLD)
endif(POLICY CMP0026)
if(POLICY CMP0007)
cmake_policy(SET CMP0007 OLD)
endif(POLICY CMP0007)
endif(COMMAND cmake_policy)
# If the Source dir and the Binary dir are the same, we are building in-source, which we will disallow due to Autotools being there (but only on non-Windows)
@@ -80,7 +86,7 @@ set(DEFAULT_LIBRARY_DIRS)
set(DEFAULT_INCLUDE_DIRS)
# If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes
if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
# First look for the compiler's default library directories
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs OUTPUT_VARIABLE LINES OUTPUT_STRIP_TRAILING_WHITESPACE)
# Find only the part after "libraries: "
@@ -146,7 +152,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if(DEFAULT_INCLUDE_DIRS)
remove_list_duplicates(DEFAULT_INCLUDE_DIRS)
endif(DEFAULT_INCLUDE_DIRS)
endif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
endif(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
# If we are using Visual Studio, locate the path of the Windows Server 2008 SDK or Windows Server 2003 Platform SDK, depending on which is installed
if(MSVC)
@@ -408,16 +414,14 @@ endif(NOT LOGS_DIR)
read_from_file(${Anope_SOURCE_DIR}/src/version.sh "^VERSION_" VERSIONS)
# Iterate through the strings found
foreach(VERSION_STR ${VERSIONS})
# Get the length of the string
string(LENGTH ${VERSION_STR} VERSION_LEN)
# Subtract 16 from the string's length (8 for VERSION_, 5 more for the type, 2 for the space and leading quote, 1 for the trailing quote)
math(EXPR VERSION_NUM_LEN "${VERSION_LEN} - 16")
# Extract the type from the string
string(SUBSTRING ${VERSION_STR} 8 5 VERSION_TYPE)
# Extract the actual value from the string
string(SUBSTRING ${VERSION_STR} 15 ${VERSION_NUM_LEN} VERSION)
# Set the version type to the value extract from above
set(VERSION_${VERSION_TYPE} ${VERSION})
string(REGEX REPLACE "^VERSION_([A-Z]+)=\"?([^\"]*)\"?$" "\\1;\\2" VERSION_OUT ${VERSION_STR})
# Depends on CMP0007 OLD
list(LENGTH VERSION_OUT VERSION_LEN)
list(GET VERSION_OUT 0 VERSION_TYPE)
if(${VERSION_LEN} GREATER 1)
list(GET VERSION_OUT 1 VERSION_DATA)
set(VERSION_${VERSION_TYPE} ${VERSION_DATA})
endif(${VERSION_LEN} GREATER 1)
endforeach(VERSION_STR ${VERSIONS})
# Default build version to 0
@@ -497,6 +501,10 @@ if(WIN32)
install(FILES ${Anope_SOURCE_DIR}/src/win32/anope.bat
DESTINATION ${BIN_DIR}
)
# Package any DLLs in src/win/
file(GLOB EXTRA_DLLS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${Anope_SOURCE_DIR}/src/win32/*.dll")
install(FILES ${EXTRA_DLLS} DESTINATION ${BIN_DIR})
endif(WIN32)
install(CODE "file(REMOVE_RECURSE \"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/modules\")")
+3 -36
View File
@@ -176,42 +176,9 @@ done
which cmake > /dev/null
if [ $? -ne 0 ] ; then
clear
if exists "cmake-bin" ; then :
else
echo "Anope requires CMake 2.4 or newer, which can be downloaded at http://cmake.org"
echo "If you have installed CMake already, ensure it is in your PATH environment variable."
if [ `uname` = "Linux" ] ; then
echo ""
echo "Config can attempt to install CMake for you now, which"
echo "will take approximately 50 MB of disk space."
echo "Would you like to install CMake now?"
echo2 "[y] "
read YN
if [ "$YN" = "n" ] ; then
exit 0
fi
echo "Downloading CMake... this may take a minute or two."
wget -q http://anope.org/cmake/linux-i386.php -O cmake-bin.tar.gz
if [ $? -ne 0 ] ; then
rm -f cmake-bin.tar.gz
echo "Unable to download CMake"
exit 0
fi
mkdir -p cmake-bin
tar zxf cmake-bin.tar.gz -C cmake-bin
rm -f cmake-bin.tar.gz
echo "Done!"
else
exit 0
fi
fi
CMAKE_BIN=`find cmake-bin -name cmake`
CMAKE_BIN="`pwd`/`dirname $CMAKE_BIN`"
PATH="$PATH:$CMAKE_BIN"
echo "Anope requires CMake 2.4 or newer, which can be downloaded at http://cmake.org or through your system's package manager."
echo "If you have installed CMake already, ensure it is in your PATH environment variable."
exit 0
fi
###########################################################################
BIN
View File
Binary file not shown.
+6 -2
View File
@@ -432,11 +432,15 @@ macro(calculate_libraries SRC SRC_LDFLAGS EXTRA_DEPENDS)
# Reset libraries
set(LIBRARIES)
# Check to see if there are any lines matching: /* RequiredLibraries: [something] */
read_from_file(${SRC} "/\\\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES)
if(WIN32)
read_from_file(${SRC} "/\\\\*[ \t]*RequiredWindowsLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES)
else(WIN32)
read_from_file(${SRC} "/\\\\*[ \t]*RequiredLibraries:[ \t]*.*[ \t]*\\\\*/" REQUIRED_LIBRARIES)
endif(WIN32)
# Iterate through those lines
foreach(REQUIRED_LIBRARY ${REQUIRED_LIBRARIES})
# Strip off the /* RequiredLibraries: and */ from the line
string(REGEX REPLACE "/\\*[ \t]*RequiredLibraries:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
string(REGEX REPLACE "/\\*[ \t]*Required.*Libraries:[ \t]*([^ \t]*)[ \t]*\\*/" "\\1" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
# Replace all commas with semicolons
string(REGEX REPLACE "," ";" REQUIRED_LIBRARY ${REQUIRED_LIBRARY})
# Iterate through the libraries given
+6 -14
View File
@@ -2,33 +2,25 @@
if(NOT WIN32)
find_path(GETTEXT_INCLUDE libintl.h /usr/include /usr/local/include ${EXTRA_INCLUDE})
find_library(GETTEXT_LIBRARY intl PATHS /usr/lib /usr/lib64 ${EXTRA_LIBS})
find_library(ICONV_LIBRARY iconv PATHS /usr/lib /usr/lib64 ${EXTRA_LIBS})
find_program(GETTEXT_MSGFMT msgfmt PATHS /usr/bin/ /usr/local/bin ${EXTRA_INCLUDE})
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
set(GETTEXT_FOUND TRUE)
if(GETTEXT_LIBRARY)
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
endif(GETTEXT_LIBRARY)
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT)
else(NOT WIN32)
find_path(GETTEXT_INCLUDE libintl.h ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/include $ENV{VCINSTALLDIR}/include gettext/include ${EXTRA_INCLUDE})
find_library(GETTEXT_LIBRARY libintl PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
find_library(ICONV_LIBRARY libiconv PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
find_library(MINGWEX_LIBRARY libmingwex PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
find_library(GCC_LIBRARY libgcc PATHS ${DEFAULT_LIBRARY_DIRS} ${WSDK_PATH}/lib $ENV{VCINSTALLDIR}/lib gettext/lib ${EXTRA_LIBS})
find_program(GETTEXT_MSGFMT msgfmt PATHS ${DEFAULT_INCLUDE_DIRS} ${WSDK_PATH}/bin $ENV{VCINSTALLDIR}/bin gettext/bin ${EXTRA_INCLUDE})
if(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY)
if(GETTEXT_INCLUDE AND GETTEXT_LIBRARY AND GETTEXT_MSGFMT)
set(GETTEXT_FOUND TRUE)
endif(GETTEXT_INCLUDE AND GETTEXT_MSGFMT AND ICONV_LIBRARY AND MINGWEX_LIBRARY AND GCC_LIBRARY)
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY})
endif(GETTEXT_INCLUDE AND GETTEXT_LIBRARY AND GETTEXT_MSGFMT)
endif(NOT WIN32)
# If we found everything we need set variables correctly for lang/CMakeLists.txt to use
if(GETTEXT_FOUND)
include_directories("${GETTEXT_INCLUDE}")
set(GETTEXT_MSGFMT_EXECUTABLE ${GETTEXT_MSGFMT})
if(WIN32)
set(GETTEXT_LIBRARIES libiconv libintl libmingwex libgcc)
else(WIN32)
if(GETTEXT_LIBRARY)
set(GETTEXT_LIBRARIES ${GETTEXT_LIBRARY} ${ICONV_LIBRARY})
endif(GETTEXT_LIBRARY)
endif(WIN32)
endif(GETTEXT_FOUND)
+15 -2
View File
@@ -3,7 +3,17 @@
*/
/*
* First, create the service.
* First, create the service. If you do not want to have a 'BotServ', but do want the ability to have
* ChanServ assigned to channels for the use of fantasy commands, you may delete the below 'service' block.
*
* Note that deleting a 'service' block for a pseudoclient that is already online will not remove the
* client, the client becomes no different from a normal service bot, so you will have to use botserv/bot
* to manually delete the client.
*
* You may then want to map some of the below commands to other services, like placing botserv/bot on
* OperServ so you can delete the below client, and mapping assign and unassign to ChanServ so users are
* able to control whether or not ChanServ is in the channel. You may also want to map botserv/set/nobot
* to OperServ so you can restrict who can assign the other core service clients.
*/
service
{
@@ -62,6 +72,8 @@ module
/*
* The name of the client that should be BotServ.
*
* This directive is optional.
*/
client = "BotServ"
@@ -190,7 +202,7 @@ command { service = "BotServ"; name = "BADWORDS"; command = "botserv/badwords";
* Used for administrating BotServ bots.
*/
module { name = "bs_bot" }
command { service = "BotServ"; name = "BOT"; command = "botserv/bot"; }
command { service = "BotServ"; name = "BOT"; command = "botserv/bot"; permission = "botserv/bot"; }
/*
* bs_botlist
@@ -374,6 +386,7 @@ fantasy { name = "LEVELS"; command = "chanserv/levels"; }
fantasy { name = "LIST"; command = "chanserv/list"; prepend_channel = false; }
fantasy { name = "LOG"; command = "chanserv/log"; }
fantasy { name = "MODE"; command = "chanserv/mode"; }
fantasy { name = "MUTE"; command = "chanserv/ban"; kick = no; mode = "QUIET"; }
fantasy { name = "OP"; command = "chanserv/modes"; }
fantasy { name = "OWNER"; command = "chanserv/modes"; }
fantasy { name = "PROTECT"; command = "chanserv/modes"; }
+54 -13
View File
@@ -151,6 +151,13 @@ module
*/
reasonmax = 200
/*
* The message formatting to use for signed kick messages.
* %n is the nick of the kicker
* %m is the message specified
*/
signkickformat = "%m (%n)"
/*
* If set, prevents channel access entries from containing hostmasks.
*/
@@ -173,18 +180,18 @@ module
* ChanServ privilege configuration.
*
* ChanServ privileges are used to determine who has what access in channels. By default the core has its own
* set of levels it uses for various ChanServ commands, which are defined below. Privilege ranks are used to
* determine how powerful privileges are relative to each other, which is used by Anope to determine who has greater
* access in a channel.
* set of privileges it uses for various commands, which are defined below. Privilege ranks are used to
* determine how powerful privileges are relative to other privileges, which is used by Anope to determine
* who has greater access in a channel.
*
* If you loaded cs_access, you may define a level for the privilege, which is used by chanserv/access and chanserv/levels.
* If you load cs_access, you may define a level for the privilege, which is used by chanserv/access and chanserv/levels.
* The levels defined will be used as the default levels for newly registered channels.
* The level "founder" is a special level which means anyone with the privilege FOUNDER on the channel
* has that permission. Additionally, the level "disabled" means that no one can use the privilege, including founders.
*
* If you loaded cs_flags, you may define a flag associated with that privilege for use in chanserv/flags.
* If you load cs_flags, you may define a flag associated with that privilege for use in chanserv/flags.
*
* If you loaded cs_xop, you may define a xop command to associate the privilege with.
* If you load cs_xop, you may define a XOP command to associate the privilege with.
*
* The name of privileges are uesd to associate them with channel modes. If you are using an IRCd that allows you to define additional
* channel status modes, such as InspIRCd, you can associate privileges (and thus access levels, flags, xop) with the mode by naming
@@ -799,25 +806,25 @@ privilege
command_group
{
name = "chanserv/access"
description = "Used to manage the list of privileged users"
description = _("Used to manage the list of privileged users")
}
command_group
{
name = "chanserv/status"
description = "Used to modify the channel status of you or other users"
description = _("Used to modify the channel status of you or other users")
}
command_group
{
name = "chanserv/management"
description = "Used to manage channels"
description = _("Used to manage channels")
}
command_group
{
name = "chanserv/admin"
description = "Services Operator commands"
description = _("Services Operator commands")
}
/* Give it a help command. */
@@ -829,7 +836,12 @@ command { service = "ChanServ"; name = "HELP"; command = "generic/help"; }
* Provides commands chanserv/access and chanserv/levels.
* Provides the access system "levels".
*
* Used for giving users access in channels.
* Used for giving users access in channels using a levels system. Allows allows redefining which privileges
* are representated by given level on a per channel basis.
*
* The "LIST" subcommand of chanserv/access will show every access entry on the channel, including access
* entries not added by cs_access. The "level" of these entries will be the representation of the access
* entry by the other access system, which could be an XOP command name, or a set of flags.
*/
module { name = "cs_access" }
command { service = "ChanServ"; name = "ACCESS"; command = "chanserv/access"; group = "chanserv/access"; }
@@ -863,6 +875,12 @@ command { service = "ChanServ"; name = "AKICK"; command = "chanserv/akick"; grou
*
* Provides the command chanserv/ban.
*
* The configuration option 'kick' may be set in a command block for this command to control
* whether or not users will be kicked from the channel once banned. The default is 'yes'.
*
* The configuration option 'mode' may be set to control which mode is set, such as BAN or QUIET.
* The default is BAN.
*
* Used for banning users from channels.
*/
module { name = "cs_ban" }
@@ -921,6 +939,10 @@ command { service = "ChanServ"; name = "ENTRYMSG"; command = "chanserv/entrymsg"
* Provides the access system "flags".
*
* Used for giving users access in channels.
*
* The "LIST" subcommand of chanserv/flags will show every access entry on the channel, including access
* entries not added by cs_flags. The "Flags" of these entries will be the flags representation of the
* privilege set granted by the access entry.
*/
module { name = "cs_flags" }
command { service = "ChanServ"; name = "FLAGS"; command = "chanserv/flags"; group = "chanserv/access"; }
@@ -1032,7 +1054,9 @@ command { service = "ChanServ"; name = "LOG"; command = "chanserv/log"; group =
*
* Provides the command chanserv/mode and chanserv/modes.
*
* Used for changing mode locks and changing modes.
* Used for changing mode locks and changing modes. Multiple commands may be mapped to chanserv/modes, the
* configuration directive 'set' and 'unset' are used to tell chanserv/modes which modes should be set or
* unset when the command is executed.
*/
module
{
@@ -1044,6 +1068,13 @@ module
* If not set, the default is +nt.
*/
mlock = "+nt"
/*
* The maximum number of entries that may be on a mode lock list.
*
* This directive is optional.
*/
max = 32
}
command { service = "ChanServ"; name = "MODE"; command = "chanserv/mode"; group = "chanserv/management"; }
@@ -1144,7 +1175,7 @@ command { service = "ChanServ"; name = "SET"; command = "chanserv/set"; group =
command { service = "ChanServ"; name = "SET AUTOOP"; command = "chanserv/set/autoop"; }
command { service = "ChanServ"; name = "SET BANTYPE"; command = "chanserv/set/bantype"; }
command { service = "ChanServ"; name = "SET DESCRIPTION"; command = "chanserv/set/description"; }
command { service = "ChanServ"; name = "SET DESC"; command = "chanserv/set/description"; }
command { service = "ChanServ"; name = "SET DESC"; command = "chanserv/set/description"; hide = yes; }
command { service = "ChanServ"; name = "SET FOUNDER"; command = "chanserv/set/founder"; }
command { service = "ChanServ"; name = "SET KEEPMODES"; command = "chanserv/set/keepmodes"; }
command { service = "ChanServ"; name = "SET PEACE"; command = "chanserv/set/peace"; }
@@ -1198,6 +1229,13 @@ module
* If not set, the default is never.
*/
expire = 90d
/*
* Settings to show to non-opers in ChanServ's INFO output.
* Comment to completely disable showing any information about
* suspended channels to non-opers.
*/
show = "suspended, by, reason, on, expires"
}
command { service = "ChanServ"; name = "SUSPEND"; command = "chanserv/suspend"; permission = "chanserv/suspend"; group = "chanserv/admin"; }
command { service = "ChanServ"; name = "UNSUSPEND"; command = "chanserv/unsuspend"; permission = "chanserv/suspend"; group = "chanserv/admin"; }
@@ -1255,6 +1293,9 @@ command { service = "ChanServ"; name = "UP"; command = "chanserv/up"; group = "c
* privileges given by each is determined by the privilege:xop settings above. These commands should
* be ordered from highest to lowest, as each command inherits the privileges of the commands below
* it.
*
* The "LIST" subcommand of chanserv/xop will show only XOP access entries of the given XOP type. You
* can not view the entire access list at once, and instead should use another access system to do that.
*/
module { name = "cs_xop" }
command { service = "ChanServ"; name = "QOP"; command = "chanserv/xop"; group = "chanserv/access"; }
+2 -1
View File
@@ -37,7 +37,8 @@ cd $ANOPATH
if [ -f "$ANODATA/$ANOPIDF" ]
then
ANOPID=`cat "$ANODATA/$ANOPIDF"`
if [ `ps auwx | grep $ANOPROG | grep $ANOPID | grep -v -c grep` = 1 ]
kill -0 $ANOPID 2>/dev/null
if [ $? -eq 0 ]
then
exit
fi
+24 -28
View File
@@ -168,7 +168,7 @@ uplink
/*
* Enable if Services should connect using SSL.
* You must have m_ssl loaded for this to work.
* You must have an SSL module loaded for this to work.
*/
ssl = no
@@ -276,13 +276,6 @@ module
* If the protocol module you have loaded does not support this, this setting will have no effect.
*/
use_server_side_topiclock = yes
/*
* Some IRCds allow "SASL" authentication to let users identify to Services
* during the IRCd user registration process. If set, Services will allow
* authenticating users through this mechanism.
*/
sasl = yes
}
/*
@@ -326,6 +319,16 @@ networkinfo
*/
modelistsize = 100
/*
* Characters allowed in nicknames. This always includes the characters described
* in RFC1459, and so does not need to be set for normal behavior. Changing this to
* include characters your IRCd doesn't support will cause your IRCd and/or Services
* to break. Multibyte characters are not supported, nor are escape sequences.
*
* It is recommended you DON'T change this.
*/
#nick_chars = ""
/*
* The characters allowed in hostnames. This is used for validating hostnames given
* to services, such as BotServ bot hostnames and user vhosts. Changing this is not
@@ -469,7 +472,7 @@ options
/*
* If set, this will allow users to let Services send PRIVMSGs to them
* instead of NOTICEs. Also see the defmsg option of nickserv:defaults,
* instead of NOTICEs. Also see the "msg" option of nickserv:defaults,
* which also toggles the default communication (PRIVMSG or NOTICE) to
* use for unregistered users.
*
@@ -710,7 +713,7 @@ log
* create, destroy, join, part, kick, leave, mode
*
* Valid user options are:
* connect, disconnect, quit, nick, ident, host, mode, maxusers, oper
* connect, disconnect, quit, nick, ident, host, mode, maxusers, oper, away
*
* Rawio and debug are simple yes/no answers, there are no types for them.
*
@@ -754,7 +757,9 @@ log
*
* Available privileges:
* botserv/administration - Can view and assign private BotServ bots
* botserv/fantasy - Can use fantasy commands without the FANTASIA privilege
* chanserv/administration - Can modify the settings of any channel (including changing of the owner!)
* chanserv/access/list - Can view channel access and akick lists, but not modify them
* chanserv/access/modify - Can modify channel access and akick lists, and use /chanserv enforce
* chanserv/auspex - Can see any information with /chanserv info
* chanserv/no-register-limit - May register an unlimited number of channels and nicknames
@@ -768,12 +773,14 @@ log
* nickserv/confirm - Can confirm other users nicknames
* nickserv/drop - Can drop other users nicks
* operserv/config - Can modify services's configuration
* operserv/oper/modify - Can add and remove operators with at most the same privileges
* protected - Can not be kicked from channels by Services
*
* Available commands:
* botserv/bot/del botserv/bot/add botserv/bot/change botserv/set/private
* botserv/set/nobot
*
* chanserv/access/list chanserv/drop chanserv/getkey chanserv/invite
* chanserv/drop chanserv/getkey chanserv/invite
* chanserv/list chanserv/suspend chanserv/topic
*
* chanserv/saset/bantype chanserv/saset/description chanserv/saset/email chanserv/saset/keepmodes
@@ -786,7 +793,7 @@ log
* memoserv/sendall memoserv/staff
*
* nickserv/getpass nickserv/getemail nickserv/suspend nickserv/ajoin
* nickserv/resetpass nickserv/list
* nickserv/list
*
* nickserv/saset/autoop nickserv/saset/email nickserv/saset/greet nickserv/saset/password
* nickserv/saset/display nickserv/saset/kill nickserv/saset/language nickserv/saset/message
@@ -832,7 +839,7 @@ opertype
inherits = "Helper, Another Helper"
/* What commands (see above) this opertype may use */
commands = "chanserv/list chanserv/suspend chanserv/topic memoserv/staff nickserv/list nickserv/resetpass nickserv/suspend operserv/mode operserv/chankill operserv/akill operserv/session operserv/modinfo operserv/sqline operserv/oper operserv/kick operserv/ignore operserv/snline"
commands = "chanserv/list chanserv/suspend chanserv/topic memoserv/staff nickserv/list nickserv/suspend operserv/mode operserv/chankill operserv/akill operserv/session operserv/modinfo operserv/sqline operserv/oper operserv/kick operserv/ignore operserv/snline"
/* What privs (see above) this opertype has */
privs = "chanserv/auspex chanserv/no-register-limit memoserv/* nickserv/auspex nickserv/confirm"
@@ -854,7 +861,7 @@ opertype
inherits = "Services Operator"
commands = "chanserv/access/list chanserv/drop chanserv/getkey chanserv/saset/noexpire memoserv/sendall nickserv/saset/* nickserv/getemail operserv/news operserv/jupe operserv/svs operserv/stats operserv/oline operserv/noop operserv/forbid global/*"
commands = "botserv/* chanserv/access/list chanserv/drop chanserv/getkey chanserv/saset/noexpire memoserv/sendall nickserv/saset/* nickserv/getemail operserv/news operserv/jupe operserv/svs operserv/stats operserv/oline operserv/noop operserv/forbid global/*"
privs = "*"
}
@@ -958,18 +965,6 @@ mail
*/
sendfrom = "services@localhost.net"
/*
* If set, RESETPASS will be restricted to services operators with access to
* nickserv/resetpass in their opertype:commands.
* This directive is optional.
*
* WARNING: If you choose to not enable this option, you should limit the
* number of processes that the services user can have at a time (you can
* create a special user for this; remember to NEVER launch Services as
* root).
*/
restrict = yes
/*
* This controls the minimum amount of time a user must wait before sending
* another e-mail after they have sent one. It also controls the minimum time
@@ -1023,7 +1018,7 @@ mail
emailchange_subject = "Email confirmation"
emailchange_message = "Hi,
You have requested to change your email address to %e.
You have requested to change your email address from %e to %E.
Please type \" /msg NickServ CONFIRM %c \" to confirm this change.
If you don't know why this mail was sent to you, please ignore it silently.
@@ -1065,7 +1060,7 @@ mail
/*
* This is the encryption type used by the databases. This must be set correctly or
* your passwords will not work. Valid options are: md5, oldmd5, sha1, and none.
* your passwords will not work. Valid options are: md5, oldmd5, sha1, and plain.
* You must also be sure to load the correct encryption module below in the Encryption
* Modules section so that your passwords work.
*/
@@ -1223,6 +1218,7 @@ module
*
*/
#module { name = "enc_bcrypt" }
module { name = "enc_sha256" }
#module { name = "enc_md5" }
#module { name = "enc_sha1" }
+15 -2
View File
@@ -103,7 +103,20 @@ command { service = "HostServ"; name = "DELALL"; command = "hostserv/delall"; pe
*
* Used for grouping one vHost to many nicks.
*/
module { name = "hs_group" }
module
{
name = "hs_group"
/*
* Upon nickserv/group, this option syncs the nick's main vHost to the grouped nick.
*/
syncongroup = false
/*
* This makes vhosts act as if they are per account.
*/
synconset = false
}
command { service = "HostServ"; name = "GROUP"; command = "hostserv/group"; }
/*
@@ -139,7 +152,7 @@ command { service = "HostServ"; name = "ON"; command = "hostserv/on"; }
/*
* hs_request
*
* Provides the commands hostserv/request, hostserv/active, hostserv/reject, and hostserv/waiting.
* Provides the commands hostserv/request, hostserv/activate, hostserv/reject, and hostserv/waiting.
*
* Used to manage vHosts requested by users.
*/
+11 -1
View File
@@ -137,7 +137,17 @@ command { service = "MemoServ"; name = "DEL"; command = "memoserv/del"; }
*
* Used to ignore memos from specific users.
*/
module { name = "ms_ignore" }
module
{
name = "ms_ignore"
/*
* The maximum number of entries that may be on a memo ignore list.
*
* This directive is optional.
*/
max = 32
}
command { service = "MemoServ"; name = "IGNORE"; command = "memoserv/ignore"; }
/*
+233 -122
View File
@@ -124,26 +124,58 @@ module { name = "help" }
* %g is the realname of the user
* %h is the hostname of the user
* %i is the IP of the user
* %r is the reason (configured below). Will be nothing if not configured.
* %r is the reply reason (configured below). Will be nothing if not configured.
* %N is the network name set in networkinfo:networkname
*/
reason = "You are listed in the efnet RBL, visit http://rbl.efnetrbl.org/?i=%i for info"
/* Replies to ban and their reason. If this is totally omitted all replies get banned. */
1 = "Open Proxy"
/* Don't ban for result 2 or 3 */
#2 = "spamtrap666"
#3 = "spamtrap50"
4 = "TOR"
5 = "Drones / Flooding"
/* Replies to ban and their reason. If no relies are configured, all replies get banned. */
reply
{
code = 1
reason = "Open Proxy"
}
#reply
{
code = 2
reason = "spamtrap666"
}
#reply
{
code = 3
reason = "spamtrap50"
}
reply
{
code = 4
reason = "TOR"
/*
* If set, users identified to services at the time the result comes back
* will not be banned.
*/
#allow_account = yes
}
reply
{
code = 5
reason = "Drones / Flooding"
}
}
blacklist
#blacklist
{
name = "dnsbl.dronebl.org"
time = 4h
reason = "You have a host listed in the DroneBL. For more information, visit http://dronebl.org/lookup_branded?ip=%i&network=%N"
}
/* Exempt localhost from DNSBL checks */
exempt { ip = "127.0.0.1" }
}
/*
@@ -184,7 +216,7 @@ module { name = "help" }
/* Time before connections to this server are timed out. */
timeout = 30
/* Listen using SSL. Requires m_ssl. */
/* Listen using SSL. Requires an SSL module. */
#ssl = yes
/* If you are using a reverse proxy that sends one of the
@@ -267,7 +299,9 @@ module { name = "help" }
password_attribute = "userPassword"
/*
* If set, the reason to give the users who try to "/msg NickServ REGISTER".
* If set, the reason to give the users who try to register with nickserv,
* including nick registration from grouping.
*
* If not set, then registration is not blocked.
*/
#disable_register_reason = "To register on this network visit http://some.misconfigured.site/register"
@@ -340,6 +374,82 @@ module { name = "help" }
port = 3306
}
}
/*
* m_redis
*
* This module allows other modules to use Redis.
*/
#module
{
name = "m_redis"
/* A redis database */
redis
{
/* The name of this service */
name = "redis/main"
/*
* The redis database to use. New connections default to 0.
*/
db = 0
ip = "127.0.0.1"
port = 6379
}
}
/*
* m_regex_pcre [EXTRA]
*
* Provides the regex engine regex/pcre, which uses the Perl Compatible Regular Expressions library.
*/
#module { name = "m_regex_pcre" }
/*
* m_regex_posix [EXTRA]
*
* Provides the regex engine regex/posix, which uses the POSIX compliant regular expressions.
* This is likely the only regex module you will not need extra libraries for.
*/
#module { name = "m_regex_posix" }
/*
* m_regex_tre [EXTRA]
*
* Provides the regex engine regex/tre, which uses the TRE regex library.
*/
#module { name = "m_regex_tre" }
/*
* m_rewrite
*
* Allows rewriting commands sent to/from clients.
*/
#module { name = "m_rewrite" }
#command
{
service = "ChanServ"; name = "CLEAR"; command = "rewrite"
/* Enable m_rewrite. */
rewrite = true
/* Source message to match. A $ can be used to match anything. */
rewrite_source = "CLEAR $ USERS"
/*
* Message to rewrite the source message to. A $ followed by a number, eg $0, gets
* replaced by the number-th word from the source_message, starting from 0.
*/
rewrite_target = "KICK $1 *"
/*
* The command description. This only shows up in HELP's output.
* Comment this option to prevent the command from showing in the
* HELP command.
*/
rewrite_description = "Clears all users from a channel"
}
/*
* m_proxyscan
@@ -423,6 +533,105 @@ module { name = "help" }
}
}
/*
* m_sasl
*
* Some IRCds allow "SASL" authentication to let users identify to Services
* during the IRCd user registration process. If this module is loaded, Services will allow
* authenticating users through this mechanism. Supported mechanisms are:
* PLAIN, EXTERNAL.
*/
#module { name = "m_sasl" }
/*
* m_sasl_dh-aes [EXTRA]
*
* Add the DH-AES mechanism to SASL.
* Requires m_sasl to be loaded.
* Requires openssl.
*/
#module { name = "m_sasl_dh-aes" }
/*
* m_sasl_dh-blowfish [EXTRA]
*
* Add the DH-BLOWFISH mechanism to SASL.
* Requires m_sasl to be loaded.
* Requires openssl.
*/
#module { name = "m_sasl_dh-blowfish" }
/*
* m_ssl_gnutls [EXTRA]
*
* This module provides SSL services to Anope using GnuTLS, for example to
* connect to the uplink server(s) via SSL.
*
* You may only load either m_ssl_gnutls or m_ssl_openssl, bot not both.
*/
#module
{
name = "m_ssl_gnutls"
/*
* An optional certificate and key for m_ssl_gnutls to give to the uplink.
*
* You can generate your own certificate and key pair by using:
*
* certtool --generate-privkey --bits 2048 --outfile anope.key
* certtool --generate-self-signed --load-privkey anope.key --outfile anope.crt
*
*/
cert = "data/anope.crt"
key = "data/anope.key"
/*
* Diffie-Hellman parameters to use when acting as a server. This is only
* required for TLS servers that want to use ephemeral DH cipher suites.
*
* This is NOT required for Anope to connect to the uplink server(s) via SSL.
*
* You can generate DH parameters by using:
*
* certtool --generate-dh-params --bits 2048 --outfile dhparams.pem
*
*/
# dhparams = "data/dhparams.pem"
}
/*
* m_ssl_openssl [EXTRA]
*
* This module provides SSL services to Anope using OpenSSL, for example to
* connect to the uplink server(s) via SSL.
*
* You may only load either m_ssl_openssl or m_ssl_gnutls, bot not both.
*
*/
#module
{
name = "m_ssl_openssl"
/*
* An optional certificate and key for m_ssl_openssl to give to the uplink.
*
* You can generate your own certificate and key pair by using:
*
* openssl genrsa -out anope.key 2048
* openssl req -new -x509 -key anope.key -out anope.crt -days 1095
*/
cert = "data/anope.crt"
key = "data/anope.key"
/*
* As of 2014 SSL 3.0 is considered insecure, but it might be enabled
* on some systems by default for compatibility reasons.
* You can use the following option to enable or disable it explicitly.
* Leaving this option not set defaults to the default system behavior.
*/
#sslv3 = no
}
/*
* m_sql_authentication [EXTRA]
*
@@ -541,101 +750,26 @@ module { name = "help" }
}
/*
* m_redis
* webcpanel
*
* This module allows other modules to use Redis.
* This module creates a web configuration panel that allows users and operators to perform any task
* as they could over IRC. If you are using the default configuration you should be able to access
* this panel by visiting http://127.0.0.1:8080 in your web browser from the machine Anope is running on.
*
* This module requires m_httpd.
*/
#module
{
name = "m_redis"
name = "webcpanel"
/* A redis database */
redis
{
/* The name of this service */
name = "redis/main"
/* Web server to use. */
server = "httpd/main";
/*
* The redis database to use. New connections default to 0.
*/
db = 0
/* Template to use. */
template = "default";
ip = "127.0.0.1"
port = 6379
}
}
/*
* m_regex_pcre [EXTRA]
*
* Provides the regex engine regex/pcre, which uses the Perl Compatible Regular Expressions library.
*/
#module { name = "m_regex_pcre" }
/*
* m_regex_posix [EXTRA]
*
* Provides the regex engine regex/posix, which uses the POSIX compliant regular expressions.
* This is likely the only regex module you will not need extra libraries for.
*/
#module { name = "m_regex_posix" }
/*
* m_regex_tre [EXTRA]
*
* Provides the regex engine regex/tre, which uses the TRE regex library.
*/
#module { name = "m_regex_tre" }
/*
* m_rewrite
*
* Allows rewriting commands sent to/from clients.
*/
#module { name = "m_rewrite" }
#command
{
service = "ChanServ"; name = "CLEAR"; command = "rewrite"
/* Enable m_rewrite. */
rewrite = true
/* Source message to match. A $ can be used to match anything. */
rewrite_source = "CLEAR $ USERS"
/*
* Message to rewrite the source message to. A $ followed by a number, eg $0, gets
* replaced by the number-th word from the source_message, starting from 0.
*/
rewrite_target = "KICK $1 *"
/*
* The command description. This only shows up in HELP's output.
* Comment this option to prevent the command from showing in the
* HELP command.
*/
rewrite_description = "Clears all users from a channel"
}
/*
* m_ssl [EXTRA]
*
* This module uses SSL to connect to the uplink server(s).
*/
#module
{
name = "m_ssl"
/*
* An optional certificate and key for m_ssl to give to the uplink.
*
* You can generate your own certificate and key pair by using:
*
* openssl genrsa -out anope.key 2048
* openssl req -new -x509 -key anope.key -out anope.crt -days 1095
*/
cert = "data/anope.crt"
key = "data/anope.key"
/* Page title. */
title = "Anope IRC Services";
}
/*
@@ -659,26 +793,3 @@ module { name = "help" }
* Requires m_xmlrpc.
*/
#module { name = "m_xmlrpc_main" }
/*
* webcpanel
*
* This module creates a web configuration panel that allows users and operators to perform any task
* as they could over IRC. If you are using the default configuration you should be able to access
* this panel by visiting http://127.0.0.1:8080 in your web browser from the machine Anope is running on.
*
* This module requires m_httpd.
*/
#module
{
name = "webcpanel"
/* Web server to use. */
server = "httpd/main";
/* Template to use. */
template = "default";
/* Page title. */
title = "Anope IRC Services";
}
+12 -4
View File
@@ -102,6 +102,7 @@ module
* - hide_quit: Hide's the nick's last quit message
* - memo_signon: Notify user if they have a new memo when they sign into the nick
* - memo_receive: Notify user if they have a new memo as soon as it's received
* - memo_mail: Notify user if they have a new memo by mail
* - autoop: User will be automatically opped in channels they enter and have access to
* - msg: Services messages will be sent as PRIVMSGs instead of NOTICEs, requires
* options:useprivmsg to be enabled as well
@@ -230,7 +231,7 @@ module
command_group
{
name = "nickserv/admin"
description = "Services Operator commands"
description = _("Services Operator commands")
}
/* Give it a help command. */
@@ -306,7 +307,7 @@ module
* The maximum number of entries allowed on a nickname's certificate fingerprint list.
* The default is 5. This number cannot be set to 0.
*/
accessmax = 5
max = 5
}
command { service = "NickServ"; name = "CERT"; command = "nickserv/cert"; }
@@ -615,6 +616,13 @@ module
* This directive is optional. If not set, the default is never.
*/
#suspendexpire = 90d
/*
* Settings to show to non-opers in NickServ's INFO output.
* Comment to completely disable showing any information about
* suspended nicknames to non-opers.
*/
show = "suspended, by, reason, on, expires"
}
command { service = "NickServ"; name = "SUSPEND"; command = "nickserv/suspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; }
command { service = "NickServ"; name = "UNSUSPEND"; command = "nickserv/unsuspend"; permission = "nickserv/suspend"; group = "nickserv/admin"; }
@@ -640,7 +648,7 @@ command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update"; }
* Limits how many times the same email address may be used in Anope
* to register accounts.
*/
module
#module
{
name = "ns_maxemail"
@@ -649,5 +657,5 @@ module
* commented, there will be no limit enforced when registering new accounts or using
* /msg NickServ SET EMAIL.
*/
#maxemails = 1
maxemails = 1
}
+1 -1
View File
@@ -260,7 +260,7 @@ command { service = "OperServ"; name = "CHANKILL"; command = "operserv/chankill"
*/
#akillreason = "This network is currently not accepting connections, please try again later."
}
#command { service = "OperServ"; name = "DEFCON"; command = "operserv/defcon"; }
#command { service = "OperServ"; name = "DEFCON"; command = "operserv/defcon"; permission = "operserv/defcon"; }
/*
* os_dns
+1 -1
View File
@@ -168,7 +168,7 @@ uplink
/*
* Enable if Services should connect using SSL.
* You must have m_ssl loaded for this to work.
* You must have an SSL module loaded for this to work.
*/
ssl = no
-4747
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -1 +0,0 @@
git log --pretty=format:"Revision %h - %cD - %s" > version.log
+37
View File
@@ -1,3 +1,40 @@
Anope Version 2.0.2
-------------------
Fix keepmodes preventing the first user of a channel from being deopped
Fix SQlines that don't begin with # from matching channels
Made cs_clone behave like the help describes, copying many settings and lists by default
Allow cs_clone to clone levels, too
Update Hybrid protocol module for 8.2
Fix not unescaping all characters sent over XMLRPC
Fix crash when os_mode is used to destroy channels, like when unsetting permanent channel mode from an empty channel
Allow users with topic change privilege to change the topic instead of requiring them to use ChanServ's topic command
Fix negatively locking param modes in default mlock
Change entrymsg to check for the SET privilege, not real founder
Allow configuring characters allowed in nicknames
Fix crash when non users register channels externally (like XMLRPC)
Remove operserv/exception MOVE, it did not function correctly. Instead reorder the list by deleting/adding entries.
Allow flood ttb to be 0.
Enforce mlock when disabling defcon modes
Fix cs_mode not being able to apply mlock on register
Add log message when users send memos
Fix old collide timers from staying around after successful identify. Fixes being able to identify and logout and still being hit by the old timers.
Fix undefined behavior in cs_mode which usually crashes when clearing large list modes
Show all opertypes in operserv/info, even if no opers use them
Anope Version 2.0.1
-------------------
Fix access entries on accounts sometimes not updating when a user's display name changes
Fix ns_group to properly validate the account of the user against the target
Fix os_stats not saving max user count and time when using SQL
Fix nickalias's 'nc' field sometimes not being updated when using SQL
Fix several crashes on Windows related to being unable to load modules
Fix bs_bot change not properly reintroducing bots after changing their ident, host, or realname
Add English language file to allow users to easily modify language strings
Add configuring which mode cs_ban sets, and added a MUTE command to BotServ's fantasy
Allow SVSPART to take an optional reason
Allow cs_list to search channel topics and descriptions
Anope Version 2.0.0
-------------------
Added irc2sql stats module
+19
View File
@@ -1,7 +1,26 @@
Anope Version 2.0.2
-------------------
Add an operserv/oper/modify privilege, required to use oper add and oper del
Add a chanserv/access/list privilege, which allow readonly access to ChanServ access and akick lists
Changed m_dnsbl's result configuration to be more extensible
Add 'max' setting to cs_mode
Add 'nickchars' setting to networkinfo
Add 'botserv/fantasy', 'chanserv/access/list', and 'operserv/oper/modify' oper privileges
Fix 'emailchange_message' to include the proper email address
Set a default permission on operserv/defcon
Anope Version 2.0.1
-------------------
Add MUTE command to BotServ fantasy configuration
Document memo_mail option in nickserv.conf
Add 'show' setting to ns_info and cs_info to control which fields are shown to non opers
Anope Version 2.0.0
-------------------
options:passlen, enforceruser, enforcerhost, releasetimeout, and guestnickprefix moved to nickserv's module configuration
options:hideregisteredcommands added
m_ssl renamed to m_ssl_openssl
mail:restrict removed
Anope Version 1.9.9
-------------------
+11 -29
View File
@@ -21,26 +21,19 @@ Note: You should also read the README and FAQ files!
http://www.anope.org/
Anope can be built one of two ways. The recommended way is to use CMake.
You can check if CMake is already installed on your system using the
command:
Anope requires cmake to build. You can check if CMake is already
installed on your system using the command:
cmake --version
If it's installed, you will get a line that says something similar to
"cmake version 2.6-patch 1". If the version is less than 2.4 or you get
"cmake version 2.8.12.2". If the version is less than 2.4 or you get
an error saying the command was not found, you will not be able to use
CMake unless you install it yourself into your home directory. CMake
can be downloaded from:
http://www.cmake.org/cmake/resources/software.html
If you are unable to install CMake yourself (either due to lack of space
or restrictions by your hosting provider), you still have the alternative
to use the provided configure script. This option is not recommended and
will eventually be phased out, but is provided for compatibility for those
lacking CMake.
Next, unpack the package in your home directory, and go into the created
directory.
@@ -51,36 +44,25 @@ Note: You should also read the README and FAQ files!
Now type ./Config to start the configuration script. It will ask you a
few questions, and figure out how to compile Anope on your system. If
you are unsure about the answer to a question, use the default value.
The question to using configure or cmake depends on your decision from
above. If you have CMake and wish to use it, answer with cmake, otherwise
answer with configure.
You can now type make to compile Anope. If there are errors in the
Makefile, *try to use gmake* instead. If it still doesn't work, you (or
the system administrator if it's a shell) must install GNU make. You may
find it at ftp://prep.ai.mit.edu/pub/gnu/.
Now type make install (or gmake install; see above). This will install
Now cd build and type make and make install. This will install
all the needed files in the paths you specified with the configure
script, and setup file permissions. You should ensure that the data
directory is not accessible by other users, as malicious users may
cause trouble on your network if passwords are not encrypted, or read
the memos of any user.
If you see errors during this process, please mail us with the *complete*
error output, and don't forget to mention your OS, compiler and C++ library
versions.
Now go into the data directory (by default, ~/services/data). Copy the example
Now go into the conf directory (by default, ~/services/conf). Copy the example
configuration file (example.conf) to services.conf, and open the latter
with your favorite text editor. It contains all the configuration
directives Anope will use at startup. Read the instructions contained in
the file carefully. Using the default values is NOT a good idea, and will
most likely not work!
If you need help, you should subscribe to the Anope mailing list and mail
there to get help from other users. See the README file for more
information.
If you need help, you should visit http://forum.anope.org/ or #anope on
irc.anope.org. Provide *complete* error output, along with other relevant
information eg. OS, compiler and C++ library versions.
See the README file for more information.
2) Upgrading Anope
@@ -134,7 +116,7 @@ Note: You should also read the README and FAQ files!
still running, and restart it if not.
First rename the example.chk script that is in Anope path (by default,
this is ~/services/data) to services.chk and edit it. You'll need to
this is ~/services/conf) to services.chk and edit it. You'll need to
modify the CONFIGURATION part of the file. Then ensure that the file is
marked as executable by typing chmod +x services.chk, and try to launch the
script to see if it works (Anope must not be running when you do this ;))
@@ -143,7 +125,7 @@ Note: You should also read the README and FAQ files!
This will open the default text editor with the crontab file. Enter the
following (with correct path):
*/5 * * * * /home/ircd/services/data/services.chk >/dev/null 2>&1
*/5 * * * * /home/ircd/services/conf/services.chk >/dev/null 2>&1
The */5 at the beginning means "check every 5 minutes". You may replace
the 5 with other another number if you want (but less than 60). Consult
+90 -99
View File
@@ -1,5 +1,5 @@
Instructions d'installation d'Anope
------------------------------------
-----------------------------------
1) Installation d'Anope
2) Mettre à jour Anope
@@ -11,148 +11,139 @@ Note : Vous devrez également lire les fichiers README et FAQ !
1) Installation d'Anope
NOTE IMPORTANTE : il n'est pas recommandé d'utiliser (et même d'installer)
Anope en tant que root. Utilisez un utilisateur non
privilégié. Celui que vous utilisez pour l'IRCd ou un
utilisateur dédié suffira.
NOTE IMPORTANTE : il est déconseillé d'utiliser (et même d'installer)
Anope en tant que root. Utilisez un utilisateur non
privilégié. Celui que vous utilisez pour l'IRCd ou
un utilisateur dédié suffira.
La première chose que vous devez faire est d'obtenir le package Anope (si ce
n'est déjà fait). Vous pouvez le trouver ici :
La première chose que vous devez faire est d'obtenir le package Anope
(si ce n'est déjà fait). Vous pouvez le trouver ici :
http://www.anope.org/
http://www.anope.org/
Anope peut être installé de deux façons. La méthode recommandée est
d'utiliser CMake. Vous pouvez vérifier si CMake est déjà installé
sur votre système en utilisant la commande :
Anope nécessite cmake pour être compilé. Vous pouvez vérifier si CMake
est déjà installé sur votre système avec la commande :
cmake --version
Si CMake est installé, vous aurez une ligne qui dit quelque chose similaire
à "cmake version 2.6 cmake-patch 1". Si la version est inférieure à 2.4 ou
si vous obtenez une erreur disant que la commande n'a pas été trouvée,
vous ne serez pas en mesure d'utiliser CMake, sauf si vous l'installez
vous-même dans votre répertoire home. CMake peut être téléchargé ici :
Si CMake est installé, vous aurez une ligne qui dit quelque chose comme
"cmake version 2.8.12.2". Si la version est inférieure à 2.4 ou si vous
obtenez une erreur disant que la commande n'a pas été trouvée, vous ne
pourrez pas utiliser CMake à moins de l'installer vous-même dans votre
répertoire home. CMake peut être téléchargé ici :
http://www.cmake.org/cmake/resources/software.html
Si vous n'arrivez pas à l'installer (soit en raison du manque d'espace
ou de restrictions par votre fournisseur d'hébergement), vous pouvez encore
utiliser le script de configuration fourni. Cette option n'est pas
recommandée et finira par être retirée, mais est fournie pour la
compatibilité de ceux à qui il manque CMake.
Ensuite, décompressez le package dans votre répertoire home, et allez
dans le répértoire qui vient d'être créé.
Ensuite, décompressez le package dans votre répertoire home, et allez dans
le répértoire qui vient d'être créé.
Si il y a des modules facultatifs que vous voulez activer comme m_mysql,
exécuter le script 'extras' pour les activer. Si vous ne savez pas, vous
pouvez les activer plus tard.
Maintenant, tapez ./Config pour lancer le script de configuration. Il va
vous poser quelques questions, et compiler Anope sur votre système. Si vous
ne savez pas répondre à une question, utilisez la valeur par défaut. La
question d'utiliser CMake ou configure dépend de la décision que vous avez
prise précedemment. Si vous avez CMake et que vous souhaitez l'utiliser,
répondez avec cmake, sinon répondez avec configure.
Maintenant, tapez ./Config pour lancer le script de configuration. Il
va vous poser quelques questions, et déterminer comment compiler Anope
sur votre système. Si vous ne savez pas comment répondre à une question,
utilisez la valeur par défaut.
Vous pouvez maintenant taper make pour compiler Anope. S'il y'a des erreurs
dans le Makefile, *essayez d'utiliser* gmake à la place. Si cela ne
fonctionne toujours pas, vous (ou votre administrateur système) devriez
installer GNU make.
Vous pouvez le trouver ici : ftp://prep.ai.mit.edu/pub/gnu/.
Allez dans le dossier build (cd build) et tapez make et make install.
Ceci va installer tous les fichiers nécessaires dans les dossiers que
vous avez indiqués avec le script Config et régler les permissions des
fichiers. Vous devez vous assurer que le répertoire data n'est pas
accessible par les autres utilisateurs, car des utilisateurs
malveillants pourraient causer des problèmes sur votre réseau, si les
mots de passe ne sont pas chiffrés, ou lire les mémos de tous les
utilisateurs.
Maintenant, tapez make install (ou gmake install ; voir ci-dessus). Cela
permet d'installer tous les fichiers nécessaires dans les chemins que vous
avez spécifié au script configure, et de régler les permissions des fichiers.
Vous devez vous assurer que le répertoire data n'est pas accessible par les
autres utilisateurs, des utilisateurs malveillants pourraient causer des
problèmes sur votre réseau, si les mots de passe ne sont pas chiffrés,
ou lire les mémos de tout utilisateur.
Allez maintenant dans le répertoire conf (par défaut, ~/services/conf).
Copiez l'exemple de fichier de configuration (example.conf) en
services.conf et ouvrez ce dernier avec votre éditeur de texte favori.
Il contient toutes les directives de configuration qu'Anope va utiliser
en démarrant. Lisez attentivement les instructions contenues dans le
fichier. L'utilisation des valeurs par défaut n'est pas toujours
recommandée, et Anope ne fonctionnera probablement pas !
Si vous voyez des erreurs lors de ce processus, merci de nous envoyer un
e-mail avec la sortie d'erreur *complète* et n'oubliez pas de mentionner
les versions de votre système, compilateur et bibliothèque C++.
Allez maintenant dans le répertoire de données (par défaut, ~/services/data).
Copiez l'exemple de fichier de configuration (example.conf) en services.conf
et ouvrez ce dernier avec votre éditeur de texte favori. Il contient toute
les directives de configuration. Anope va l'utiliser au démarrage.
Lisez attentivement les instructions contenues dans le fichier.
L'utilisation des valeurs par défaut n'est pas recommendé et Anope ne
fonctionnera probablement pas.
Si vous avez besoin d'aide, abonnez-vous à la liste de diffusion Anope
et envoyez-y vos e-mails pour obtenir de l'aide de la part des autres
utilisateurs. Voir le fichier README pour plus d'informations.
Si vous avez besoin d'aide, vous pouvez aller sur le site
http://forum.anope.org/ ou le canal #anope sur irc.anope.org.
Fournissez *l'essemble* des erreurs qui apparaîssent, en plus de
toutes informations utiles, comme les versions de votre OS, du
compilateur utilisé et de la librairie C++. Lisez le fichier README
pour plus d'informations.
2) Mettre à jour Anope
Pour mettre à jour Anope, suivez simplement les instructions d'installation
décrites dans la section 1. Il y a cependant une ligne de conduite
spécifique :
Pour mettre à jour Anope, suivez simplement les instructions
d'installation décrites dans la section 1. Prenez garde cependant :
* IMPORTANT : Sauvegardez vos anciennes bases de données !
* Si vous mettez à jour vers une nouvelle version majeure, toujours
redémarrer avec un fichier de configuration neuf depuis example.conf.
* Si vous mettez à jour vers une nouvelle version majeure,
recommencez *toujours* toute votre configuration à partir du
fichier example.conf.
3) Configuration de l'IRCd
Les Services agissent comme un serveur IRC avec des pseudo-clients.
Pour les relier à votre réseau, vous aurez besoin de configurer votre IRCd
pour permettre aux services de linker.
Pour les relier à votre réseau, vous aurez besoin de configurer votre
IRCd pour permettre aux services de se connecter.
La configuration varie selon les IRCd, mais vous aurez probablement besoin
d'un block link (aussi appelé connect block, ou C line), un U line (aussi
appelé shared block) et assurez-vous que l'IRCd écoute sur le port donné
dans le block link.
La configuration dépend de l'IRCd utilisé, mais vous aurez probablement
besoin d'un bloc link (aussi appelé connect block, ou C:line) et un
U:line (aussi appelé shared block). Assurez-vous que l'IRCd écoute
sur le port donné dans le bloc link.
Des exemples de configurations de link peuvent être trouvés dans le fichier
example.conf pour certains des IRCd les plus populaires.
Des exemples de configurations de bloc link peuvent être trouvés dans
le fichier example.conf pour certains des IRCd les plus populaires.
Souvenez-vous de /rehash votre IRCd pour appliquer les changements.
Vous pouvez également essayer notre créateur de link interactif situé ici :
Vous pouvez également essayer notre créateur de bloc link interactif
situé ici :
http://anope.org/ilm.php
4) Mettre en route Anope
Allez dans le répertoire où les fichiers binaires ont été installés (par
défaut, ~/services/bin). Tapez ./services pour lancer Anope.
Allez dans le répertoire où les fichiers binaires ont été installés
(par défaut, ~/services/bin). Tapez ./services pour lancer Anope.
S'il ya des erreurs de syntaxe dans le fichier de configuration, elles
seront affichées sur l'écran. Corrigez-les jusqu'à ce qu'il n'y en ait plus.
Un démarrage réussi ne générera pas de message.
S'il y a des erreurs de syntaxe dans le fichier de configuration, elles
seront affichées à l'écran. Corrigez-les jusqu'à ce qu'il n'y en ait
plus. Un démarrage réussi ne générera pas de message.
Donnez aux services au moins une minute pour se connecter à votre réseau.
Certains IRCds sur certains systèmes peuvent être très lents pour le
processus de liaison. Si rien n'arrive après environ une minute, il y a
probablement un problème de configuration. Essayez de lancer Anope en mode
debug ./services -debug -nofork pour voir toutes les erreurs rencontrées
et essayez de les corriger.
Donnez aux services au moins une minute pour se connecter à votre
réseau, car certains IRCds sur certains systèmes peuvent être très
lents pour le processus de liaison. Si rien ne se passe après environ
une minute, il y a probablement un problème de configuration. Essayez
de lancer Anope en mode debug avec ./services -debug -nofork pour voir
toutes les erreurs rencontrées et essayez de les corriger.
Si vous avez besoin d'aide pour résoudre des erreurs, n'hésitez pas à vous
abonner à la liste de diffusion Anope et d'y poser vos question.
Si vous avez besoin d'aide pour résoudre des erreurs, n'hésitez pas à
vous abonner à la liste de diffusion Anope et d'y poser vos question.
Voir le fichier README pour plus de détails.
5) Mettre en place un crontab
Une entrée crontab vous permettra de vérifier périodiquement si Anope est
toujours en cours d'exécution et de le redémarrer s'il n'est pas.
Une entrée crontab vous permettra de vérifier périodiquement si Anope
est toujours en cours d'exécution et de le redémarrer s'il n'est pas.
D'abord renommez le script example.chk qui est dans le chemin d'Anope
(par défaut, ~/services/data) en services.chk et modifiez-le. Vous aurez
besoin de modifier la partie CONFIGURATION du fichier. Assurez-vous ensuite
que le fichier est marqué comme exécutable en tapant chmod +x services.chk
et essayez de lancer le script pour voir si cela fonctionne (Anope ne doit
pas être en marche lorsque vous faites cela ;))
D'abord renommez le script example.chk qui est dans les dossiers
d'Anope (par défaut, ~/services/conf) en services.chk et modifiez-le.
Vous aurez besoin de modifier la partie CONFIGURATION du fichier.
Assurez-vous ensuite que le fichier est marqué comme exécutable en
tapant chmod +x services.chk et essayez de lancer le script pour voir
si cela fonctionne (Anope ne doit pas être en marche lorsque vous
testez cela ;))
Lorsque c'est fait, vous devrez ajouter l'entrée crontab. Tapez crontab -e.
Cela va ouvrir l'éditeur de texte par défaut avec le fichier crontab.
Entrez la ligne suivante (avec le chemin correct) :
Lorsque c'est fait, vous devrez ajouter l'entrée crontab. Entrez
crontab -e. Cela va ouvrir l'éditeur de texte par défaut avec le
fichier crontab. Entrez la ligne suivante (avec le chemin correct) :
*/5 * * * * /home/ircd/services/data/services.chk > /dev/null 2>&1
*/5 * * * * /home/ircd/services/conf/services.chk > /dev/null 2>&1
Le */5 au début signifie "vérifier toutes les 5 minutes". Vous pouvez
remplacer le 5 par un autre numéro si vous voulez (mais moins de 60).
Consultez pages de manuel de votre système pour plus de détails sur la
syntaxe du fichier crontab. Les pages de manuel intéressantes sont
remplacer le 5 par un autre numéro si vous voulez (mais moins de 60).
Consultez les pages de manuel de votre système pour plus de détails sur
la syntaxe du fichier crontab. Les pages de manuel intéressantes sont
crontab(5), crontab(1) et cron(8).
Sauvegardez, quittez et c'est installé.
Sauvegardez, quittez, et c'est installé !
-202
View File
@@ -1,202 +0,0 @@
How To Add IRCd Support
-----------------------
1) Files to Edit
2) The Code
3) The IRCDVar struct
4) Modes
5) Functions / Events
6) CAPAB/PROTOCTL
7) IRCDProto Class
1) Files to Edit
When preparing to add supprt to Anope for your IRCd, you need to edit
the following files
A) Make a copy of the .cpp file of the IRCd that matches the IRCd that
you are attempting to add support for best.
B) Add your IRCd into the supported IRCds in example.conf
2) The Code
Here is where the code of the .cpp file comes in. Be prepared to spend at
least an hour, if not longer, going over the code and getting it right;
Especially if you are setting up an ircd that is completely different
than the one you used as a base. This section covers the majority of the
code that is in use.
The first bit of code you will face is the IRCDVar structure, This is one
of two structs which holds your IRCd information; This allows you to quickly
setup your specific ircd.
IRCDVar myIrcd[] = { };
This struct contains your basic IRCd functions. Your base source file has
the list of all available variables; note that you should not swap any
around, or you will break stuff. Here is a brief description of the usage
of each.
1) Name: This member tells Anope about the IRCD's name. It may contain
text about it's name and version. This is used to identify the
build on startup.
2) Pseudo Client Mode: This is the user mode set by Anope on all BotServ
bots. Normally you want this to be a some form of
service or bot flag; you can use + for no mode at
all.
3) Max Channelmode Symbols: This is the total number of possible channel
modes that can appear before a nick. Do
remember to count each possible mode, so +ov
is 2.
4) SVSNICK: Can the ircd use SVSNICK to change some ones nick? Otherwise,
KILL is used. Use 1 for yes, 0 for no.
5) VHOST: Can a user's host be changed on the fly? Enabling this allow
HostServ online. Use 1 for yes, 0 for no.
6) SNLINE: Does the IRCd support realname (geocs) bans? Use 1 for yes,
0 for no.
7) SQLINE: Does the IRCd support nick bans? Use 1 for yes, 0 for no.
8) SZLINE: Does the IRCd support SZLINES? Use 1 for yes, 0 for no.
10) Join to Message: Services must join a channel to send any message to
that channel (cannot override +n). Use 1 for yes,
0 for no.
11) SQline Channels: The IRCd's supports banning channel names via
SQLINES. Use 1 for yes, 0 for no.
12) Quit On Kill: When we (SVS)KILL a user, does the IRCd send back a
QUIT message for that user? Use 1 for yes, 0 for no.
13) SVSMODE UNBAN: We can use SVSMODE to unban hosts from a channel. Use
1 for yes, 0 for no.
14) Reverse: We can do a reverse check when unbanning. For use with
DreamForge based IRCd's. Use 1 for yes, 0 for no.
15) vIdent: Support for including a user's ident in their vHost. Use
1 for yes, 0 for no.
16) SVSHOLD: Support for temporarily 'holding' a nick, instead of using
a nick enforcer client. Use 1 for yes, 0 for no.
17) TS on MODE: We need to send a timestamp when modes are being changed.
Use 1 for yes, 0 for no.
18) Umode: We can use OperServ to change a user's mode. Use 1 for yes,
0 for no.
19) OMODE: We can use OperServ to give some user a temporary O:LINE.
Use 1 for yes, 0 for no.
20) No Knock Requires +i: Does the No Knock channel mode require invite
only channels? Use 1 for yes, 0 for no.
21) SVSMODE UCMODE: Can we clear user channel modes with SVSMODE? Use
1 for yes, 0 for no.
22) SGline Enforce: Does the IRCd enforce SNLINES for us or do we need to
do so? Use 1 for yes, 0 for no.
23) TS6: Does the IRCd support TS6? Use 1 for yes, 0 for no.
24) Global TLD Prefix: Prefix used to send global messages, should probably
be "$"
25) Max Modes: The max number of mode changes we can send in one line
3) Modes
Anope is told about modes in the protocol module.
For the most part, the syntax for adding channel and user modes are:
ModeManager::AddUserMode(new UserMode(UMODE_NETADMIN, "UMODE_NETADMIN", 'N'));
Where 'N' is the char for the mode, and UMODE_NETADMIN shows what the
mode does. Or:
ModeManager::AddChannelMode(new ChannelMode(CMODE_BLOCKCOLOR, "CMODE_BLOCKCOLOR", 'c'));
Where 'c' is the char for the mode and CMODE_BLOCKCOLOR shows what
the mode does
A full list of valid mode names for the second param can be found
in services.h in the enum for ChannelModeName and UserModeName
If necessary, you can add additional modes to this list.
Adding simple modes with parameters is similar, instead adding a
'new ChannelMode', use 'new ChannelModeParam', set the third optional
arg of ChannelModeParam to false if the param should NOT be sent when unsetting
it. Eg:
ModeManager::AddChannelMode(new ChannelModeParam(CMODE_JOINFLOOD, "CMODE_JOINFLOOD", 'j', true));
Anope will internally track the params, and they can be retrieved through
Channel::GetParam();
If you want to make param validity checking for a mode, you must create a new
class which inherits from ChannelModeParam and overload the IsValid function.
Modes CMODE_OPERONLY, CMODE_ADMINONLY, and CMODE_REGISTERED already exist
internally as classes, to overload the CanSet function to disable non opers
from mlocking (or in CMODE_REGISTERED's case, anyone) from setting them.
This should be added like:
ModeManager::AddChannelMode(new ChannelModeOper('O'));
4) Functions and Events
A brief word about functions and events. All events are captured by creating a Message struct
with the name of the message and the callback function:
Message my_message("MESSAGE", do_my_messsage);
Each message should have a message handler if its important enough to be
processed by services. All event functions should be formed like this:
bool do_my_message(const Anope::string &source, const std::vector<Anope::string> &params)
{
return true;
}
They will receive the source; this can be empty at times depending on the
event. Next, params holds the arguments for the event. Events are likely to
pass to various upper level event handlers; see the previous ircd source for
how they handle these events.
5) CAPAB/PROTOCTL
Most IRCDs send a CAPAB or PROTOCTL line so that they can work out what
the other end of the connection is capable of doing. The protocol module should
handle all of these without the cores knowledge with the exception of the following:
--------------------------------------------------------------------------
Define | Description
----------------|---------------------------------------------------------
CAPAB_NOQUIT | NOQUIT protocol support
CAPAB_TSMODE | Chanmodes are timestamped
CAPAB_UNCONNECT | UNCONNECT protocol support
CAPAB_QS | Quitstorm - same as NOQUIT
You can override the default OnCapab method in IRCdMessage if required.
6) IRCDProto Class
The IRCDProto class is set up like:
class MyIRCdProto : public IRCDProto { } ircdproto;
And told to Anope through the
pmodule_ircd_proto(&ircd_proto);
function.
This is used for sending out specific messages from Anope to your IRCd.
A list of all of the valid function names to overload and their args
are in services.h. If the protocol module you are editing is similar enough
to the IRCd you are adding support for, many of these probably won't need to
be changed.
+5 -12
View File
@@ -71,19 +71,12 @@ Anope for Windows
our IRC Support channel for assistance.
Some Anope modules require third party libraries, such as m_mysql and
m_ssl. If these libraries are installed in nonstandard locations, cmake
will probably not find them and should be told where they are by passing
additional search paths to the last question in Config, such as:
the SSL modules. If these libraries are installed in nonstandard
locations, cmake will probably not find them and should be told where
they are by passing their location to Config.
-DEXTRA_INCLUDE:STRING=c:/openssl/include;c:/mysql/include
-DEXTRA_LIBS:STRING=c:/openssl/lib;c:/mysql/lib
Building Anope with gettext requires libintl, libiconv, libgcc and
libmingex. We have precompiled these libraries for you that you may
use if you want. They are avaiable at http://anope.org/downloads/anope-extra.zip
The OpenSSL, MySQL, and OpenLDAP header files and libraries are also included in
this package. Once downloaded and extracted, you should run install.bat
then give Config the path to the new 'installed' directory.
The libraries used to build the 'extra' modules are available at
https://github.com/Adam-/windows-scripts.
5) You are now ready to compile. If you said you wanted to use NMake in step 4,
at the prompt type:
+2 -2
View File
@@ -3,8 +3,8 @@ This allows external applications, such as websites, to execute remote procedure
Currently there are 5 supported XMLRPC calls, provided by m_xmlrpc_main:
checkAuthetication - Takes two parameters, an account name and a password. Checks if the account name is valid and the password
is correct for the account name, useful for making login pages on websites.
checkAuthentication - Takes two parameters, an account name and a password. Checks if the account name is valid and the password
is correct for the account name, useful for making login pages on websites.
command - Takes three parameters, a service name (BotServ, ChanServ, NickServ), a user name (whether online or not), and the command
to execute. This will execute a the given command to Anope using the given service name. If the user given is online, the
+1 -1
View File
@@ -147,7 +147,7 @@ while (1)
chop($input); # remove the trailing \n from the user input
if ($input eq "q") {
if (-e "build") {
if (-e "build/CMakeFiles") {
if (-e "cmake-bin") {
my $cmake_path = `find cmake-bin -name cmake -print0`;
system($cmake_path, "build/.");
+2 -1
View File
@@ -7,7 +7,7 @@ get_target_property(version_BINARY version LOCATION)
# Modify version.h from the above executable, with dependencies to version.cpp
# and all of the source files in the main build
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version_build
COMMAND ${version_BINARY} ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h
COMMAND ${version_BINARY} ${Anope_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/version.h ${CMAKE_CURRENT_BINARY_DIR}/build.h
DEPENDS version ${SRC_SRCS}
)
# Add version to list of files for CPack to ignore
@@ -15,6 +15,7 @@ get_filename_component(version_BINARY ${version_BINARY} NAME)
add_to_cpack_ignored_files("${version_BINARY}$" TRUE)
if(NOT WIN32)
add_to_cpack_ignored_files("version.h$" TRUE)
add_to_cpack_ignored_files("build.h$" TRUE)
endif(NOT WIN32)
set(PCH_SOURCES_GCH "")
+8 -3
View File
@@ -74,6 +74,10 @@ class CoreExport AccessProvider : public Service
/* Represents one entry of an access list on a channel. */
class CoreExport ChanAccess : public Serializable
{
Anope::string mask;
/* account this access entry is for, if any */
Serialize::Reference<NickCore> nc;
public:
typedef std::multimap<const ChanAccess *, const ChanAccess *> Set;
/* shows the 'path' taken to determine if an access entry matches a user
@@ -86,9 +90,6 @@ class CoreExport ChanAccess : public Serializable
AccessProvider *provider;
/* Channel this access entry is on */
Serialize::Reference<ChannelInfo> ci;
/* account this access entry is for, if any */
Serialize::Reference<NickCore> nc;
Anope::string mask;
Anope::string creator;
time_t last_seen;
time_t created;
@@ -96,6 +97,10 @@ class CoreExport ChanAccess : public Serializable
ChanAccess(AccessProvider *p);
virtual ~ChanAccess();
void SetMask(const Anope::string &mask, ChannelInfo *ci);
const Anope::string &Mask() const;
NickCore *GetAccount() const;
void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &);
+9 -8
View File
@@ -115,6 +115,7 @@ namespace Anope
* The following functions return the various types of strings.
*/
inline const char *c_str() const { return this->_string.c_str(); }
inline const char *data() const { return this->_string.data(); }
inline std::string &str() { return this->_string; }
inline const std::string &str() const { return this->_string; }
inline ci::string ci_str() const { return ci::string(this->_string.c_str()); }
@@ -159,24 +160,24 @@ namespace Anope
* Trim leading and trailing white spaces from the string.
*/
inline string& ltrim()
inline string& ltrim(const Anope::string &what = " \t\r\n")
{
while (!this->_string.empty() && isspace(this->_string[0]))
while (!this->_string.empty() && what.find(this->_string[0]) != Anope::string::npos)
this->_string.erase(this->_string.begin());
return *this;
}
inline string& rtrim()
inline string& rtrim(const Anope::string &what = " \t\r\n")
{
while (!this->_string.empty() && isspace(this->_string[this->_string.length() - 1]))
while (!this->_string.empty() && what.find(this->_string[this->_string.length() - 1]) != Anope::string::npos)
this->_string.erase(this->_string.length() - 1);
return *this;
}
inline string& trim()
inline string& trim(const Anope::string &what = " \t\r\n")
{
this->ltrim();
this->rtrim();
this->ltrim(what);
this->rtrim(what);
return *this;
}
@@ -621,7 +622,7 @@ class commasepstream : public sepstream
public:
/** Initialize with comma seperator
*/
commasepstream(const Anope::string &source) : sepstream(source, ',') { }
commasepstream(const Anope::string &source, bool allowempty = false) : sepstream(source, ',', allowempty) { }
};
/** A derived form of sepstream, which seperates on spaces
+2
View File
@@ -60,6 +60,8 @@ class CoreExport BotInfo : public User, public Serializable
void GenerateUID();
void OnKill();
/** Change the nickname for the bot.
* @param newnick The nick to change to
*/
+5 -4
View File
@@ -242,9 +242,9 @@ class CoreExport Channel : public Base, public Extensible
/** Get a list of modes on a channel
* @param name A mode name to get the list of
* @return a pair of iterators for the beginning and end of the list
* @return a vector of the list mode entries
*/
std::pair<ModeList::iterator, ModeList::iterator> GetModeList(const Anope::string &name);
std::vector<Anope::string> GetModeList(const Anope::string &name);
/** Get a string of the modes set on this channel
* @param complete Include mode parameters
@@ -258,7 +258,7 @@ class CoreExport Channel : public Base, public Extensible
* @param newtopic The new topic
* @param ts The time the new topic is being set
*/
void ChangeTopicInternal(const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime);
void ChangeTopicInternal(User *u, const Anope::string &user, const Anope::string &newtopic, time_t ts = Anope::CurTime);
/** Update the topic of the channel, and reset it if topiclock etc says to
* @param user The user setting the topic
@@ -276,10 +276,11 @@ class CoreExport Channel : public Base, public Extensible
/** Unbans a user from this channel.
* @param u The user to unban
* @param mode The mode to unban
* @param full Whether or not to match using the user's real host and IP
* @return whether or not a ban was removed
*/
bool Unban(User *u, bool full = false);
bool Unban(User *u, const Anope::string &mode, bool full = false);
/** Check whether a user is permitted to be on this channel
* @param u The user
+2
View File
@@ -170,6 +170,8 @@ class CoreExport Command : public Service
*/
static void Run(CommandSource &source, const Anope::string &message);
void Run(CommandSource &source, const Anope::string &, const CommandInfo &, std::vector<Anope::string> &params);
/** Looks up a command name from the service name.
* Note that if the same command exists multiple places this will return the first one encountered
* @param command_service The command service to lookup, eg, nickserv/register
+12 -8
View File
@@ -51,14 +51,13 @@ namespace Configuration
template<typename T> T Get(const Anope::string &tag, const Anope::string &def) const
{
const Anope::string &value = this->Get<const Anope::string>(tag, def);
try
{
return convertTo<T>(value);
}
catch (const ConvertException &)
{
return T();
}
if (!value.empty())
try
{
return convertTo<T>(value);
}
catch (const ConvertException &) { }
return T();
}
bool Set(const Anope::string &tag, const Anope::string &value);
@@ -104,6 +103,8 @@ namespace Configuration
time_t TimeoutCheck;
/* options:usestrictprivmsg */
bool UseStrictPrivmsg;
/* networkinfo:nickchars */
Anope::string NickChars;
/* either "/msg " or "/" */
Anope::string StrictPrivmsg;
@@ -132,11 +133,14 @@ namespace Configuration
~Conf();
void LoadConf(File &file);
void Post(Conf *old);
Block *GetModule(Module *);
Block *GetModule(const Anope::string &name);
BotInfo *GetClient(const Anope::string &name);
Block *GetCommand(CommandSource &);
};
struct Uplink
+1
View File
@@ -52,4 +52,5 @@ struct Exception;
struct MemoInfo;
struct ModeLock;
struct Oper;
namespace SASL { struct Message; }
+4
View File
@@ -176,6 +176,8 @@ class SerializableExtensibleItem : public PrimitiveExtensibleItem<T>
T t;
if (data[this->name] >> t)
this->Set(e, t);
else
this->Unset(e);
}
};
@@ -196,6 +198,8 @@ class SerializableExtensibleItem<bool> : public PrimitiveExtensibleItem<bool>
data[this->name] >> b;
if (b)
this->Set(e);
else
this->Unset(e);
}
};
+2 -2
View File
@@ -74,7 +74,7 @@ namespace Language
#define MORE_OBSCURE_PASSWORD _("Please try again with a more obscure password. Passwords should be at least\n" \
"five characters long, should not be something easily guessed\n" \
"(e.g. your real name or your nick), and cannot contain the space or tab characters.")
#define PASSWORD_TOO_LONG _("Your password is too long. Please try again with a shorter password.")
#define PASSWORD_TOO_LONG _("Your password is too long. It must not exceed %u characters.")
#define NICK_NOT_REGISTERED _("Your nick isn't registered.")
#define NICK_X_NOT_REGISTERED _("Nick \002%s\002 isn't registered.")
#define NICK_X_NOT_IN_USE _("Nick \002%s\002 isn't currently in use.")
@@ -107,7 +107,7 @@ namespace Language
#define CHAN_SETTING_UNSET _("%s for %s unset.")
#define CHAN_ACCESS_LEVEL_RANGE _("Access level must be between %d and %d inclusive.")
#define CHAN_INFO_HEADER _("Information for channel \002%s\002:")
#define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except have been removed.")
#define CHAN_EXCEPTED _("\002%s\002 matches an except on %s and cannot be banned until the except has been removed.")
#define MEMO_NEW_X_MEMO_ARRIVED _("There is a new memo on channel %s.\n" \
"Type \002%s%s READ %s %d\002 to read it.")
#define MEMO_NEW_MEMO_ARRIVED _("You have a new memo from %s.\n" \
+5
View File
@@ -96,6 +96,11 @@ class CoreExport Log
~Log();
private:
Anope::string FormatSource() const;
Anope::string FormatCommand() const;
public:
Anope::string BuildPrefix() const;
template<typename T> Log &operator<<(T val)
+2 -2
View File
@@ -82,7 +82,7 @@ namespace Message
struct CoreExport Mode : IRCDMessage
{
Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { }
Mode(Module *creator, const Anope::string &mname = "MODE") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
@@ -131,7 +131,7 @@ namespace Message
struct CoreExport SQuit : IRCDMessage
{
SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
SQuit(Module *creator, const Anope::string &mname = "SQUIT") : IRCDMessage(creator, mname, 2) { }
void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override;
};
+44 -11
View File
@@ -88,7 +88,7 @@ class CoreExport UserModeParam : public UserMode
* @param value The param
* @return true or false
*/
virtual bool IsValid(const Anope::string &value) const { return true; }
virtual bool IsValid(Anope::string &value) const { return true; }
};
/** This class is a channel mode, all channel modes use this/inherit from this
@@ -96,6 +96,9 @@ class CoreExport UserModeParam : public UserMode
class CoreExport ChannelMode : public Mode
{
public:
/* channel modes that can posssibly unwrap this mode */
std::vector<ChannelMode *> listeners;
/** constructor
* @param name The mode name
* @param mc The mode char
@@ -103,6 +106,20 @@ class CoreExport ChannelMode : public Mode
ChannelMode(const Anope::string &name, char mc);
bool CanSet(User *u) const anope_override;
virtual void Check() { }
/** 'wrap' this channel mode and param to the underlying mode and param
*/
virtual ChannelMode *Wrap(Anope::string &param);
/** 'unwrap' this mode to our internal representation
*/
ChannelMode *Unwrap(Anope::string &param);
/** called when a mode is being unwrapped, and is asking us if we can unwrap it
*/
virtual ChannelMode *Unwrap(ChannelMode *, Anope::string &param);
};
/** This is a mode for lists, eg b/e/I. These modes should inherit from this
@@ -120,7 +137,7 @@ class CoreExport ChannelModeList : public ChannelMode
* @param mask The mask
* @return true for yes, false for no
*/
virtual bool IsValid(const Anope::string &mask) const { return true; }
virtual bool IsValid(Anope::string &mask) const;
/** Checks if mask affects user
* Should only be used for extbans or other weird ircd-specific things.
@@ -162,7 +179,7 @@ class CoreExport ChannelModeParam : public ChannelMode
* @param value The param
* @return true for yes, false for no
*/
virtual bool IsValid(const Anope::string &value) const { return true; }
virtual bool IsValid(Anope::string &value) const { return true; }
};
/** This is a mode that is a channel status, eg +v/h/o/a/q.
@@ -186,6 +203,27 @@ class CoreExport ChannelModeStatus : public ChannelMode
ChannelModeStatus(const Anope::string &name, char mc, char msymbol, short mlevel);
};
/** A virtual mode. This mode doesn't natively exist on the IRCd (like extbans),
* but we still have a representation for it.
*/
template<typename T>
class CoreExport ChannelModeVirtual : public T
{
Anope::string base;
ChannelMode *basech;
public:
ChannelModeVirtual(const Anope::string &mname, const Anope::string &basename);
~ChannelModeVirtual();
void Check() anope_override;
ChannelMode *Wrap(Anope::string &param) anope_override;
ChannelMode *Unwrap(ChannelMode *cm, Anope::string &param) = 0;
};
/* The status a user has on a channel (+v, +h, +o) etc */
class CoreExport ChannelStatus
{
@@ -225,7 +263,7 @@ class CoreExport ChannelModeKey : public ChannelModeParam
public:
ChannelModeKey(char mc) : ChannelModeParam("KEY", mc) { }
bool IsValid(const Anope::string &value) const anope_override;
bool IsValid(Anope::string &value) const anope_override;
};
/** This class is used for oper only channel modes
@@ -257,13 +295,6 @@ class CoreExport ChannelModeNoone : public ChannelMode
*/
class CoreExport ModeManager
{
protected:
/* Array of all modes Anope knows about. Modes are in this array at position
* modechar. Additionally, status modes are in this array (again) at statuschar.
*/
static std::vector<ChannelMode *> ChannelModes;
static std::vector<UserMode *> UserModes;
public:
/* Number of generic channel and user modes we are tracking */
@@ -377,6 +408,8 @@ class CoreExport Entry
*/
const Anope::string GetMask() const;
const Anope::string GetNUHMask() const;
/** Check if this entry matches a user
* @param u The user
* @param full True to match against a users real host and IP
+43 -22
View File
@@ -20,6 +20,7 @@
#include "timers.h"
#include "logger.h"
#include "extensible.h"
#include "version.h"
/** This definition is used as shorthand for the various classes
* and functions needed to make a module loadable by the OS.
@@ -40,6 +41,14 @@
extern "C" void AnopeFini(x *m) \
{ \
delete m; \
} \
extern "C" DllExport ModuleVersionC AnopeVersion() \
{ \
ModuleVersionC ver; \
ver.version_major = VERSION_MAJOR; \
ver.version_minor = VERSION_MINOR; \
ver.version_patch = VERSION_PATCH; \
return ver; \
}
#else
# define MODULE_INIT(x) \
@@ -50,6 +59,14 @@
extern "C" DllExport void AnopeFini(x *m) \
{ \
delete m; \
} \
extern "C" DllExport ModuleVersionC AnopeVersion() \
{ \
ModuleVersionC ver; \
ver.version_major = VERSION_MAJOR; \
ver.version_minor = VERSION_MINOR; \
ver.version_patch = VERSION_PATCH; \
return ver; \
}
#endif
@@ -173,6 +190,11 @@ enum
};
typedef unsigned short ModType;
struct ModuleVersionC
{
int version_major, version_minor, version_patch;
};
/** Returned by Module::GetVersion, used to see what version of Anope
* a module is compiled against.
*/
@@ -184,12 +206,7 @@ class ModuleVersion
int version_patch;
public:
/** Constructor
* @param major The major version number
* @param minor The minor version number
* @param patch The patch version number
*/
ModuleVersion(int major, int minor, int patch);
ModuleVersion(const ModuleVersionC &);
/** Get the major version of Anope this was built against
* @return The major version
@@ -279,11 +296,7 @@ class CoreExport Module : public Extensible
*/
void SetAuthor(const Anope::string &author);
/** Get the version of Anope this module was
* compiled against
* @return The version
*/
ModuleVersion GetVersion() const;
virtual void Prioritize();
/* Everything below here are events. Modules must ModuleManager::Attach to these events
* before they will be called.
@@ -472,11 +485,12 @@ class CoreExport Module : public Extensible
virtual void OnJoinChannel(User *u, Channel *c) { throw NotImplementedException(); }
/** Called when a new topic is set
* @param source The user changing the topic, if any
* @param c The channel
* @param setter The user who set the new topic
* @param setter The user who set the new topic, if there is no source
* @param topic The new topic
*/
virtual void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) { throw NotImplementedException(); }
virtual void OnTopicUpdated(User *source, Channel *c, const Anope::string &user, const Anope::string &topic) { throw NotImplementedException(); }
/** Called before a channel expires
* @param ci The channel
@@ -719,11 +733,6 @@ class CoreExport Module : public Extensible
*/
virtual void OnNickDrop(CommandSource &source, NickAlias *na) { throw NotImplementedException(); }
/** Called when a nick is forbidden
* @param na The nick alias of the forbidden nick
*/
virtual void OnNickForbidden(NickAlias *na) { throw NotImplementedException(); }
/** Called when a user groups their nick
* @param u The user grouping
* @param target The target they're grouping to
@@ -748,8 +757,15 @@ class CoreExport Module : public Extensible
/** Called when a nick is registered
* @param user The user registering the nick, of any
* @param The nick
* @param pass The password of the newly registered nick
*/
virtual void OnNickRegister(User *user, NickAlias *na) { throw NotImplementedException(); }
virtual void OnNickRegister(User *user, NickAlias *na, const Anope::string &pass) { throw NotImplementedException(); }
/** Called when a nick is confirmed. This will never be called if registration confirmation is not enabled.
* @param user The user confirming the nick
* @param The account being confirmed
*/
virtual void OnNickConfirm(User *user, NickCore *) { throw NotImplementedException(); }
/** Called when a nick is suspended
* @param na The nick alias
@@ -1010,7 +1026,7 @@ class CoreExport Module : public Extensible
* mostly to ensure mlock/+r are set.
* @param c The channel
*/
virtual void OnCheckModes(Channel *c) { throw NotImplementedException(); }
virtual void OnCheckModes(Reference<Channel> &c) { throw NotImplementedException(); }
/** Called when a channel is synced.
* Channels are synced after a sjoin is finished processing
@@ -1094,8 +1110,8 @@ enum Implementation
I_OnPreUserLogoff, I_OnPostUserLogoff, I_OnBotCreate, I_OnBotChange, I_OnBotDelete, I_OnAccessDel, I_OnAccessAdd,
I_OnAccessClear, I_OnLevelChange, I_OnChanDrop, I_OnChanRegistered, I_OnChanSuspend, I_OnChanUnsuspend,
I_OnCreateChan, I_OnDelChan, I_OnChannelCreate, I_OnChannelDelete, I_OnAkickAdd, I_OnAkickDel, I_OnCheckKick,
I_OnChanInfo, I_OnCheckPriv, I_OnGroupCheckPriv, I_OnNickDrop, I_OnNickForbidden, I_OnNickGroup, I_OnNickIdentify,
I_OnUserLogin, I_OnNickLogout, I_OnNickRegister, I_OnNickSuspend, I_OnNickUnsuspended, I_OnDelNick, I_OnNickCoreCreate,
I_OnChanInfo, I_OnCheckPriv, I_OnGroupCheckPriv, I_OnNickDrop, I_OnNickGroup, I_OnNickIdentify,
I_OnUserLogin, I_OnNickLogout, I_OnNickRegister, I_OnNickConfirm, I_OnNickSuspend, I_OnNickUnsuspended, I_OnDelNick, I_OnNickCoreCreate,
I_OnDelCore, I_OnChangeCoreDisplay, I_OnNickClearAccess, I_OnNickAddAccess, I_OnNickEraseAccess, I_OnNickClearCert,
I_OnNickAddCert, I_OnNickEraseCert, I_OnNickInfo, I_OnBotInfo, I_OnCheckAuthentication, I_OnNickUpdate,
I_OnFingerprint, I_OnUserAway, I_OnInvite, I_OnDeleteVhost, I_OnSetVhost, I_OnSetDisplayedHost, I_OnMemoSend, I_OnMemoDel,
@@ -1201,6 +1217,11 @@ class CoreExport ModuleManager
* @return MOD_ERR_OK on success, anything else on fail
*/
static ModuleReturn DeleteModule(Module *m);
/** Get the version of Anope the module was compiled against
* @return The version
*/
static ModuleVersion GetVersion(void *handle);
};
#endif // MODULES_H
+35
View File
@@ -0,0 +1,35 @@
/*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
*/
struct EntryMsg
{
Anope::string chan;
Anope::string creator;
Anope::string message;
time_t when;
virtual ~EntryMsg() { }
protected:
EntryMsg() { }
};
struct EntryMessageList : Serialize::Checker<std::vector<EntryMsg *> >
{
protected:
EntryMessageList() : Serialize::Checker<std::vector<EntryMsg *> >("EntryMsg") { }
public:
virtual ~EntryMessageList()
{
for (unsigned i = (*this)->size(); i > 0; --i)
delete (*this)->at(i - 1);
}
virtual EntryMsg* Create() = 0;
};
-20
View File
@@ -1,20 +0,0 @@
/* ChanServ core functions
*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
struct CSSuspendInfo
{
Anope::string chan, by, reason;
time_t time, expires;
virtual ~CSSuspendInfo() { }
protected:
CSSuspendInfo() { }
};
+16 -26
View File
@@ -1,8 +1,6 @@
#ifndef ANOPE_LDAP_H
#define ANOPE_LDAP_H
typedef int LDAPQuery;
class LDAPException : public ModuleException
{
public:
@@ -59,28 +57,26 @@ struct LDAPAttributes : public std::map<Anope::string, std::vector<Anope::string
}
};
enum QueryType
{
QUERY_UNKNOWN,
QUERY_BIND,
QUERY_SEARCH,
QUERY_ADD,
QUERY_DELETE,
QUERY_MODIFY
};
struct LDAPResult
{
std::vector<LDAPAttributes> messages;
Anope::string error;
enum QueryType
{
QUERY_UNKNOWN,
QUERY_BIND,
QUERY_SEARCH,
QUERY_ADD,
QUERY_DELETE,
QUERY_MODIFY
};
QueryType type;
LDAPQuery id;
LDAPResult()
{
this->type = QUERY_UNKNOWN;
this->id = -1;
}
size_t size() const
@@ -126,48 +122,42 @@ class LDAPProvider : public Service
/** Attempt to bind to the LDAP server as an admin
* @param i The LDAPInterface the result is sent to
* @return The query ID
*/
virtual LDAPQuery BindAsAdmin(LDAPInterface *i) = 0;
virtual void BindAsAdmin(LDAPInterface *i) = 0;
/** Bind to LDAP
* @param i The LDAPInterface the result is sent to
* @param who The binddn
* @param pass The password
* @return The query ID
*/
virtual LDAPQuery Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) = 0;
virtual void Bind(LDAPInterface *i, const Anope::string &who, const Anope::string &pass) = 0;
/** Search ldap for the specified filter
* @param i The LDAPInterface the result is sent to
* @param base The base DN to search
* @param filter The filter to apply
* @return The query ID
*/
virtual LDAPQuery Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) = 0;
virtual void Search(LDAPInterface *i, const Anope::string &base, const Anope::string &filter) = 0;
/** Add an entry to LDAP
* @param i The LDAPInterface the result is sent to
* @param dn The dn of the entry to add
* @param attributes The attributes
* @return The query ID
*/
virtual LDAPQuery Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) = 0;
virtual void Add(LDAPInterface *i, const Anope::string &dn, LDAPMods &attributes) = 0;
/** Delete an entry from LDAP
* @param i The LDAPInterface the result is sent to
* @param dn The dn of the entry to delete
* @return The query ID
*/
virtual LDAPQuery Del(LDAPInterface *i, const Anope::string &dn) = 0;
virtual void Del(LDAPInterface *i, const Anope::string &dn) = 0;
/** Modify an existing entry in LDAP
* @param i The LDAPInterface the result is sent to
* @param base The base DN to modify
* @param attributes The attributes to modify
* @return The query ID
*/
virtual LDAPQuery Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) = 0;
virtual void Modify(LDAPInterface *i, const Anope::string &base, LDAPMods &attributes) = 0;
};
#endif // ANOPE_LDAP_H
+9
View File
@@ -60,3 +60,12 @@ struct NSCertList
virtual void Check() = 0;
};
class CertService : public Service
{
public:
CertService(Module *c) : Service(c, "CertService", "certs") { }
virtual NickCore* FindAccountFromCert(const Anope::string &cert) = 0;
};
+6 -42
View File
@@ -10,7 +10,7 @@ enum ForbidType
FT_SIZE
};
struct ForbidData : Serializable
struct ForbidData
{
Anope::string mask;
Anope::string creator;
@@ -19,9 +19,9 @@ struct ForbidData : Serializable
time_t expires;
ForbidType type;
ForbidData() : Serializable("ForbidData") { }
void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
virtual ~ForbidData() { }
protected:
ForbidData() : created(0), expires(0) { }
};
class ForbidService : public Service
@@ -33,6 +33,8 @@ class ForbidService : public Service
virtual void RemoveForbid(ForbidData *d) = 0;
virtual ForbidData* CreateForbid() = 0;
virtual ForbidData *FindForbid(const Anope::string &mask, ForbidType type) = 0;
virtual std::vector<ForbidData *> GetForbids() = 0;
@@ -40,43 +42,5 @@ class ForbidService : public Service
static ServiceReference<ForbidService> forbid_service("ForbidService", "forbid");
void ForbidData::Serialize(Serialize::Data &data) const
{
data["mask"] << this->mask;
data["creator"] << this->creator;
data["reason"] << this->reason;
data["created"] << this->created;
data["expires"] << this->expires;
data["type"] << this->type;
}
Serializable* ForbidData::Unserialize(Serializable *obj, Serialize::Data &data)
{
if (!forbid_service)
return NULL;
ForbidData *fb;
if (obj)
fb = anope_dynamic_static_cast<ForbidData *>(obj);
else
fb = new ForbidData;
data["mask"] >> fb->mask;
data["creator"] >> fb->creator;
data["reason"] >> fb->reason;
data["created"] >> fb->created;
data["expires"] >> fb->expires;
unsigned int t;
data["type"] >> t;
fb->type = static_cast<ForbidType>(t);
if (t > FT_SIZE - 1)
return NULL;
if (!obj)
forbid_service->AddForbid(fb);
return fb;
}
#endif
+10 -44
View File
@@ -10,70 +10,36 @@
*/
struct IgnoreData : Serializable
struct IgnoreData
{
Anope::string mask;
Anope::string creator;
Anope::string reason;
time_t time; /* When do we stop ignoring them? */
IgnoreData() : Serializable("IgnoreData") { }
void Serialize(Serialize::Data &data) const anope_override;
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
virtual ~IgnoreData() { }
protected:
IgnoreData() : time(0) { }
};
class IgnoreService : public Service
{
protected:
std::list<IgnoreData> ignores;
IgnoreService(Module *c) : Service(c, "IgnoreService", "ignore") { }
public:
virtual IgnoreData* AddIgnore(const Anope::string &mask, const Anope::string &creator, const Anope::string &reason, time_t delta = Anope::CurTime) = 0;
virtual void AddIgnore(IgnoreData *) = 0;
virtual bool DelIgnore(const Anope::string &mask) = 0;
virtual void DelIgnore(IgnoreData *) = 0;
inline void ClearIgnores() { this->ignores.clear(); }
virtual void ClearIgnores() = 0;
virtual IgnoreData *Create() = 0;
virtual IgnoreData *Find(const Anope::string &mask) = 0;
inline std::list<IgnoreData> &GetIgnores() { return this->ignores; }
virtual std::vector<IgnoreData *> &GetIgnores() = 0;
};
static ServiceReference<IgnoreService> ignore_service("IgnoreService", "ignore");
void IgnoreData::Serialize(Serialize::Data &data) const
{
data["mask"] << this->mask;
data["creator"] << this->creator;
data["reason"] << this->reason;
data["time"] << this->time;
}
Serializable* IgnoreData::Unserialize(Serializable *obj, Serialize::Data &data)
{
if (!ignore_service)
return NULL;
if (obj)
{
IgnoreData *ign = anope_dynamic_static_cast<IgnoreData *>(obj);
data["mask"] >> ign->mask;
data["creator"] >> ign->creator;
data["reason"] >> ign->reason;
data["time"] >> ign->time;
return ign;
}
Anope::string smask, screator, sreason;
time_t t;
data["mask"] >> smask;
data["creator"] >> screator;
data["reason"] >> sreason;
data["time"] >> t;
return ignore_service->AddIgnore(smask, screator, sreason, t);
}
+1 -1
View File
@@ -7,7 +7,7 @@ struct Session
unsigned count; /* Number of clients with this host */
unsigned hits; /* Number of subsequent kills for a host */
Session(const Anope::string &ip, int len) : addr(ip, len), count(1), hits(0) { }
Session(const sockaddrs &ip, int len) : addr(ip, len), count(1), hits(0) { }
};
struct Exception : Serializable
+123
View File
@@ -0,0 +1,123 @@
/*
*
* (C) 2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
namespace SASL
{
struct Message
{
Anope::string source;
Anope::string target;
Anope::string type;
Anope::string data;
Anope::string ext;
};
class Mechanism;
struct Session;
class Service : public ::Service
{
public:
Service(Module *o) : ::Service(o, "SASL::Service", "sasl") { }
virtual void ProcessMessage(const Message &) = 0;
virtual Anope::string GetAgent() = 0;
virtual Session* GetSession(const Anope::string &uid) = 0;
virtual void SendMessage(SASL::Session *session, const Anope::string &type, const Anope::string &data) = 0;
virtual void Succeed(Session *, NickCore *) = 0;
virtual void Fail(Session *) = 0;
virtual void SendMechs(Session *) = 0;
virtual void DeleteSessions(Mechanism *, bool = false) = 0;
virtual void RemoveSession(Session *) = 0;
};
static ServiceReference<SASL::Service> sasl("SASL::Service", "sasl");
struct Session
{
time_t created;
Anope::string uid;
Reference<Mechanism> mech;
Session(Mechanism *m, const Anope::string &u) : created(Anope::CurTime), uid(u), mech(m) { }
virtual ~Session()
{
if (sasl)
sasl->RemoveSession(this);
}
};
/* PLAIN, EXTERNAL, etc */
class Mechanism : public ::Service
{
public:
Mechanism(Module *o, const Anope::string &sname) : Service(o, "SASL::Mechanism", sname) { }
virtual Session* CreateSession(const Anope::string &uid) { return new Session(this, uid); }
virtual void ProcessMessage(Session *session, const Message &) = 0;
virtual ~Mechanism()
{
if (sasl)
sasl->DeleteSessions(this, true);
}
};
class IdentifyRequest : public ::IdentifyRequest
{
Anope::string uid;
public:
IdentifyRequest(Module *m, const Anope::string &id, const Anope::string &acc, const Anope::string &pass) : ::IdentifyRequest(m, acc, pass), uid(id) { }
void OnSuccess() anope_override
{
if (!sasl)
return;
NickAlias *na = NickAlias::Find(GetAccount());
if (!na || na->nc->HasExt("NS_SUSPENDED"))
return OnFail();
Session *s = sasl->GetSession(uid);
if (s)
{
Log(Config->GetClient("NickServ")) << "A user identified to account " << this->GetAccount() << " using SASL";
sasl->Succeed(s, na->nc);
delete s;
}
}
void OnFail() anope_override
{
if (!sasl)
return;
Session *s = sasl->GetSession(uid);
if (s)
{
sasl->Fail(s);
delete s;
}
Anope::string accountstatus;
NickAlias *na = NickAlias::Find(GetAccount());
if (!na)
accountstatus = "nonexistent ";
else if (na->nc->HasExt("NS_SUSPENDED"))
accountstatus = "suspended ";
Log(Config->GetClient("NickServ")) << "A user failed to identify for " << accountstatus << "account " << this->GetAccount() << " using SASL";
}
};
}
+17
View File
@@ -0,0 +1,17 @@
/*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*/
struct MiscData
{
Anope::string object;
Anope::string name;
Anope::string data;
MiscData() { }
virtual ~MiscData() { }
};
@@ -1,5 +1,4 @@
/* NickServ core functions
*
/*
* (C) 2003-2014 Anope Team
* Contact us at team@anope.org
*
@@ -9,12 +8,11 @@
* Based on the original code of Services by Andy Church.
*/
struct NSSuspendInfo
struct SuspendInfo
{
Anope::string nick, by, reason;
Anope::string what, by, reason;
time_t when, expires;
virtual ~NSSuspendInfo() { }
protected:
NSSuspendInfo() { }
SuspendInfo() { }
virtual ~SuspendInfo() { }
};
+16
View File
@@ -40,6 +40,9 @@ class CoreExport IRCDProto : public Service
virtual void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf);
const Anope::string &GetProtocolName();
virtual void Parse(const Anope::string &, Anope::string &, Anope::string &, std::vector<Anope::string> &);
virtual Anope::string Format(const Anope::string &source, const Anope::string &message);
/* Modes used by default by our clients */
Anope::string DefaultPseudoclientModes;
/* Can we force change a users's nick? */
@@ -64,11 +67,17 @@ class CoreExport IRCDProto : public Service
bool CanCertFP;
/* Whether this IRCd requires unique IDs for each user or server. See TS6/P10. */
bool RequiresID;
/* If this IRCd has unique ids, whether the IDs and nicknames are ambiguous */
bool AmbiguousID;
/* The maximum number of modes we are allowed to set with one MODE command */
unsigned MaxModes;
/* The maximum number of bytes a line may have */
unsigned MaxLine;
/* Retrieves the next free UID or SID */
virtual Anope::string UID_Retrieve();
virtual Anope::string SID_Retrieve();
/** Sets the server in NOOP mode. If NOOP mode is enabled, no users
* will be able to oper on the server.
* @param s The server
@@ -111,6 +120,8 @@ class CoreExport IRCDProto : public Service
virtual void SendSQLine(User *, const XLine *x) { }
virtual void SendSQLineDel(const XLine *x) { }
virtual void SendKill(const MessageSource &source, const Anope::string &target, const Anope::string &reason);
/** Kills a user
* @param source Who is doing the kill
* @param user The user to be killed
@@ -217,6 +228,9 @@ class CoreExport IRCDProto : public Service
*/
virtual void SendOper(User *u);
virtual void SendSASLMessage(const SASL::Message &) { }
virtual void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) { }
virtual bool IsNickValid(const Anope::string &);
virtual bool IsChannelValid(const Anope::string &);
virtual bool IsIdentValid(const Anope::string &);
@@ -227,6 +241,8 @@ class CoreExport IRCDProto : public Service
* Defaults to Config->ListSize
*/
virtual unsigned GetMaxListFor(Channel *c);
virtual Anope::string NormalizeMask(const Anope::string &mask);
};
class CoreExport MessageSource
+5
View File
@@ -198,6 +198,11 @@ class CoreExport ChannelInfo : public Serializable, public Extensible
*/
void ClearAkick();
/** Get the level entries for the channel.
* @return The levels for the channel.
*/
const Anope::map<int16_t> &GetLevelEntries();
/** Get the level for a privilege
* @param priv The privilege name
* @return the level
+3 -3
View File
@@ -60,9 +60,9 @@ class CoreExport Serializable : public virtual Base
* constructed before other objects are if it isn't.
*/
static std::list<Serializable *> *SerializableItems;
friend class Serialize::Type;
/* The type of item this object is */
Serialize::Type *s_type;
private:
/* Iterator into serializable_items */
std::list<Serializable *>::iterator s_iter;
/* The hash of the last serialized form of this object commited to the database */
@@ -109,7 +109,7 @@ class CoreExport Serializable : public virtual Base
* of class that inherits from Serialiable. Used for unserializing objects
* of this type, as it requires a function pointer to a static member function.
*/
class CoreExport Serialize::Type
class CoreExport Serialize::Type : public Base
{
typedef Serializable* (*unserialize_func)(Serializable *obj, Serialize::Data &);
@@ -188,7 +188,7 @@ class Serialize::Checker
{
Anope::string name;
T obj;
mutable Serialize::Type *type;
mutable ::Reference<Serialize::Type> type;
inline void Check() const
{
-4
View File
@@ -23,10 +23,6 @@ extern CoreExport Server *Me;
namespace Servers
{
/* Retrieves the next free TS6 UID or SID */
extern CoreExport const Anope::string TS6_UID_Retrieve();
extern CoreExport const Anope::string TS6_SID_Retrieve();
/* Gets our uplink. Note we don't actually have an "uplink", this is just
* the only server whose uplink *is* Me that is not a juped server.
* @return Our uplink, or NULL if not uplinked to anything
+2 -2
View File
@@ -20,7 +20,7 @@
/** Anything that inherits from this class can be referred to
* using ServiceReference. Any interfaces provided by modules,
* such as commands, use this. This is also used for modules
* that publish a service (m_ssl, etc).
* that publish a service (m_ssl_openssl, etc).
*/
class CoreExport Service : public virtual Base
{
@@ -148,7 +148,7 @@ class ServiceReference : public Reference<T>
* creates its own service type (that other modules must include the header file
* for), as the core is not compiled with it so there is no RTTI for it.
*/
this->ref = static_cast<T *>(Service::FindService(this->type, this->name));
this->ref = static_cast<T *>(::Service::FindService(this->type, this->name));
if (this->ref)
this->ref->AddReference(this);
}
+5
View File
@@ -41,6 +41,11 @@ class CoreExport SocketEngine
/** Read from sockets and do things
*/
static void Process();
static int GetLastError();
static void SetLastError(int);
static bool IgnoreErrno();
};
#endif // SOCKETENGINE_H
+3 -4
View File
@@ -59,7 +59,7 @@ union CoreExport sockaddrs
/** Check if this sockaddr has data in it
*/
bool operator()() const;
bool valid() const;
/** Compares with sockaddr with another. Compares address type, port, and address
* @return true if they are the same
@@ -82,8 +82,6 @@ union CoreExport sockaddrs
* @throws A socket exception if given an invalid structure
*/
void ntop(int type, const void *src);
bool valid() const;
};
class CoreExport cidr
@@ -94,6 +92,7 @@ class CoreExport cidr
public:
cidr(const Anope::string &ip);
cidr(const Anope::string &ip, unsigned char len);
cidr(const sockaddrs &ip, unsigned char len);
Anope::string mask() const;
bool match(const sockaddrs &other);
bool valid() const;
@@ -347,7 +346,7 @@ class CoreExport BinarySocket : public virtual Socket
/** Write data to the socket
* @param buffer The data to write
* @param l The length of the data
* @param l The length of the data; if 0 then this function returns without doing anything
*/
virtual void Write(const char *buffer, size_t l);
void Write(const char *message, ...);
+1
View File
@@ -25,6 +25,7 @@ namespace Uplink
class UplinkSocket : public ConnectionSocket, public BufferedSocket
{
public:
bool error;
UplinkSocket();
~UplinkSocket();
bool ProcessRead() anope_override;
+8 -5
View File
@@ -20,6 +20,7 @@
#include "serialize.h"
#include "commands.h"
#include "account.h"
#include "sockets.h"
typedef Anope::hash_map<User *> user_map;
@@ -71,7 +72,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
/* SSL Fingerprint */
Anope::string fingerprint;
/* User's IP */
Anope::string ip;
sockaddrs ip;
/* Server user is connected to */
Server *server;
/* When the user signed on. Set on connect and never modified. */
@@ -92,6 +93,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
/* Last time this user sent an email */
time_t lastmail;
protected:
/** Create a new user object, initialising necessary fields and
* adds it to the hash
*
@@ -102,19 +104,20 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
* @param sip The ip of the user
* @param sserver The server of the user
* @param srealname The realname/gecos of teh user
* @param ssignon User's timestamp
* @param ts User's timestamp
* @param smodes User's modes
* @param suid The unique identifier of the user.
* @param nc The account the user is identified as, if any
*/
User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ssignon, const Anope::string &smodes, const Anope::string &suid, NickCore *nc);
User(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, const Anope::string &suid, NickCore *nc);
protected:
/** Destroy a user.
*/
virtual ~User();
public:
static User* OnIntroduce(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, const Anope::string &suid, NickCore *nc);
/** Update the nickname of a user record accordingly, should be
* called from ircd protocol.
* @param newnick The new username
@@ -323,7 +326,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe
/** Check if the user is protected from kicks and negative mode changes
* @return true or false
*/
bool IsProtected() const;
bool IsProtected();
/** Kill a user
* @param source The user/server doing the kill
+87 -35
View File
@@ -13,7 +13,7 @@
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <map>
static std::string get_git_hash(const std::string &git_dir)
{
@@ -45,29 +45,16 @@ static std::string get_git_hash(const std::string &git_dir)
return "g" + filebuf.substr(0, 7);
}
int main(int argc, char *argv[])
static bool read_version_sh(const std::string &version_sh, std::map<std::string, std::string> &versions)
{
if (argc < 3)
{
std::cerr << "Syntax: " << argv[0] << " <base> <version.h>" << std::endl;
return 1;
}
std::string version_sh = std::string(argv[1]) + "/src/version.sh";
std::string git_dir = std::string(argv[1]) + "/.git";
std::fstream fd;
fd.clear();
fd.open(version_sh.c_str(), std::ios::in);
std::fstream fd(version_sh.c_str(), std::ios::in);
if (!fd.is_open())
{
std::cerr << "Error: Unable to open src/version.sh for reading: " << version_sh << std::endl;
return 1;
return false;
}
std::string filebuf;
std::list<std::pair<std::string, std::string> > versions;
while (getline(fd, filebuf))
{
if (!filebuf.find("VERSION_"))
@@ -75,24 +62,25 @@ int main(int argc, char *argv[])
size_t eq = filebuf.find('=');
std::string type = filebuf.substr(0, eq);
std::string value = filebuf.substr(eq + 2, filebuf.length() - eq - 3);
versions.push_back(std::make_pair(type, value));
std::string value = filebuf.substr(eq + 1);
versions[type] = value;
}
}
fd.close();
std::string git_version = get_git_hash(git_dir);
if (!git_version.empty())
versions.push_back(std::make_pair("VERSION_GIT", git_version));
return true;
}
fd.clear();
fd.open(argv[2], std::ios::in);
static bool write_build_h(const std::string &buildh, const std::string &git_version)
{
std::fstream fd(buildh.c_str(), std::ios::in);
std::string build = "#define BUILD 1";
if (fd.is_open())
{
while (getline(fd, filebuf))
for (std::string filebuf; getline(fd, filebuf);)
{
if (!filebuf.find("#define BUILD"))
{
@@ -110,27 +98,91 @@ int main(int argc, char *argv[])
}
fd.clear();
fd.open(argv[2], std::ios::out);
fd.open(buildh.c_str(), std::ios::out);
if (!fd.is_open())
{
std::cerr << "Error: Unable to include/version.h for writing: " << argv[2] << std::endl;
return 1;
std::cerr << "Error: Unable to open build.h for writing: " << buildh << std::endl;
return false;
}
fd << "/* This file is automatically generated by version.cpp - do not edit it! */" << std::endl;
fd << build << std::endl;
if (!git_version.empty())
fd << "#define VERSION_GIT \"" << git_version << "\"" << std::endl;
fd.close();
for (std::list<std::pair<std::string, std::string> >::iterator it = versions.begin(), it_end = versions.end(); it != it_end; ++it)
return true;
}
static void read_version_h(const std::string &versionh, std::map<std::string, std::string> &versions)
{
std::fstream fd(versionh.c_str(), std::ios::in);
if (!fd.is_open())
return;
for (std::string filebuf; getline(fd, filebuf);)
{
if (it->first == "VERSION_EXTRA" || it->first == "VERSION_GIT")
fd << "#define " << it->first << " \"" << it->second << "\"" << std::endl;
else
fd << "#define " << it->first << " " << it->second << std::endl;
if (!filebuf.find("#define VERSION_"))
{
size_t space = filebuf.substr(8).find(' ');
std::string name = filebuf.substr(8).substr(0, space),
version = filebuf.substr(8).substr(space + 1);
versions[name] = version;
}
}
fd << build << std::endl;
fd.close();
}
static bool write_version_h(const std::string &versionh, const std::map<std::string, std::string> &versions)
{
std::fstream fd(versionh.c_str(), std::ios::out);
if (!fd.is_open())
return false;
for (std::map<std::string, std::string>::const_iterator it = versions.begin(); it != versions.end(); ++it)
{
fd << "#define " << it->first << " " << it->second << std::endl;
}
fd.close();
return true;
}
int main(int argc, char *argv[])
{
if (argc < 4)
{
std::cerr << "Syntax: " << argv[0] << " <base> <version.h> <build.h>" << std::endl;
return 1;
}
std::string version_sh = std::string(argv[1]) + "/src/version.sh";
std::string git_dir = std::string(argv[1]) + "/.git";
std::string versionh = argv[2];
std::string buildh = argv[3];
std::map<std::string, std::string> versions, old_versions;
if (!read_version_sh(version_sh, versions))
return -1;
std::string git_version = get_git_hash(git_dir);
if (!write_build_h(buildh, git_version))
return -1;
read_version_h(versionh, old_versions);
if (versions == old_versions)
return 0;
if (!write_version_h(versionh, versions))
return -1;
return 0;
}
+8 -5
View File
@@ -12,12 +12,15 @@
#include "serialize.h"
#include "service.h"
#include "sockets.h"
/* An Xline, eg, anything added with operserv/akill, or any of the operserv/sxline commands */
class CoreExport XLine : public Serializable
{
void InitRegex();
void Init();
Anope::string nick, user, host, real;
public:
cidr *c;
Anope::string mask;
Regex *regex;
Anope::string by;
@@ -32,10 +35,10 @@ class CoreExport XLine : public Serializable
XLine(const Anope::string &mask, const Anope::string &by, const time_t expires, const Anope::string &reason, const Anope::string &uid = "");
~XLine();
Anope::string GetNick() const;
Anope::string GetUser() const;
Anope::string GetHost() const;
Anope::string GetReal() const;
const Anope::string &GetNick() const;
const Anope::string &GetUser() const;
const Anope::string &GetHost() const;
const Anope::string &GetReal() const;
Anope::string GetReason() const;
+664 -635
View File
File diff suppressed because it is too large Load Diff
+671 -637
View File
File diff suppressed because it is too large Load Diff
+671 -635
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+956 -1005
View File
File diff suppressed because it is too large Load Diff
+2484 -2405
View File
File diff suppressed because it is too large Load Diff
+662 -633
View File
File diff suppressed because it is too large Load Diff
+3264 -3890
View File
File diff suppressed because it is too large Load Diff
+1018 -974
View File
File diff suppressed because it is too large Load Diff
+662 -633
View File
File diff suppressed because it is too large Load Diff
+662 -631
View File
File diff suppressed because it is too large Load Diff
+668 -639
View File
File diff suppressed because it is too large Load Diff
+662 -633
View File
File diff suppressed because it is too large Load Diff
+1 -5
View File
@@ -5,11 +5,7 @@ touch anope.pot
cd ..
FILES=`find ./ -name *.cpp -o -name *.h -o -name *.conf | grep -v /modules/third/`
for f in $FILES
do
xgettext -E -C -s -d Anope -j -o language/anope.pot --from-code=utf-8 --keyword --keyword=_ $f
done
xgettext -E -C -s -d Anope -j -o language/anope.pot --from-code=utf-8 --keyword --keyword=_ $FILES
cd -
for f in *.po
+1 -1
View File
@@ -50,7 +50,7 @@ macro(build_modules SRC)
add_library(${SO} MODULE ${MODULE_SRC})
# Windows requires this because it's weird
if(WIN32)
set(WIN32_NO_LIBS "/nodefaultlib:\"libcmt.lib\"")
set(WIN32_NO_LIBS "/nodefaultlib:\"libcmt.lib\" /OPT:NOREF")
else(WIN32)
set(WIN32_NO_LIBS)
endif(WIN32)
+1 -1
View File
@@ -22,7 +22,7 @@ class BSAutoAssign : public Module
if (bot.empty())
return;
BotInfo *bi = BotInfo::Find(bot);
BotInfo *bi = BotInfo::Find(bot, true);
if (bi == NULL)
{
Log(this) << "bs_autoassign is configured to assign bot " << bot << ", but it does not exist?";
+4 -4
View File
@@ -75,7 +75,7 @@ class CommandBSAssign : public Command
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Assigns a bot pointed out by nick to a channel. You\n"
source.Reply(_("Assigns the specified bot to a channel. You\n"
"can then configure the bot for the channel so it fits\n"
"your needs."));
return true;
@@ -121,7 +121,7 @@ class CommandBSUnassign : public Command
if (ci->HasExt("PERSIST") && !ModeManager::FindChannelModeByName("PERM"))
{
source.Reply(_("You can not unassign bots while persist is set on the channel."));
source.Reply(_("You cannot unassign bots while persist is set on the channel."));
return;
}
@@ -195,9 +195,9 @@ class CommandBSSetNoBot : public Command
{
this->SendSyntax(source);
source.Reply(_(" \n"
"This option makes a channel be unassignable. If a bot\n"
"This option makes a channel unassignable. If a bot\n"
"is already assigned to the channel, it is unassigned\n"
"automatically when you enable the option."));
"automatically when you enable it."));
return true;
}
};
+4 -3
View File
@@ -138,7 +138,8 @@ Serializable* BadWordImpl::Unserialize(Serializable *obj, Serialize::Data &data)
bw->type = static_cast<BadWordType>(n);
BadWordsImpl *bws = ci->Require<BadWordsImpl>("badwords");
bws->badwords->push_back(bw);
if (!obj)
bws->badwords->push_back(bw);
return bw;
}
@@ -400,7 +401,7 @@ class CommandBSBadwords : public Command
if (Anope::ReadOnly)
{
source.Reply(_("Sorry, channel bad words list modification is temporarily disabled."));
source.Reply(_("Sorry, bad words list modification is temporarily disabled."));
return;
}
@@ -446,7 +447,7 @@ class CommandBSBadwords : public Command
" Lists bad words entries numbered 2 through 5 and\n"
" 7 through 9.\n"
" \n"
"The \002CLEAR\002 command clears all entries of the\n"
"The \002CLEAR\002 command clears all entries from the\n"
"bad words list."));
return true;
}
+8 -16
View File
@@ -139,7 +139,7 @@ class CommandBSBot : public Command
*/
if (nick.equals_cs(bi->nick) && (!user.empty() ? user.equals_cs(bi->GetIdent()) : 1) && (!host.empty() ? host.equals_cs(bi->host) : 1) && (!real.empty() ? real.equals_cs(bi->realname) : 1))
{
source.Reply(_("Old info is equal to the new one."));
source.Reply(_("The old information is the same as the new information specified."));
return;
}
@@ -189,7 +189,10 @@ class CommandBSBot : public Command
}
if (!user.empty())
{
IRCD->SendQuit(bi, "Quit: Be right back");
bi->introduced = false;
}
else
IRCD->SendNickChange(bi, nick);
@@ -204,18 +207,7 @@ class CommandBSBot : public Command
bi->realname = real;
if (!user.empty())
{
IRCD->SendClientIntroduction(bi);
unsigned minusers = Config->GetBlock("botserv")->Get<unsigned>("minusers");
const std::set<ChannelInfo *> &channels = bi->GetChannels();
for (std::set<ChannelInfo *>::const_iterator it = channels.begin(), it_end = channels.end(); it != it_end; ++it)
{
const ChannelInfo *ci = *it;
if (ci->c && ci->c->users.size() >= minusers)
bi->Join(ci->c);
}
}
bi->OnKill();
source.Reply(_("Bot \002%s\002 has been changed to %s!%s@%s (%s)."), oldnick.c_str(), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
Log(LOG_ADMIN, source, this) << "CHANGE " << oldnick << " to " << bi->GetMask() << " " << bi->realname;
@@ -349,13 +341,13 @@ class CommandBSBot : public Command
"hostname and realname. Since no integrity checks are done\n"
"for these settings, be really careful.\n"
" \n"
"\002BOT CHANGE\002 allows to change the nickname, username, hostname\n"
"or realname of a bot without actually having to delete it (and\n"
"\002BOT CHANGE\002 allows you to change the nickname, username, hostname\n"
"or realname of a bot without deleting it (and\n"
"all the data associated with it).\n"
" \n"
"\002BOT DEL\002 removes the given bot from the bot list.\n"
" \n"
"\002Note\002: you cannot create a bot that has a nick that is\n"
"\002Note\002: You cannot create a bot with a nick that is\n"
"currently registered. If an unregistered user is currently\n"
"using the nick, they will be killed."));
return true;
+3 -3
View File
@@ -16,7 +16,7 @@ class CommandBSSay : public Command
public:
CommandBSSay(Module *creator) : Command(creator, "botserv/say", 2, 2)
{
this->SetDesc(_("Makes the bot say the given text on the given channel"));
this->SetDesc(_("Makes the bot say the specified text on the specified channel"));
this->SetSyntax(_("\037channel\037 \037text\037"));
}
@@ -66,7 +66,7 @@ class CommandBSSay : public Command
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Makes the bot say the given text on the given channel."));
source.Reply(_("Makes the bot say the specified text on the specified channel."));
return true;
}
};
@@ -125,7 +125,7 @@ class CommandBSAct : public Command
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Makes the bot do the equivalent of a \"/me\" command\n"
"on the given channel using the given text."));
"on the specified channel using the specified text."));
return true;
}
};
+7 -7
View File
@@ -230,12 +230,12 @@ class CommandBSKickBase : public Command
source.Reply(_("Bot will now kick for \002%s\002."), optname.c_str());
bool override = !source.AccessFor(ci).HasPriv("SET");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable the " << optname << "kicker";
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to enable the " << optname << " kicker";
}
else if (param.equals_ci("OFF"))
{
bool override = !source.AccessFor(ci).HasPriv("SET");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable the " << optname << "kicker";
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable the " << optname << " kicker";
val = false;
source.Reply(_("Bot won't kick for \002%s\002 anymore."), optname.c_str());
@@ -325,7 +325,7 @@ class CommandBSKickBolds : public CommandBSKickBase
public:
CommandBSKickBolds(Module *creator) : CommandBSKickBase(creator, "botserv/kick/bolds", 2, 3)
{
this->SetDesc(_("Configures badwords kicker"));
this->SetDesc(_("Configures bolds kicker"));
this->SetSyntax(_("\037channel\037 {\037ON|OFF\037} [\037ttb\037]"));
}
@@ -514,7 +514,7 @@ class CommandBSKickFlood : public CommandBSKickBase
try
{
i = convertTo<int16_t>(ttb);
if (i < 1)
if (i < 0)
throw ConvertException();
}
catch (const ConvertException &)
@@ -1038,8 +1038,8 @@ class BSKick : public Module
void check_ban(ChannelInfo *ci, User *u, KickerData *kd, int ttbtype)
{
/* Don't ban ulines */
if (u->server->IsULined())
/* Don't ban ulines or protected users */
if (u->IsProtected())
return;
BanData::Data &bd = this->GetBanData(u, ci->c);
@@ -1065,7 +1065,7 @@ class BSKick : public Module
va_list args;
char buf[1024];
if (!ci || !ci->bi || !ci->c || !u || u->server->IsULined() || !ci->c->FindUser(u))
if (!ci || !ci->bi || !ci->c || !u || u->IsProtected() || !ci->c->FindUser(u))
return;
Anope::string fmt = Language::Translate(u, message);
+10 -1
View File
@@ -32,6 +32,8 @@ class CommandBSSet : public Command
source.Reply(_("Configures bot options.\n"
" \n"
"Available options:"));
bool hide_privileged_commands = Config->GetBlock("options")->Get<bool>("hideprivilegedcommands"),
hide_registered_commands = Config->GetBlock("options")->Get<bool>("hideregisteredcommands");
Anope::string this_name = source.command;
for (CommandInfo::map::const_iterator it = source.service->commands.begin(), it_end = source.service->commands.end(); it != it_end; ++it)
{
@@ -42,6 +44,13 @@ class CommandBSSet : public Command
ServiceReference<Command> command("Command", info.name);
if (command)
{
// XXX dup
if (hide_registered_commands && !command->AllowUnregistered() && !source.GetAccount())
continue;
if (hide_privileged_commands && !info.permission.empty() && !source.HasCommand(info.permission))
continue;
source.command = it->first;
command->OnServHelp(source);
}
@@ -100,7 +109,7 @@ class CommandBSSetBanExpire : public Command
if (Anope::ReadOnly)
{
source.Reply(_("Sorry, bot option setting is temporarily disabled."));
source.Reply(_("Sorry, changing bot options is temporarily disabled."));
return;
}
+23 -17
View File
@@ -122,6 +122,7 @@ class CommandCSAccess : public Command
tmp_access.level = level;
bool override = false;
const NickAlias *na = NULL;
if ((!highest || *highest <= tmp_access) && !u_access.founder)
{
@@ -158,7 +159,8 @@ class CommandCSAccess : public Command
}
else
{
const NickAlias *na = NickAlias::Find(mask);
na = NickAlias::Find(mask);
if (!na && Config->GetModule("chanserv")->Get<bool>("disallow_hostmask_access"))
{
source.Reply(_("Masks and unregistered users may not be on access lists."));
@@ -175,12 +177,15 @@ class CommandCSAccess : public Command
return;
}
}
if (na)
mask = na->nick;
}
for (unsigned i = ci->GetAccessCount(); i > 0; --i)
{
const ChanAccess *access = ci->GetAccess(i - 1);
if (mask.equals_ci(access->mask))
if ((na && na->nc == access->GetAccount()) || mask.equals_ci(access->Mask()))
{
/* Don't allow lowering from a level >= u_level */
if ((!highest || *access >= *highest) && !u_access.founder && !source.HasPriv("chanserv/access/modify"))
@@ -204,8 +209,7 @@ class CommandCSAccess : public Command
if (!provider)
return;
AccessChanAccess *access = anope_dynamic_static_cast<AccessChanAccess *>(provider->Create());
access->ci = ci;
access->mask = mask;
access->SetMask(mask, ci);
access->creator = source.GetNick();
access->level = level;
access->last_seen = 0;
@@ -216,9 +220,9 @@ class CommandCSAccess : public Command
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to add " << mask << " with level " << level;
if (p != NULL)
source.Reply(_("\002%s\002 added to %s access list at privilege %s (level %d)"), access->mask.c_str(), ci->name.c_str(), p->name.c_str(), level);
source.Reply(_("\002%s\002 added to %s access list at privilege %s (level %d)"), access->Mask().c_str(), ci->name.c_str(), p->name.c_str(), level);
else
source.Reply(_("\002%s\002 added to %s access list at level \002%d\002."), access->mask.c_str(), ci->name.c_str(), level);
source.Reply(_("\002%s\002 added to %s access list at level \002%d\002."), access->Mask().c_str(), ci->name.c_str(), level);
}
void DoDel(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> &params)
@@ -284,7 +288,7 @@ class CommandCSAccess : public Command
AccessGroup ag = source.AccessFor(ci);
const ChanAccess *u_highest = ag.Highest();
if ((!u_highest || *u_highest <= *access) && !ag.founder && !this->override && !access->mask.equals_ci(source.nc->display))
if ((!u_highest || *u_highest <= *access) && !ag.founder && !this->override && access->GetAccount() != source.nc)
{
denied = true;
return;
@@ -292,9 +296,9 @@ class CommandCSAccess : public Command
++deleted;
if (!Nicks.empty())
Nicks += ", " + access->mask;
Nicks += ", " + access->Mask();
else
Nicks = access->mask;
Nicks = access->Mask();
ci->EraseAccess(Number - 1);
@@ -313,15 +317,15 @@ class CommandCSAccess : public Command
for (unsigned i = ci->GetAccessCount(); i > 0; --i)
{
ChanAccess *access = ci->GetAccess(i - 1);
if (mask.equals_ci(access->mask))
if (mask.equals_ci(access->Mask()))
{
if (!access->mask.equals_ci(source.nc->display) && !u_access.founder && (!highest || *highest <= *access) && !source.HasPriv("chanserv/access/modify"))
if (access->GetAccount() != source.nc && !u_access.founder && (!highest || *highest <= *access) && !source.HasPriv("chanserv/access/modify"))
source.Reply(ACCESS_DENIED);
else
{
source.Reply(_("\002%s\002 deleted from %s access list."), access->mask.c_str(), ci->name.c_str());
bool override = !u_access.founder && !u_access.HasPriv("ACCESS_CHANGE") && !access->mask.equals_ci(source.nc->display);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to delete " << access->mask;
source.Reply(_("\002%s\002 deleted from %s access list."), access->Mask().c_str(), ci->name.c_str());
bool override = !u_access.founder && !u_access.HasPriv("ACCESS_CHANGE") && access->GetAccount() != source.nc;
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to delete " << access->Mask();
ci->EraseAccess(i - 1);
FOREACH_MOD(OnAccessDel, (ci, source, access));
@@ -381,7 +385,7 @@ class CommandCSAccess : public Command
ListFormatter::ListEntry entry;
entry["Number"] = stringify(number);
entry["Level"] = access->AccessSerialize();
entry["Mask"] = access->mask;
entry["Mask"] = access->Mask();
entry["By"] = access->creator;
entry["Last seen"] = timebuf;
this->list.AddEntry(entry);
@@ -396,7 +400,7 @@ class CommandCSAccess : public Command
{
const ChanAccess *access = ci->GetAccess(i);
if (!nick.empty() && !Anope::Match(access->mask, nick))
if (!nick.empty() && !Anope::Match(access->Mask(), nick))
continue;
Anope::string timebuf;
@@ -418,7 +422,7 @@ class CommandCSAccess : public Command
ListFormatter::ListEntry entry;
entry["Number"] = stringify(i + 1);
entry["Level"] = access->AccessSerialize();
entry["Mask"] = access->mask;
entry["Mask"] = access->Mask();
entry["By"] = access->creator;
entry["Last seen"] = timebuf;
list.AddEntry(entry);
@@ -519,6 +523,8 @@ class CommandCSAccess : public Command
bool has_access = false;
if (source.HasPriv("chanserv/access/modify"))
has_access = true;
else if (is_list && source.HasPriv("chanserv/access/list"))
has_access = true;
else if (is_list && source.AccessFor(ci).HasPriv("ACCESS_LIST"))
has_access = true;
else if (source.AccessFor(ci).HasPriv("ACCESS_CHANGE"))
+12 -4
View File
@@ -71,10 +71,10 @@ class CommandCSAKick : public Command
/* Check excepts BEFORE we get this far */
if (ci->c)
{
std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> modes = ci->c->GetModeList("EXCEPT");
for (; modes.first != modes.second; ++modes.first)
std::vector<Anope::string> modes = ci->c->GetModeList("EXCEPT");
for (unsigned int i = 0; i < modes.size(); ++i)
{
if (Anope::Match(modes.first->second, mask))
if (Anope::Match(modes[i], mask))
{
source.Reply(CHAN_EXCEPTED, mask.c_str(), ci->name.c_str());
return;
@@ -441,9 +441,17 @@ class CommandCSAKick : public Command
return;
}
bool is_list = cmd.equals_ci("LIST") || cmd.equals_ci("VIEW");
bool has_access = false;
if (source.AccessFor(ci).HasPriv("AKICK") || source.HasPriv("chanserv/access/modify"))
has_access = true;
else if (is_list && source.HasPriv("chanserv/access/list"))
has_access = true;
if (mask.empty() && (cmd.equals_ci("ADD") || cmd.equals_ci("DEL")))
this->OnSyntaxError(source, cmd);
else if (!source.AccessFor(ci).HasPriv("AKICK") && !source.HasPriv("chanserv/access/modify"))
else if (!has_access)
source.Reply(ACCESS_DENIED);
else if (!cmd.equals_ci("LIST") && !cmd.equals_ci("VIEW") && !cmd.equals_ci("ENFORCE") && Anope::ReadOnly)
source.Reply(_("Sorry, channel autokick list modification is temporarily disabled."));
+47 -24
View File
@@ -19,15 +19,16 @@ class TempBan : public Timer
private:
Anope::string channel;
Anope::string mask;
Anope::string mode;
public:
TempBan(time_t seconds, Channel *c, const Anope::string &banmask) : Timer(me, seconds), channel(c->name), mask(banmask) { }
TempBan(time_t seconds, Channel *c, const Anope::string &banmask, const Anope::string &mod) : Timer(me, seconds), channel(c->name), mask(banmask), mode(mod) { }
void Tick(time_t ctime) anope_override
{
Channel *c = Channel::Find(this->channel);
if (c)
c->RemoveMode(NULL, "BAN", this->mask);
c->RemoveMode(NULL, mode, this->mask);
}
};
@@ -43,6 +44,8 @@ class CommandCSBan : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
const Anope::string &chan = params[0];
Configuration::Block *block = Config->GetCommand(source);
const Anope::string &mode = block->Get<Anope::string>("mode", "BAN");
ChannelInfo *ci = ChannelInfo::Find(chan);
if (ci == NULL)
@@ -57,9 +60,9 @@ class CommandCSBan : public Command
source.Reply(CHAN_X_NOT_IN_USE, chan.c_str());
return;
}
else if (IRCD->GetMaxListFor(c) && c->HasMode("BAN") >= IRCD->GetMaxListFor(c))
else if (IRCD->GetMaxListFor(c) && c->HasMode(mode) >= IRCD->GetMaxListFor(c))
{
source.Reply(_("The ban list for %s is full."), c->name.c_str());
source.Reply(_("The %s list for %s is full."), mode.lower().c_str(), c->name.c_str());
return;
}
@@ -98,6 +101,9 @@ class CommandCSBan : public Command
if (reason.length() > reasonmax)
reason = reason.substr(0, reasonmax);
Anope::string signkickformat = Config->GetModule("chanserv")->Get<Anope::string>("signkickformat", "%m (%n)");
signkickformat = signkickformat.replace_all_cs("%n", source.GetNick());
User *u = source.GetUser();
User *u2 = User::Find(target, true);
@@ -126,12 +132,12 @@ class CommandCSBan : public Command
bool override = !u_access.HasPriv("BAN") || (u != u2 && ci->HasExt("PEACE") && u2_access >= u_access);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "for " << mask;
if (!c->HasMode("BAN", mask))
if (!c->HasMode(mode, mask))
{
c->SetMode(NULL, "BAN", mask);
c->SetMode(NULL, mode, mask);
if (ban_time)
{
new TempBan(ban_time, c, mask);
new TempBan(ban_time, c, mask, mode);
source.Reply(_("Ban on \002%s\002 expires in %s."), mask.c_str(), Anope::Duration(ban_time, source.GetAccount()).c_str());
}
}
@@ -140,25 +146,34 @@ class CommandCSBan : public Command
if (!c->FindUser(u2))
return;
if (ci->HasExt("SIGNKICK") || (ci->HasExt("SIGNKICK_LEVEL") && !source.AccessFor(ci).HasPriv("SIGNKICK")))
c->Kick(ci->WhoSends(), u2, "%s (%s)", reason.c_str(), source.GetNick().c_str());
else
c->Kick(ci->WhoSends(), u2, "%s", reason.c_str());
if (block->Get<bool>("kick", "yes"))
{
if (ci->HasExt("SIGNKICK") || (ci->HasExt("SIGNKICK_LEVEL") && !source.AccessFor(ci).HasPriv("SIGNKICK")))
{
signkickformat = signkickformat.replace_all_cs("%m", reason);
c->Kick(ci->WhoSends(), u2, "%s", signkickformat.c_str());
}
else
c->Kick(ci->WhoSends(), u2, "%s", reason.c_str());
}
}
}
else
{
bool founder = u_access.HasPriv("FOUNDER");
bool override = !founder && !u_access.HasPriv("BAN");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "for " << target;
if (!c->HasMode("BAN", target))
Anope::string mask = IRCD->NormalizeMask(target);
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "for " << mask;
if (!c->HasMode(mode, mask))
{
c->SetMode(NULL, "BAN", target);
c->SetMode(NULL, mode, mask);
if (ban_time)
{
new TempBan(ban_time, c, target);
source.Reply(_("Ban on \002%s\002 expires in %s."), target.c_str(), Anope::Duration(ban_time, source.GetAccount()).c_str());
new TempBan(ban_time, c, mask, mode);
source.Reply(_("Ban on \002%s\002 expires in %s."), mask.c_str(), Anope::Duration(ban_time, source.GetAccount()).c_str());
}
}
@@ -168,7 +183,8 @@ class CommandCSBan : public Command
ChanUserContainer *uc = it->second;
++it;
if (Anope::Match(uc->user->nick, target) || Anope::Match(uc->user->GetDisplayedMask(), target))
Entry e(mode, mask);
if (e.Matches(uc->user))
{
++matched;
@@ -183,18 +199,25 @@ class CommandCSBan : public Command
else if (uc->user->IsProtected())
continue;
++kicked;
if (ci->HasExt("SIGNKICK") || (ci->HasExt("SIGNKICK_LEVEL") && !u_access.HasPriv("SIGNKICK")))
c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s) (%s)", reason.c_str(), target.c_str(), source.GetNick().c_str());
else
c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s)", reason.c_str(), target.c_str());
if (block->Get<bool>("kick", "yes"))
{
++kicked;
if (ci->HasExt("SIGNKICK") || (ci->HasExt("SIGNKICK_LEVEL") && !u_access.HasPriv("SIGNKICK")))
{
reason += " (Matches " + mask + ")";
signkickformat = signkickformat.replace_all_cs("%m", reason);
c->Kick(ci->WhoSends(), uc->user, "%s", signkickformat.c_str());
}
else
c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s)", reason.c_str(), mask.c_str());
}
}
}
if (matched)
source.Reply(_("Kicked %d/%d users matching %s from %s."), kicked, matched, target.c_str(), c->name.c_str());
source.Reply(_("Kicked %d/%d users matching %s from %s."), kicked, matched, mask.c_str(), c->name.c_str());
else
source.Reply(_("No users on %s match %s."), c->name.c_str(), target.c_str());
source.Reply(_("No users on %s match %s."), c->name.c_str(), mask.c_str());
}
}
+122 -68
View File
@@ -14,6 +14,100 @@
class CommandCSClone : public Command
{
void CopySetting(ChannelInfo *ci, ChannelInfo *target_ci, const Anope::string &setting)
{
if (ci->HasExt(setting))
target_ci->Extend<bool>(setting);
}
void CopyAccess(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
{
std::set<Anope::string> masks;
unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1024");
unsigned count = 0;
for (unsigned i = 0; i < target_ci->GetAccessCount(); ++i)
masks.insert(target_ci->GetAccess(i)->Mask());
for (unsigned i = 0; i < ci->GetAccessCount(); ++i)
{
const ChanAccess *taccess = ci->GetAccess(i);
AccessProvider *provider = taccess->provider;
if (access_max && target_ci->GetDeepAccessCount() >= access_max)
break;
if (masks.count(taccess->Mask()))
continue;
masks.insert(taccess->Mask());
ChanAccess *newaccess = provider->Create();
newaccess->SetMask(taccess->Mask(), target_ci);
newaccess->creator = taccess->creator;
newaccess->last_seen = taccess->last_seen;
newaccess->created = taccess->created;
newaccess->AccessUnserialize(taccess->AccessSerialize());
target_ci->AddAccess(newaccess);
++count;
}
source.Reply(_("%d access entries from \002%s\002 have been cloned to \002%s\002."), count, ci->name.c_str(), target_ci->name.c_str());
}
void CopyAkick(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
{
target_ci->ClearAkick();
for (unsigned i = 0; i < ci->GetAkickCount(); ++i)
{
const AutoKick *akick = ci->GetAkick(i);
if (akick->nc)
target_ci->AddAkick(akick->creator, akick->nc, akick->reason, akick->addtime, akick->last_used);
else
target_ci->AddAkick(akick->creator, akick->mask, akick->reason, akick->addtime, akick->last_used);
}
source.Reply(_("All akick entries from \002%s\002 have been cloned to \002%s\002."), ci->name.c_str(), target_ci->name.c_str());
}
void CopyBadwords(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
{
BadWords *target_badwords = target_ci->Require<BadWords>("badwords"),
*badwords = ci->Require<BadWords>("badwords");
if (!target_badwords || !badwords)
{
source.Reply(ACCESS_DENIED); // BotServ doesn't exist/badwords isn't loaded
return;
}
target_badwords->ClearBadWords();
for (unsigned i = 0; i < badwords->GetBadWordCount(); ++i)
{
const BadWord *bw = badwords->GetBadWord(i);
target_badwords->AddBadWord(bw->word, bw->type);
}
badwords->Check();
target_badwords->Check();
source.Reply(_("All badword entries from \002%s\002 have been cloned to \002%s\002."), ci->name.c_str(), target_ci->name.c_str());
}
void CopyLevels(CommandSource &source, ChannelInfo *ci, ChannelInfo *target_ci)
{
const Anope::map<int16_t> &cilevels = ci->GetLevelEntries();
for (Anope::map<int16_t>::const_iterator it = cilevels.begin(); it != cilevels.end(); ++it)
{
target_ci->SetLevel(it->first, it->second);
}
source.Reply(_("All level entries from \002%s\002 have been cloned into \002%s\002."), ci->name.c_str(), target_ci->name.c_str());
}
public:
CommandCSClone(Module *creator) : Command(creator, "chanserv/clone", 2, 3)
{
@@ -49,6 +143,13 @@ public:
source.Reply(CHAN_X_NOT_REGISTERED, target.c_str());
return;
}
if (ci == target_ci)
{
source.Reply(_("Cannot clone channel \002%s\002 to itself!"), target.c_str());
return;
}
if (!source.IsFounder(ci) || !source.IsFounder(target_ci))
{
if (!source.HasPriv("chanserv/administration"))
@@ -93,83 +194,36 @@ public:
else
target_ci->last_topic_setter = source.service->nick;
const Anope::string settings[] = { "NOAUTOOP", "CS_KEEP_MODES", "PEACE", "PERSIST", "RESTRICTED",
"CS_SECURE", "SECUREFOUNDER", "SECUREOPS", "SIGNKICK", "SIGNKICK_LEVEL", "CS_NO_EXPIRE" };
for (unsigned int i = 0; i < sizeof(settings) / sizeof(Anope::string); ++i)
CopySetting(ci, target_ci, settings[i]);
CopyAccess(source, ci, target_ci);
CopyAkick(source, ci, target_ci);
CopyBadwords(source, ci, target_ci);
CopyLevels(source, ci, target_ci);
FOREACH_MOD(OnChanRegistered, (target_ci));
source.Reply(_("All settings from \002%s\002 have been cloned to \002%s\002."), channel.c_str(), target.c_str());
source.Reply(_("All settings from \002%s\002 have been cloned to \002%s\002."), ci->name.c_str(), target_ci->name.c_str());
}
else if (what.equals_ci("ACCESS"))
{
std::set<Anope::string> masks;
unsigned access_max = Config->GetModule("chanserv")->Get<unsigned>("accessmax", "1024");
unsigned count = 0;
for (unsigned i = 0; i < target_ci->GetAccessCount(); ++i)
masks.insert(target_ci->GetAccess(i)->mask);
for (unsigned i = 0; i < ci->GetAccessCount(); ++i)
{
const ChanAccess *taccess = ci->GetAccess(i);
AccessProvider *provider = taccess->provider;
if (access_max && target_ci->GetDeepAccessCount() >= access_max)
break;
if (masks.count(taccess->mask))
continue;
masks.insert(taccess->mask);
ChanAccess *newaccess = provider->Create();
newaccess->ci = target_ci;
newaccess->mask = taccess->mask;
newaccess->creator = taccess->creator;
newaccess->last_seen = taccess->last_seen;
newaccess->created = taccess->created;
newaccess->AccessUnserialize(taccess->AccessSerialize());
target_ci->AddAccess(newaccess);
++count;
}
source.Reply(_("%d access entries from \002%s\002 have been cloned to \002%s\002."), count, channel.c_str(), target.c_str());
CopyAccess(source, ci, target_ci);
}
else if (what.equals_ci("AKICK"))
{
target_ci->ClearAkick();
for (unsigned i = 0; i < ci->GetAkickCount(); ++i)
{
const AutoKick *akick = ci->GetAkick(i);
if (akick->nc)
target_ci->AddAkick(akick->creator, akick->nc, akick->reason, akick->addtime, akick->last_used);
else
target_ci->AddAkick(akick->creator, akick->mask, akick->reason, akick->addtime, akick->last_used);
}
source.Reply(_("All akick entries from \002%s\002 have been cloned to \002%s\002."), channel.c_str(), target.c_str());
CopyAkick(source, ci, target_ci);
}
else if (what.equals_ci("BADWORDS"))
{
BadWords *target_badwords = target_ci->Require<BadWords>("badwords"),
*badwords = ci->Require<BadWords>("badwords");
if (!target_badwords || !badwords)
{
source.Reply(ACCESS_DENIED); // BotServ doesn't exist/badwords isn't loaded
return;
}
target_badwords->ClearBadWords();
for (unsigned i = 0; i < badwords->GetBadWordCount(); ++i)
{
const BadWord *bw = badwords->GetBadWord(i);
target_badwords->AddBadWord(bw->word, bw->type);
}
badwords->Check();
target_badwords->Check();
source.Reply(_("All badword entries from \002%s\002 have been cloned to \002%s\002."), channel.c_str(), target.c_str());
CopyBadwords(source, ci, target_ci);
}
else if (what.equals_ci("LEVELS"))
{
CopyLevels(source, ci, target_ci);
}
else
{
@@ -185,8 +239,8 @@ public:
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Copies all settings, access, akicks, etc from \002channel\002 to the\n"
"\002target\002 channel. If \037what\037 is \002ACCESS\002, \002AKICK\002, or \002BADWORDS\002\n"
"then only the respective settings are cloned.\n"
"\002target\002 channel. If \037what\037 is \002ACCESS\002, \002AKICK\002, \002BADWORDS\002,\n"
"or \002LEVELS\002 then only the respective settings are cloned.\n"
"You must be the founder of \037channel\037 and \037target\037."));
return true;
}
+2 -2
View File
@@ -71,8 +71,8 @@ class CommandCSDrop : public Command
this->SendSyntax(source);
source.Reply(" ");
if (source.IsServicesOper())
source.Reply(_("Unregisters the named channel. Only \002Services Operators\002\n"
"can drop a channel of which they are not the founder."));
source.Reply(_("Unregisters the specified channel. Only \002Services Operators\002\n"
"can drop a channel of which they are not the founder of."));
else
source.Reply(_("Unregisters the named channel. Can only be used by\n"
"the \002channel founder\002."));
+45 -39
View File
@@ -10,27 +10,27 @@
*/
#include "module.h"
#include "modules/cs_entrymsg.h"
struct EntryMsg : Serializable
struct EntryMsgImpl : EntryMsg, Serializable
{
Serialize::Reference<ChannelInfo> ci;
Anope::string creator;
Anope::string message;
time_t when;
EntryMsg(ChannelInfo *c, const Anope::string &cname, const Anope::string &cmessage, time_t ct = Anope::CurTime) : Serializable("EntryMsg")
EntryMsgImpl() : Serializable("EntryMsg")
{
this->ci = c;
}
EntryMsgImpl(ChannelInfo *c, const Anope::string &cname, const Anope::string &cmessage, time_t ct = Anope::CurTime) : Serializable("EntryMsg")
{
this->chan = c->name;
this->creator = cname;
this->message = cmessage;
this->when = ct;
}
~EntryMsg();
~EntryMsgImpl();
void Serialize(Serialize::Data &data) const anope_override
{
data["ci"] << this->ci->name;
data["ci"] << this->chan;
data["creator"] << this->creator;
data["message"] << this->message;
data.SetType("when", Serialize::Data::DT_INT); data["when"] << this->when;
@@ -39,30 +39,33 @@ struct EntryMsg : Serializable
static Serializable* Unserialize(Serializable *obj, Serialize::Data &data);
};
struct EntryMessageList : Serialize::Checker<std::vector<EntryMsg *> >
struct EntryMessageListImpl : EntryMessageList
{
EntryMessageList(Extensible *) : Serialize::Checker<std::vector<EntryMsg *> >("EntryMsg") { }
EntryMessageListImpl(Extensible *) { }
~EntryMessageList()
EntryMsg* Create() anope_override
{
for (unsigned i = (*this)->size(); i > 0; --i)
delete (*this)->at(i - 1);
return new EntryMsgImpl();
}
};
EntryMsg::~EntryMsg()
EntryMsgImpl::~EntryMsgImpl()
{
ChannelInfo *ci = ChannelInfo::Find(this->chan);
if (!ci)
return;
EntryMessageList *messages = ci->GetExt<EntryMessageList>("entrymsg");
if (messages)
{
std::vector<EntryMsg *>::iterator it = std::find((*messages)->begin(), (*messages)->end(), this);
if (it != (*messages)->end())
(*messages)->erase(it);
}
if (!messages)
return;
std::vector<EntryMsg *>::iterator it = std::find((*messages)->begin(), (*messages)->end(), this);
if (it != (*messages)->end())
(*messages)->erase(it);
}
Serializable* EntryMsg::Unserialize(Serializable *obj, Serialize::Data &data)
Serializable* EntryMsgImpl::Unserialize(Serializable *obj, Serialize::Data &data)
{
Anope::string sci, screator, smessage;
time_t swhen;
@@ -77,8 +80,8 @@ Serializable* EntryMsg::Unserialize(Serializable *obj, Serialize::Data &data)
if (obj)
{
EntryMsg *msg = anope_dynamic_static_cast<EntryMsg *>(obj);
msg->ci = ci;
EntryMsgImpl *msg = anope_dynamic_static_cast<EntryMsgImpl *>(obj);
msg->chan = ci->name;
data["creator"] >> msg->creator;
data["message"] >> msg->message;
data["when"] >> msg->when;
@@ -89,7 +92,7 @@ Serializable* EntryMsg::Unserialize(Serializable *obj, Serialize::Data &data)
data["when"] >> swhen;
EntryMsg *m = new EntryMsg(ci, screator, smessage, swhen);
EntryMsgImpl *m = new EntryMsgImpl(ci, screator, smessage, swhen);
(*messages)->push_back(m);
return m;
}
@@ -139,8 +142,8 @@ class CommandEntryMessage : public Command
source.Reply(_("The entry message list for \002%s\002 is full."), ci->name.c_str());
else
{
(*messages)->push_back(new EntryMsg(ci, source.GetNick(), message));
Log(source.IsFounder(ci) ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to add a message";
(*messages)->push_back(new EntryMsgImpl(ci, source.GetNick(), message));
Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to add a message";
source.Reply(_("Entry message added to \002%s\002"), ci->name.c_str());
}
}
@@ -163,7 +166,7 @@ class CommandEntryMessage : public Command
delete (*messages)->at(i - 1);
if ((*messages)->empty())
ci->Shrink<EntryMessageList>("entrymsg");
Log(source.IsFounder(ci) ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to remove a message";
Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to remove a message";
source.Reply(_("Entry message \002%i\002 for \002%s\002 deleted."), i, ci->name.c_str());
}
else
@@ -180,7 +183,7 @@ class CommandEntryMessage : public Command
{
ci->Shrink<EntryMessageList>("entrymsg");
Log(source.IsFounder(ci) ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to remove all messages";
Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to remove all messages";
source.Reply(_("Entry messages for \002%s\002 have been cleared."), ci->name.c_str());
}
@@ -209,7 +212,7 @@ class CommandEntryMessage : public Command
return;
}
if (!source.IsFounder(ci) && !source.HasPriv("chanserv/administration"))
if (!source.AccessFor(ci).HasPriv("SET") && !source.HasPriv("chanserv/administration"))
{
source.Reply(ACCESS_DENIED);
return;
@@ -236,20 +239,23 @@ class CommandEntryMessage : public Command
source.Reply(_("Controls what messages will be sent to users when they join the channel."));
source.Reply(" ");
source.Reply(_("The \002ENTRYMSG ADD\002 command adds the given message to\n"
"the list of messages to be shown to users when they join\n"
"the list of messages shown to users when they join\n"
"the channel."));
source.Reply(" ");
source.Reply(_("The \002ENTRYMSG DEL\002 command removes the given message from\n"
"the list of messages to be shown to users when they join\n"
"the channel. You can remove the message by specifying its number\n"
source.Reply(_("The \002ENTRYMSG DEL\002 command removes the specified message from\n"
"the list of messages shown to users when they join\n"
"the channel. You can remove a message by specifying its number\n"
"which you can get by listing the messages as explained below."));
source.Reply(" ");
source.Reply(_("The \002ENTRYMSG LIST\002 command displays a listing of messages\n"
"to be shown to users when they join the channel."));
"shown to users when they join the channel."));
source.Reply(" ");
source.Reply(_("The \002ENTRYMSG CLEAR\002 command clears all entries from\n"
"the list of messages to be shown to users when they join\n"
"the list of messages shown to users when they join\n"
"the channel, effectively disabling entry messages."));
source.Reply(" ");
source.Reply(_("Adding, deleting, or clearing entry messages requires the\n"
"SET permission."));
return true;
}
};
@@ -257,13 +263,13 @@ class CommandEntryMessage : public Command
class CSEntryMessage : public Module
{
CommandEntryMessage commandentrymsg;
ExtensibleItem<EntryMessageList> eml;
ExtensibleItem<EntryMessageListImpl> eml;
Serialize::Type entrymsg_type;
public:
CSEntryMessage(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
commandentrymsg(this),
eml(this, "entrymsg"), entrymsg_type("EntryMsg", EntryMsg::Unserialize)
eml(this, "entrymsg"), entrymsg_type("EntryMsg", EntryMsgImpl::Unserialize)
{
}
+49 -29
View File
@@ -78,11 +78,8 @@ FlagsAccessProvider* FlagsAccessProvider::ap;
class CommandCSFlags : public Command
{
void DoModify(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> &params)
void DoModify(CommandSource &source, ChannelInfo *ci, Anope::string mask, const Anope::string &flags)
{
Anope::string mask = params.size() > 2 ? params[2] : "";
Anope::string flags = params.size() > 3 ? params[3] : "";
if (flags.empty())
{
this->OnSyntaxError(source, "");
@@ -91,6 +88,7 @@ class CommandCSFlags : public Command
AccessGroup u_access = source.AccessFor(ci);
const ChanAccess *highest = u_access.Highest();
const NickAlias *na = NULL;
if (IRCD->IsChannelValid(mask))
{
@@ -116,7 +114,7 @@ class CommandCSFlags : public Command
}
else
{
const NickAlias *na = NickAlias::Find(mask);
na = NickAlias::Find(mask);
if (!na && Config->GetModule("chanserv")->Get<bool>("disallow_hostmask_access"))
{
source.Reply(_("Masks and unregistered users may not be on access lists."));
@@ -133,6 +131,9 @@ class CommandCSFlags : public Command
return;
}
}
if (na)
mask = na->nick;
}
ChanAccess *current = NULL;
@@ -142,7 +143,7 @@ class CommandCSFlags : public Command
for (current_idx = ci->GetAccessCount(); current_idx > 0; --current_idx)
{
ChanAccess *access = ci->GetAccess(current_idx - 1);
if (mask.equals_ci(access->mask))
if ((na && na->nc == access->GetAccount()) || mask.equals_ci(access->Mask()))
{
// Flags allows removing others that have the same access as you,
// but no other access system does.
@@ -175,21 +176,26 @@ class CommandCSFlags : public Command
}
Privilege *p = NULL;
int add = 1;
bool add = true;
for (size_t i = 0; i < flags.length(); ++i)
{
char f = flags[i];
switch (f)
{
case '+':
add = 1;
add = true;
break;
case '-':
add = 0;
add = false;
break;
case '*':
for (std::map<Anope::string, char>::iterator it = defaultFlags.begin(), it_end = defaultFlags.end(); it != it_end; ++it)
{
bool has = current_flags.count(it->second);
// If we are adding a flag they already have or removing one they don't have, don't bother
if (add == has)
continue;
if (!u_access.HasPriv(it->first) && !u_access.founder)
{
if (source.HasPriv("chanserv/access/modify"))
@@ -197,9 +203,10 @@ class CommandCSFlags : public Command
else
continue;
}
if (add == 1)
if (add)
current_flags.insert(it->second);
else if (add == 0)
else
current_flags.erase(it->second);
}
break;
@@ -221,13 +228,13 @@ class CommandCSFlags : public Command
override = true;
else
{
source.Reply(_("You can not set the \002%c\002 flag."), f);
source.Reply(_("You cannot set the \002%c\002 flag."), f);
break;
}
}
if (add == 1)
if (add)
current_flags.insert(f);
else if (add == 0)
else
current_flags.erase(f);
break;
}
@@ -254,8 +261,7 @@ class CommandCSFlags : public Command
if (!provider)
return;
FlagsChanAccess *access = anope_dynamic_static_cast<FlagsChanAccess *>(provider->Create());
access->ci = ci;
access->mask = mask;
access->SetMask(mask, ci);
access->creator = source.GetNick();
access->last_seen = current ? current->last_seen : 0;
access->created = Anope::CurTime;
@@ -272,12 +278,12 @@ class CommandCSFlags : public Command
if (p != NULL)
{
if (add)
source.Reply(_("Privilege \002%s\002 added to \002%s\002 on \002%s\002, new flags are +\002%s\002"), p->name.c_str(), access->mask.c_str(), ci->name.c_str(), access->AccessSerialize().c_str());
source.Reply(_("Privilege \002%s\002 added to \002%s\002 on \002%s\002, new flags are +\002%s\002"), p->name.c_str(), access->Mask().c_str(), ci->name.c_str(), access->AccessSerialize().c_str());
else
source.Reply(_("Privilege \002%s\002 removed from \002%s\002 on \002%s\002, new flags are +\002%s\002"), p->name.c_str(), access->mask.c_str(), ci->name.c_str(), access->AccessSerialize().c_str());
source.Reply(_("Privilege \002%s\002 removed from \002%s\002 on \002%s\002, new flags are +\002%s\002"), p->name.c_str(), access->Mask().c_str(), ci->name.c_str(), access->AccessSerialize().c_str());
}
else
source.Reply(_("Flags for \002%s\002 on %s set to +\002%s\002"), access->mask.c_str(), ci->name.c_str(), access->AccessSerialize().c_str());
source.Reply(_("Flags for \002%s\002 on %s set to +\002%s\002"), access->Mask().c_str(), ci->name.c_str(), access->AccessSerialize().c_str());
}
void DoList(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> &params)
@@ -311,14 +317,14 @@ class CommandCSFlags : public Command
if (pass == false)
continue;
}
else if (!Anope::Match(access->mask, arg))
else if (!Anope::Match(access->Mask(), arg))
continue;
}
ListFormatter::ListEntry entry;
++count;
entry["Number"] = stringify(i + 1);
entry["Mask"] = access->mask;
entry["Mask"] = access->Mask();
entry["Flags"] = flags;
entry["Creator"] = access->creator;
entry["Created"] = Anope::strftime(access->created, source.nc, true);
@@ -365,7 +371,7 @@ class CommandCSFlags : public Command
CommandCSFlags(Module *creator) : Command(creator, "chanserv/flags", 1, 4)
{
this->SetDesc(_("Modify the list of privileged users"));
this->SetSyntax(_("\037channel\037 MODIFY \037mask\037 \037changes\037"));
this->SetSyntax(_("\037channel\037 [MODIFY] \037mask\037 \037changes\037"));
this->SetSyntax(_("\037channel\037 LIST [\037mask\037 | +\037flags\037]"));
this->SetSyntax(_("\037channel\037 CLEAR"));
}
@@ -386,6 +392,8 @@ class CommandCSFlags : public Command
bool has_access = false;
if (source.HasPriv("chanserv/access/modify"))
has_access = true;
else if (is_list && source.HasPriv("chanserv/access/list"))
has_access = true;
else if (is_list && source.AccessFor(ci).HasPriv("ACCESS_LIST"))
has_access = true;
else if (source.AccessFor(ci).HasPriv("ACCESS_CHANGE"))
@@ -395,14 +403,26 @@ class CommandCSFlags : public Command
source.Reply(ACCESS_DENIED);
else if (Anope::ReadOnly && !is_list)
source.Reply(_("Sorry, channel access list modification is temporarily disabled."));
else if (cmd.equals_ci("MODIFY"))
this->DoModify(source, ci, params);
else if (is_list)
this->DoList(source, ci, params);
else if (cmd.equals_ci("CLEAR"))
this->DoClear(source, ci);
else
this->OnSyntaxError(source, cmd);
{
Anope::string mask, flags;
if (cmd.equals_ci("MODIFY"))
{
mask = params.size() > 2 ? params[2] : "";
flags = params.size() > 3 ? params[3] : "";
}
else
{
mask = cmd;
flags = params.size() > 2 ? params[2] : "";
}
this->DoModify(source, ci, mask, flags);
}
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
@@ -412,19 +432,19 @@ class CommandCSFlags : public Command
source.Reply(_("%s is another way to modify the channel access list, similar to\n"
"the XOP and ACCESS methods."), source.command.c_str());
source.Reply(" ");
source.Reply(_("The \002MODIFY\002 command allows you to modify the access list. If mask is\n"
"not already on the access list is it added, then the changes are applied.\n"
source.Reply(_("The \002MODIFY\002 command allows you to modify the access list. If the mask is\n"
"not already on the access list it is added, then the changes are applied.\n"
"If the mask has no more flags, then the mask is removed from the access list.\n"
"Additionally, you may use +* or -* to add or remove all flags, respectively. You are\n"
"only able to modify the access list if you have the proper permission on the channel,\n"
"and even then you can only give other people access to up what you already have."));
"and even then you can only give other people access to the equivalent of what your access is."));
source.Reply(" ");
source.Reply(_("The \002LIST\002 command allows you to list existing entries on the channel access list.\n"
"If a mask is given, the mask is wildcard matched against all existing entries on the\n"
"access list, and only those entries are returned. If a set of flags is given, only those\n"
"on the access list with the specified flags are returned."));
source.Reply(" ");
source.Reply(_("The \002CLEAR\002 command clears the channel access list, which requires channel founder."));
source.Reply(_("The \002CLEAR\002 command clears the channel access list. This requires channel founder access."));
source.Reply(" ");
source.Reply(_("The available flags are:"));
+7 -7
View File
@@ -16,7 +16,7 @@ class CommandCSInfo : public Command
public:
CommandCSInfo(Module *creator) : Command(creator, "chanserv/info", 1, 2)
{
this->SetDesc(_("Lists information about the named registered channel"));
this->SetDesc(_("Lists information about the specified registered channel"));
this->SetSyntax(_("\037channel\037"));
this->AllowUnregistered(true);
}
@@ -73,12 +73,12 @@ class CommandCSInfo : public Command
{
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Lists information about the named registered channel,\n"
"including its founder, time of registration, and last\n"
"time used. If the user issuing the command has the\n"
"appropriate access for it, then the description, successor,\n"
"last topic set, settings and expiration time will also\n"
"be displayed when applicable."));
source.Reply(_("Lists information about the specified registered channel,\n"
"including its founder, time of registration, last\n"
"time used, and description. If the user issuing the\n"
"command has the appropriate access for it, then the\n"
"successor, last topic set, settings and expiration\n"
"time will also be displayed when applicable."));
return true;
}
};
+3 -2
View File
@@ -73,13 +73,14 @@ class CommandCSInvite : public Command
if (u2 != u)
{
source.Reply(_("\002%s\002 has been invited to \002%s\002."), u2->nick.c_str(), c->name.c_str());
u2->SendMessage(ci->WhoSends(), _("You have been invited to \002%s\002 by \002%s\002."), c->name.c_str(), source.GetNick().c_str());
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "for " << u2->nick;
}
else
{
u2->SendMessage(ci->WhoSends(), _("You have been invited to \002%s\002."), c->name.c_str());
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci);
}
u2->SendMessage(ci->WhoSends(), _("You have been invited to \002%s\002."), c->name.c_str());
}
}
@@ -90,7 +91,7 @@ class CommandCSInvite : public Command
source.Reply(_("Tells %s to invite you or an optionally specified\n"
"nick into the given channel.\n"
" \n"
"By default, limited to AOPs or those with level 5 and above\n"
"By default, limited to AOPs or those with level 5 access and above\n"
"on the channel."), source.service->nick.c_str());
return true;
}
+21 -8
View File
@@ -47,6 +47,9 @@ class CommandCSKick : public Command
if (reason.length() > reasonmax)
reason = reason.substr(0, reasonmax);
Anope::string signkickformat = Config->GetModule("chanserv")->Get<Anope::string>("signkickformat", "%m (%n)");
signkickformat = signkickformat.replace_all_cs("%n", source.GetNick());
AccessGroup u_access = source.AccessFor(ci);
if (!u_access.HasPriv("KICK") && !source.HasPriv("chanserv/kick"))
@@ -66,14 +69,19 @@ class CommandCSKick : public Command
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "for " << u2->nick;
if (ci->HasExt("SIGNKICK") || (ci->HasExt("SIGNKICK_LEVEL") && !u_access.HasPriv("SIGNKICK")))
c->Kick(ci->WhoSends(), u2, "%s (%s)", reason.c_str(), source.GetNick().c_str());
{
signkickformat = signkickformat.replace_all_cs("%m", reason);
c->Kick(ci->WhoSends(), u2, "%s", signkickformat.c_str());
}
else
c->Kick(ci->WhoSends(), u2, "%s", reason.c_str());
}
}
else if (u_access.HasPriv("FOUNDER"))
{
Log(LOG_COMMAND, source, this, ci) << "for " << target;
Anope::string mask = IRCD->NormalizeMask(target);
Log(LOG_COMMAND, source, this, ci) << "for " << mask;
int matched = 0, kicked = 0;
for (Channel::ChanUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end;)
@@ -81,7 +89,8 @@ class CommandCSKick : public Command
ChanUserContainer *uc = it->second;
++it;
if (Anope::Match(uc->user->nick, target) || Anope::Match(uc->user->GetDisplayedMask(), target))
Entry e("", mask);
if (e.Matches(uc->user))
{
++matched;
@@ -93,16 +102,20 @@ class CommandCSKick : public Command
++kicked;
if (ci->HasExt("SIGNKICK") || (ci->HasExt("SIGNKICK_LEVEL") && !u_access.HasPriv("SIGNKICK")))
c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s) (%s)", reason.c_str(), target.c_str(), source.GetNick().c_str());
{
reason += " (Matches " + mask + ")";
signkickformat = signkickformat.replace_all_cs("%m", reason);
c->Kick(ci->WhoSends(), uc->user, "%s", signkickformat.c_str());
}
else
c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s)", reason.c_str(), target.c_str());
c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s)", reason.c_str(), mask.c_str());
}
}
if (matched)
source.Reply(_("Kicked %d/%d users matching %s from %s."), kicked, matched, target.c_str(), c->name.c_str());
source.Reply(_("Kicked %d/%d users matching %s from %s."), kicked, matched, mask.c_str(), c->name.c_str());
else
source.Reply(_("No users on %s match %s."), c->name.c_str(), target.c_str());
source.Reply(_("No users on %s match %s."), c->name.c_str(), mask.c_str());
}
else
source.Reply(NICK_X_NOT_IN_USE, target.c_str());
@@ -115,7 +128,7 @@ class CommandCSKick : public Command
source.Reply(_("Kicks a specified nick from a channel.\n"
" \n"
"By default, limited to AOPs or those with level 5 access\n"
"and above on the channel. Channel founders may use masks too."));
"and above on the channel. Channel founders can also specify masks."));
return true;
}
};
+8 -2
View File
@@ -10,6 +10,7 @@
*/
#include "module.h"
#include "modules/cs_mode.h"
class CommandCSList : public Command
{
@@ -58,7 +59,7 @@ class CommandCSList : public Command
spacesepstream keywords(params[1]);
while (keywords.GetToken(keyword))
{
if (keyword.equals_ci("CS_SUSPENDED"))
if (keyword.equals_ci("SUSPENDED"))
suspended = true;
if (keyword.equals_ci("NOEXPIRE"))
channoexpire = true;
@@ -87,6 +88,11 @@ class CommandCSList : public Command
continue;
if (ci->c && ci->c->HasMode("SECRET"))
continue;
ModeLocks *ml = ci->GetExt<ModeLocks>("modelocks");
const ModeLock *secret = ml ? ml->GetMLock("SECRET") : NULL;
if (secret && secret->set)
continue;
}
if (suspended && !ci->HasExt("CS_SUSPENDED"))
@@ -95,7 +101,7 @@ class CommandCSList : public Command
if (channoexpire && !ci->HasExt("CS_NO_EXPIRE"))
continue;
if (pattern.equals_ci(ci->name) || ci->name.equals_ci(spattern) || Anope::Match(ci->name, pattern, false, true) || Anope::Match(ci->name, spattern, false, true))
if (pattern.equals_ci(ci->name) || ci->name.equals_ci(spattern) || Anope::Match(ci->name, pattern, false, true) || Anope::Match(ci->name, spattern, false, true) || Anope::Match(ci->desc, pattern, false, true) || Anope::Match(ci->last_topic, pattern, false, true))
{
if (((count + 1 >= from && count + 1 <= to) || (!from && !to)) && ++nchans <= listmax)
{
+1 -1
View File
@@ -271,7 +271,7 @@ public:
"To remove a logging method use the same syntax as you would to add it.\n"
" \n"
"Example:\n"
" %s #anope chanserv/access MESSAGE @%\n"
" %s #anope chanserv/access MESSAGE @\n"
" Would message any channel operators whenever someone used the\n"
" ACCESS command on ChanServ on the channel."),
source.command.upper().c_str(), source.command.upper().c_str());
+79 -48
View File
@@ -327,6 +327,8 @@ class CommandCSMode : public Command
source.Reply(_("Missing parameter for mode %c."), cm->mchar);
else if (cm->type == MODE_LIST && ci->c && IRCD->GetMaxListFor(ci->c) && ci->c->HasMode(cm->name) >= IRCD->GetMaxListFor(ci->c))
source.Reply(_("List for mode %c is full."), cm->mchar);
else if (modelocks->GetMLock().size() >= Config->GetModule(this->owner)->Get<unsigned>("max", "32"))
source.Reply(_("The mode lock list of \002%s\002 is full."), ci->name.c_str());
else
{
modelocks->SetMLock(cm, adding, mode_param, source.GetNick());
@@ -485,11 +487,10 @@ class CommandCSMode : public Command
case '*':
if (adding == -1 || !has_access)
break;
for (unsigned j = 0; j < ModeManager::GetChannelModes().size(); ++j)
for (unsigned j = 0; j < ModeManager::GetChannelModes().size() && ci->c; ++j)
{
ChannelMode *cm = ModeManager::GetChannelModes()[j];
if (!cm)
continue;
if (!u || cm->CanSet(u) || can_override)
{
if (cm->type == MODE_REGULAR || (!adding && cm->type == MODE_PARAM))
@@ -614,15 +615,10 @@ class CommandCSMode : public Command
}
else
{
std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> its = ci->c->GetModeList(cm->name);
for (; its.first != its.second;)
{
const Anope::string &mask = its.first->second;
++its.first;
if (Anope::Match(mask, param))
ci->c->RemoveMode(NULL, cm, mask);
}
std::vector<Anope::string> v = ci->c->GetModeList(cm->name);
for (unsigned j = 0; j < v.size(); ++j)
if (Anope::Match(v[j], param))
ci->c->RemoveMode(NULL, cm, v[j]);
}
}
}
@@ -640,26 +636,37 @@ class CommandCSMode : public Command
new_params.push_back("SET");
new_params.push_back("-*");
this->DoSet(source, ci, new_params);
return;
}
else if (param.equals_ci("BANS") || param.equals_ci("EXEMPTS") || param.equals_ci("INVITEOVERRIDES") || param.equals_ci("VOICES") || param.equals_ci("HALFOPS") || param.equals_ci("OPS"))
{
const Anope::string &mname = param.upper().substr(0, param.length() - 1);
ChannelMode *cm = ModeManager::FindChannelModeByName(mname);
if (cm == NULL)
{
source.Reply(_("Your IRCD does not support %s."), mname.upper().c_str());
return;
}
std::vector<Anope::string> new_params;
new_params.push_back(params[0]);
new_params.push_back("SET");
new_params.push_back("-" + stringify(cm->mchar));
new_params.push_back("*");
this->DoSet(source, ci, new_params);
}
ChannelMode *cm;
if (param.length() == 1)
cm = ModeManager::FindChannelModeByChar(param[0]);
else
this->SendSyntax(source);
{
cm = ModeManager::FindChannelModeByName(param.upper());
if (!cm)
cm = ModeManager::FindChannelModeByName(param.substr(0, param.length() - 1).upper());
}
if (!cm)
{
source.Reply(_("There is no such mode %s."), param.c_str());
return;
}
if (cm->type != MODE_STATUS && cm->type != MODE_LIST)
{
source.Reply(_("Mode %s is not a status or list mode."), param.c_str());
return;
}
std::vector<Anope::string> new_params;
new_params.push_back(params[0]);
new_params.push_back("SET");
new_params.push_back("-" + stringify(cm->mchar));
new_params.push_back("*");
this->DoSet(source, ci, new_params);
}
public:
@@ -725,8 +732,8 @@ class CommandCSMode : public Command
" Clears all extended bans that start with ~c:\n"
" \n"
"The \002%s CLEAR\002 command is an easy way to clear modes on a channel. \037what\037 may be\n"
"one of bans, exempts, inviteoverrides, ops, halfops, or voices. If \037what\037 is not given then all\n"
"basic modes are removed."),
"any mode name. Examples include bans, excepts, inviteoverrides, ops, halfops, and voices. If \037what\037\n"
"is not given then all basic modes are removed."),
source.command.upper().c_str(), source.command.upper().c_str(), source.command.upper().c_str());
return true;
}
@@ -891,9 +898,9 @@ class CSMode : public Module
}
}
void OnCheckModes(Channel *c) anope_override
void OnCheckModes(Reference<Channel> &c) anope_override
{
if (!c->ci)
if (!c || !c->ci)
return;
ModeLocks *locks = modelocks.Get(c->ci);
@@ -908,9 +915,9 @@ class CSMode : public Module
if (cm->type == MODE_REGULAR)
{
if (!c->HasMode(cm->name) && ml->set)
c->SetMode(NULL, cm);
c->SetMode(NULL, cm, "", false);
else if (c->HasMode(cm->name) && !ml->set)
c->RemoveMode(NULL, cm);
c->RemoveMode(NULL, cm, "", false);
}
else if (cm->type == MODE_PARAM)
{
@@ -921,26 +928,26 @@ class CSMode : public Module
c->GetParam(cm->name, param);
if (!c->HasMode(cm->name) || (!param.empty() && !ml->param.empty() && !param.equals_cs(ml->param)))
c->SetMode(NULL, cm, ml->param);
c->SetMode(NULL, cm, ml->param, false);
}
else
{
if (c->HasMode(cm->name))
c->RemoveMode(NULL, cm);
c->RemoveMode(NULL, cm, "", false);
}
}
else if (cm->type == MODE_LIST || cm->type == MODE_STATUS)
{
if (ml->set)
c->SetMode(NULL, cm, ml->param);
c->SetMode(NULL, cm, ml->param, false);
else
c->RemoveMode(NULL, cm, ml->param);
c->RemoveMode(NULL, cm, ml->param, false);
}
}
}
void OnCreateChan(ChannelInfo *ci) anope_override
void OnChanRegistered(ChannelInfo *ci) anope_override
{
ModeLocks *ml = modelocks.Require(ci);
Anope::string mlock;
@@ -951,16 +958,40 @@ class CSMode : public Module
for (unsigned i = 0; i < mlock.length(); ++i)
{
if (mlock[i] == '+')
add = true;
else if (mlock[i] == '-')
add = false;
else
{
ChannelMode *cm = ModeManager::FindChannelModeByChar(mlock[i]);
Anope::string param;
if (cm && (cm->type == MODE_REGULAR || sep.GetToken(param)))
ml->SetMLock(cm, add, param);
add = true;
continue;
}
if (mlock[i] == '-')
{
add = false;
continue;
}
ChannelMode *cm = ModeManager::FindChannelModeByChar(mlock[i]);
if (!cm)
continue;
Anope::string param;
if (cm->type == MODE_PARAM)
{
ChannelModeParam *cmp = anope_dynamic_static_cast<ChannelModeParam *>(cm);
if (add || !cmp->minus_no_arg)
{
sep.GetToken(param);
if (param.empty() || !cmp->IsValid(param))
continue;
}
}
else if (cm->type != MODE_REGULAR)
{
sep.GetToken(param);
if (param.empty())
continue;
}
ml->SetMLock(cm, add, param);
}
}
ml->Check();
+3 -3
View File
@@ -45,7 +45,7 @@ class CommandCSRegister : public Command
source.Reply(CHAN_X_NOT_IN_USE, chan.c_str());
else if (ci)
source.Reply(_("Channel \002%s\002 is already registered!"), chan.c_str());
else if (c && !c->HasUserStatus(u, "OP"))
else if (c && u && !c->HasUserStatus(u, "OP"))
source.Reply(_("You must be a channel operator to register the channel."));
else if (maxregistered && nc->channelcount >= maxregistered && !source.HasPriv("chanserv/no-register-limit"))
source.Reply(nc->channelcount > maxregistered ? CHAN_EXCEEDED_CHANNEL_LIMIT : CHAN_REACHED_CHANNEL_LIMIT, maxregistered);
@@ -67,6 +67,8 @@ class CommandCSRegister : public Command
Log(LOG_COMMAND, source, this, ci);
source.Reply(_("Channel \002%s\002 registered under your account: %s"), chan.c_str(), nc->display.c_str());
FOREACH_MOD(OnChanRegistered, (ci));
/* Implement new mode lock */
if (c)
{
@@ -74,8 +76,6 @@ class CommandCSRegister : public Command
if (u)
c->SetCorrectModes(u, true);
}
FOREACH_MOD(OnChanRegistered, (ci));
}
}
+2 -2
View File
@@ -172,7 +172,7 @@ class CommandOSSeen : public Command
source.Reply(" ");
source.Reply(_("The \002STATS\002 command prints out statistics about stored nicks and memory usage."));
source.Reply(_("The \002CLEAR\002 command lets you clean the database by removing all entries from the\n"
"entries from the database that were added within \037time\037.\n"
"database that were added within \037time\037.\n"
" \n"
"Example:\n"
" %s CLEAR 30m\n"
@@ -241,7 +241,7 @@ class CommandSeen : public Command
{
ChanAccess *a = ag[i];
if (*a->nc == na->nc && a->last_seen > last)
if (a->GetAccount() == na->nc && a->last_seen > last)
last = a->last_seen;
}
+27 -28
View File
@@ -35,7 +35,8 @@ class CommandCSSet : public Command
" \n"
"Available options:"));
Anope::string this_name = source.command;
bool hide_privileged_commands = Config->GetBlock("options")->Get<bool>("hideprivilegedcommands");
bool hide_privileged_commands = Config->GetBlock("options")->Get<bool>("hideprivilegedcommands"),
hide_registered_commands = Config->GetBlock("options")->Get<bool>("hideregisteredcommands");
for (CommandInfo::map::const_iterator it = source.service->commands.begin(), it_end = source.service->commands.end(); it != it_end; ++it)
{
const Anope::string &c_name = it->first;
@@ -44,13 +45,12 @@ class CommandCSSet : public Command
{
ServiceReference<Command> c("Command", info.name);
// XXX dup
if (!c)
continue;
else if (!hide_privileged_commands)
; // Always show with hide_privileged_commands disabled
else if (!c->AllowUnregistered() && !source.GetAccount())
else if (hide_registered_commands && !c->AllowUnregistered() && !source.GetAccount())
continue;
else if (!info.permission.empty() && !source.HasCommand(info.permission))
else if (hide_privileged_commands && !info.permission.empty() && !source.HasCommand(info.permission))
continue;
source.command = it->first;
@@ -1010,7 +1010,7 @@ class CommandCSSetSuccessor : public Command
else
nc = NULL;
Log(!source.permission.empty() ? LOG_ADMIN : LOG_COMMAND, source, this, ci) << "to change the successor from " << (ci->GetSuccessor() ? ci->GetSuccessor()->display : "(none)") << " to " << (nc ? nc->display : "(none)");
Log(source.AccessFor(ci).HasPriv("SET") ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to change the successor from " << (ci->GetSuccessor() ? ci->GetSuccessor()->display : "(none)") << " to " << (nc ? nc->display : "(none)");
ci->SetSuccessor(nc);
@@ -1163,18 +1163,27 @@ class CSSet : public Module
return;
bool created;
Channel *c = Channel::FindOrCreate(ci->name, created, ci->time_registered);
if (!ci->bi)
{
BotInfo *ChanServ = Config->GetClient("ChanServ");
if (ChanServ)
ChanServ->Assign(NULL, ci);
}
Channel *c = Channel::FindOrCreate(ci->name, created);
if (ci->bi && !c->FindUser(ci->bi))
ChannelMode *cm = ModeManager::FindChannelModeByName("PERM");
if (cm)
{
ChannelStatus status(BotModes());
ci->bi->Join(c, &status);
c->SetMode(NULL, cm);
}
else
{
if (!ci->bi)
{
BotInfo *ChanServ = Config->GetClient("ChanServ");
if (ChanServ)
ChanServ->Assign(NULL, ci);
}
if (ci->bi && !c->FindUser(ci->bi))
{
ChannelStatus status(BotModes());
ci->bi->Join(c, &status);
}
}
if (created)
@@ -1226,7 +1235,7 @@ class CSSet : public Module
ci->bantype = Config->GetModule(this)->Get<int>("defbantype", "2");
}
void OnChannelCreate(Channel *c) anope_override
void OnChannelSync(Channel *c) anope_override
{
if (c->ci && keep_modes.HasExt(c->ci))
{
@@ -1236,11 +1245,6 @@ class CSSet : public Module
}
}
void OnChannelSync(Channel *c) anope_override
{
OnChannelCreate(c);
}
EventReturn OnCheckKick(User *u, Channel *c, Anope::string &mask, Anope::string &reason) anope_override
{
if (!c->ci || !restricted.HasExt(c->ci) || c->MatchesList(u, "EXCEPT"))
@@ -1280,12 +1284,6 @@ class CSSet : public Module
{
if (c->ci)
persist.Unset(c->ci);
if (c->CheckDelete())
{
delete c;
return EVENT_STOP;
}
}
if (c->ci && mode->type != MODE_STATUS && !c->syncing && Me->IsSynced())
@@ -1319,6 +1317,7 @@ class CSSet : public Module
if (noautoop.HasExt(chan->ci))
give_modes = false;
if (secureops.HasExt(chan->ci))
// This overrides what chanserv does because it is loaded after chanserv
take_modes = true;
}
}

Some files were not shown because too many files have changed in this diff Show More