11312 Commits

Author SHA1 Message Date
attilamolnar
c06507029d m_spanningtree Netburst: If a topic was ever set, send it even if it's empty
A new but empty topic should override a non-empty old topic
2013-04-13 17:15:56 +02:00
Attila Molnar
bf0fad3b3b Merge pull request #476 from SaberUK/master+allowcoreunload
Add <security:allowcoreunload>.
2013-04-13 08:13:03 -07:00
attilamolnar
75fa56618e m_spanningtree Add channel timestamp to FTOPIC 2013-04-13 17:09:19 +02:00
attilamolnar
b9a2b9868d m_spanningtree Add channel timestamp to channel METADATA 2013-04-13 17:09:18 +02:00
Peter Powell
b331d0549b Add <security:allowcoreunload>.
When enabled (the default) this setting prevents the unloading of
core modules such as cmd_privmsg.
2013-04-13 16:01:42 +01:00
attilamolnar
1626437cbf m_spanningtree Introduce IJOIN and RESYNC
When a local user joins an existing channel, instead of an FJOIN, send an IJOIN with the channel name being the first parameter.
If the joining user received prefix modes, append the channel TS and the prefix mode letters as the second and third parameters.

When receiving an IJOIN, first check if the target channel exists. If it does not exist, ignore the join (that is, do not create the channel) and send a RESYNC back to the source.

If the channel does exist then join the user, and in case any prefix modes were sent (found in the 3rd parameter), compare the TS of the channel to the TS in the IJOIN (2nd parameter).
If the timestamps match, set the modes on the user, otherwise ignore the modes.

Outgoing IJOINs to 1202 protocol servers are converted to FJOINs, but the channel mode parameter is left empty ("+").
2013-04-13 16:22:03 +02:00
attilamolnar
debe102133 m_spanningtree Bump protocol version and remove unused CAPAB CAPABILITIES entries 2013-04-13 16:20:49 +02:00
attilamolnar
b98acac5c9 Channel::JoinUser() and Channel::ForceChan() changes
Convert static Channel::ForceChan() to non-static Channel::ForceJoin() that joins a user to a channel, no permission checks

The (static) Channel::JoinUser() now has a LocalUser parameter, and no longer have TS and bursting parameters. If the channel doesn't exist, it is created using current time as TS
2013-04-13 16:05:54 +02:00
attilamolnar
988d821807 OnUserPreJoin is a local-only hook, change User* parameter to LocalUser* 2013-04-13 15:34:12 +02:00
attilamolnar
d71b6a8b27 Remove the deprecated invite API 2013-04-13 15:34:11 +02:00
attilamolnar
551d687ec6 m_spanningtree Remove unneeded #includes 2013-04-12 21:03:05 +02:00
attilamolnar
7b29a8f68f m_spanningtree FJOIN handler: Refactor, update doc
Split the core function into several smaller functions
Accept userlist entries having no comma at all
2013-04-12 21:03:05 +02:00
attilamolnar
0133d660cb m_spanningtree Netburst: Refactor SendChannelModes()
Rename it to SyncChannel() and change it to take a Channel* parameter, move iteration into DoBurst()
2013-04-12 21:03:05 +02:00
attilamolnar
904daf7ddb m_spanningtree Change both prefix and first parameter of SQUIT to be a SID 2013-04-12 21:03:05 +02:00
attilamolnar
667c558c65 m_spanningtree Remove encapsulation on UserCount/OperCount 2013-04-12 21:03:05 +02:00
attilamolnar
da28fe0b8c m_spanningtree Introduce new function to send channel messages
Use it from the protocol interface and PRIVMSG/NOTICE handlers
Unite OnUserNotice and OnUserMessage code into LocalMessage()
2013-04-12 21:03:05 +02:00
attilamolnar
a04e586eb5 m_spanningtree Change TreeServerList to be a set, get rid of a function dedicated to adding entries to it 2013-04-12 21:03:04 +02:00
attilamolnar
7f56a39e97 m_spanningtree Utils: Move code that creates a full line from its components to a new function 2013-04-12 21:03:04 +02:00
attilamolnar
a7b70492bb m_spanningtree FTOPIC handler: Keep only one topic if the two topic timestamps match but the topics differ 2013-04-12 21:03:04 +02:00
attilamolnar
b79a9a1221 m_spanningtree FTOPIC handler: Return CMD_FAILURE/CMD_INVALID as appropiate
Return CMD_FAILURE to prevent propagation when the topic wasn't updated; return CMD_INVALID when the topicts is invalid
2013-04-12 21:03:04 +02:00
attilamolnar
f4cd5fb72a m_spanningtree atoi() to ConvToInt() conversion, add const where possible
Remove two redundant functions from Utils
2013-04-12 21:03:04 +02:00
attilamolnar
9c2e2ef9d2 m_spanningtree RSQUIT handler: Don't reimplement sending messages to remote users
Use ModuleSpanningTree::RemoteMessage instead
2013-04-12 21:03:04 +02:00
attilamolnar
0404c25526 m_spanningtree RCONNECT handler: Fix error reporting to remote users
Describe behavior in comments
2013-04-12 21:03:03 +02:00
attilamolnar
37c4991368 m_spanningtree Netburst: Rework SendFJoins()
Old code sent empty lines on burst after FJOINs, new version fixes that
2013-04-12 21:03:03 +02:00
attilamolnar
36688c8f5a m_spanningtree Netburst: Remove expiration check from SendXLines()
XLineManager does the checking
2013-04-12 21:03:03 +02:00
attilamolnar
19c695250f m_spanningtree UID handler: Log and drop the link when a server introduces a user with an unknown user mode 2013-04-12 21:03:03 +02:00
attilamolnar
aaabf27f44 m_spanningtree UID handler: Remove dead code 2013-04-12 21:03:03 +02:00
attilamolnar
4a0748dffd m_spanningtree FMODE handler: Rework
Check for error conditions before doing any work
Get rid of hardcoded maxmodes and a loop that copies a container
2013-04-12 21:03:03 +02:00
attilamolnar
01692b86b8 m_spanningtree IDLE handler: Rewrite 2013-04-12 21:03:03 +02:00
Attila Molnar
debedfeb0a Merge pull request #461 from SaberUK/master+header-cleanup
Tidy up source files.
2013-04-12 09:04:01 -07:00
Peter Powell
11cafc12d5 Tidy up source files:
- Use #pragma once instead of include guards.
- Move header files in src/modules to include/modules.
- Fixed various spacing issues.
2013-04-12 17:03:05 +01:00
Attila Molnar
a5fe50aca0 Merge pull request #488 from SaberUK/master+loglevel-rename
Add LOG_ prefix to the log level enum values.
2013-04-12 07:58:58 -07:00
Peter Powell
645f7e18c6 Add LOG_ prefix to the log level enum values. 2013-04-12 02:21:19 +01:00
Attila Molnar
1858feabd3 Merge pull request #487 from SaberUK/master+better-isupport-api
Convert ISUPPORT to use a map instead of a string.
2013-04-11 15:11:31 -07:00
Peter Powell
5c29c53f65 Convert ISUPPORT to use a map instead of a string. 2013-04-11 23:08:03 +01:00
attilamolnar
295b3e7ba1 Fix clang warning about IsOper() 2013-04-11 21:58:23 +02:00
Attila Molnar
c66ce555ba Merge pull request #484 from SaberUK/insp20+fix-modulemanager
Fix ModuleManager error caused by a lack of arguments.
2013-04-10 12:28:22 -07:00
Peter Powell
ac8a394a5c Fix ModuleManager error caused by a lack of arguments. 2013-04-10 20:25:32 +01:00
attilamolnar
77e8e0bcca Run OnUnloadModule hook before starting to unregister services provided by the module 2013-04-10 19:28:54 +02:00
attilamolnar
01ea7ce9c3 BanCache: Move expiration code into a function, call it from RemoveEntries() 2013-04-10 19:27:24 +02:00
attilamolnar
2b1328c3f4 BanCache: Remove BanCacheManager::RehashCache()
The function was never called
2013-04-10 19:27:24 +02:00
attilamolnar
05ea981523 BanCache: Simplify BanCacheManager::RemoveEntries() 2013-04-10 19:27:24 +02:00
attilamolnar
a0fdf5fcd5 BanCache: Remove BanCacheHit::IP field, and BanCacheManager::RemoveHit()
The IP field was only used in RemoveHit(), RemoveHit() was only called from GetHit()
2013-04-10 19:27:24 +02:00
attilamolnar
239a3bb0f8 BanCache: Do one hash lookup in BanCacheManager::AddHit() 2013-04-10 19:27:24 +02:00
attilamolnar
c5d1a7843e BanCache: Don't repeat ourselves, one BanCacheManager::AddHit() and one BanCacheHit constructor is enough 2013-04-10 19:27:23 +02:00
attilamolnar
ca0083cba9 Replace IS_AWAY() and IS_OPER() macros with User::IsAway() and User::IsOper() 2013-04-10 17:28:08 +02:00
attilamolnar
65072d44f2 m_spanningtree Create new TreeServers for incoming connections only when they've accepted our credentials, not when they send SERVER 2013-04-10 17:05:13 +02:00
Adam
0f8f3af9ac Update Window's .gitignore 2013-04-10 02:39:43 -05:00
attilamolnar
99461ac66d Fix ListModeBase on Windows 2013-04-09 21:41:18 +02:00
attilamolnar
ac705cd20e Remove some uline checks that ran after an IS_LOCAL() check 2013-04-09 18:57:05 +02:00