3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 23:09:23 +01:00
Commit Graph

370 Commits

Author SHA1 Message Date
James Lu
6c65d5523e IRCNetwork: potentially fix queue thread shutdowns (#558)
Replace unreliable appendleft() usage with replacing the first element (or adding None if the queue is empty).
2017-12-17 01:01:21 -08:00
James Lu
9dfa0a478e classes: fix inverted order in get_prefix_modes() description
No, no, no. Nobody sorts modes that way!
2017-12-07 12:07:08 -08:00
James Lu
2fc5d32e3f NetworkCore: don't clear state on disconnect
This is already reset on connect, so doing it here too is a bit pointless.
2017-12-03 18:56:39 -08:00
James Lu
bebdf2e4ff IRCNetwork: avoid sending multiple disconnect hooks for one disconnection 2017-12-03 17:46:45 -08:00
James Lu
62cef5c3f5
classes: clarify comments on mode-related functions 2017-11-03 23:40:11 -07:00
James Lu
472b73cf65 classes.Channel: clarify the intended behaviour of sort_prefixes() and get_prefix_modes() 2017-10-15 02:16:18 -07:00
James Lu
aa44bc15a3 classes: fix backwards sorting in Channel.sort_prefixes()
Also remove various workaround code added to address this.
2017-10-15 01:29:42 -07:00
James Lu
a9916a74f2 Revert "NetworkCoreWUtils: strip off leading and trailing quotes from parse_modes"
This was a band-aid fix not ready to be committed - we should work on this in IRCParser and opercmds instead.

This reverts commit aeaee491f3.
2017-10-10 22:33:24 -07:00
James Lu
aeaee491f3 NetworkCoreWUtils: strip off leading and trailing quotes from parse_modes 2017-10-10 22:25:06 -07:00
James Lu
663bfe462c classes: track hopcount in Server 2017-09-23 22:35:55 -07:00
James Lu
113bfcba9d PyLinkNetworkCore: copy world.hooks before iterating
This fixes a race condition where the order of PRIVMSG handlers could be changed as 'load <plugin>' runs, causing the load command to be processed multiple times.
2017-09-23 13:39:43 -07:00
James Lu
0c50091d11 Merge branch 'master' into devel 2017-09-08 19:12:17 -07:00
James Lu
49136d5abd core: raise better errors on common logging block syntax mistakes
These are commonly reported and include:
- Commenting out the contents of logging:channels without commenting out the "channels:" heading, causing that block to become None.
- Commenting out headers like "filerotation:", causing its body to become pairs in logging:files or something similar.
- Leaving logging:channels:<netname> empty: this causes it to become None, so using get() on it fails.
2017-09-08 19:07:03 -07:00
James Lu
f3e82cc15b Concisify match_host CIDR logging again
We're replacing the glob, not the target's host.

(cherry picked from commit 7aa836efa6)
2017-09-05 19:03:18 -07:00
James Lu
d1f8358159 Fix wrong logging for CIDR ranges in match_host
(cherry picked from commit 761d3ef500)
2017-09-05 19:03:18 -07:00
James Lu
5e92aefcd4 Implement priorities in utils.add_hook()
This changes world.hooks to store lists of tuples indicating (priority, hook_func).
2017-09-02 21:17:50 -07:00
James Lu
5c981c83b1 core: abort autoconnect and socket connectons when the daemon is shutting down 2017-08-31 13:40:11 -07:00
James Lu
82a7b914b6 Move control.tried_shutdown to world.shutting_down 2017-08-31 13:36:50 -07:00
James Lu
bc48709595 PyLinkNetworkCore: fix extraneous warnings in get_service_bot 2017-08-30 19:48:46 -07:00
James Lu
cad55097f1 core: reuse existing service client UIDs for all service bots
This prevents nick collision wars caused by spawn_service when an ENDBURST hook for the uplink is received multiple times.
2017-08-30 19:29:46 -07:00
James Lu
87639ddeb2 classes: add a has_eob attribute to each server object 2017-08-30 19:16:54 -07:00
James Lu
46e9975bd5 Continue rewriting the protocol module spec (#478) 2017-08-30 01:26:35 -07:00
James Lu
4a363aee50 Move _expandPUID into PyLinkNetworkCoreWithUtils 2017-08-30 00:56:18 -07:00
James Lu
d79f1766b6 classes, coremods: migrate to irc.is_* 2017-08-28 20:13:25 -07:00
James Lu
e39b4e9c69 Move utils.is* methods into PyLinkNetworkCoreWithUtils (#476) 2017-08-28 20:07:31 -07:00
James Lu
2a7594e56e Move PUIDGenerator->classes, IncrementalUIDGenerator->ircs2s_common (#476) 2017-08-28 19:42:24 -07:00
James Lu
b1159400f1 Move DeprecatedAttributesObject, CamelCaseToSnakeCase to structures (#476) 2017-08-28 19:36:55 -07:00
James Lu
0907f05296 Condense (deep)copy definitions into structures.CopyWrapper 2017-08-25 17:05:53 -07:00
James Lu
8c0f19422f core: Add irc argument to User and Server classes
Also, add a __deepcopy__ override to channel because we cannot clone IRCNetwork objects (locks cannot be pickled).
2017-08-25 13:53:45 -07:00
James Lu
96a202acce core: make User.channels use IRCCaseInsensitiveSet
Closes #515. This is an API breaking change!
2017-08-25 13:26:34 -07:00
James Lu
80766e051e core: define two (joined) versions of the channels index
Closes #509.

PyLinkNetworkCore.channels is split into the following:
- irc._channels which implicitly creates channels on access (mostly used in protocol modules)
- irc.channels which does not (recommended for use by plugins)
2017-08-25 02:12:08 -07:00
James Lu
c6ca89b48a Fill in the rest of the extbans list for inspircd & unreal (#498) 2017-08-23 21:47:43 -07:00
James Lu
de1a6379df Add (experimental) support for matching extbans (#498) 2017-08-23 21:18:57 -07:00
James Lu
d28006ae62 Move ProtocolError to utils, and link the copy in classes to it 2017-08-21 22:21:09 -07:00
James Lu
3e150d8514 Break up classes.ChannelState into structures.(IRC)CaseInsensitiveDict 2017-08-21 21:50:44 -07:00
James Lu
7aa836efa6 Concisify match_host CIDR logging again
We're replacing the glob, not the target's host.
2017-08-16 00:03:57 -07:00
James Lu
761d3ef500 Fix wrong logging for CIDR ranges in match_host 2017-08-15 21:26:18 -07:00
James Lu
9113b34b46 NetworkCore: return the server in get_server if the arg was a server 2017-08-11 13:13:50 -07:00
James Lu
e0e929492e match_host: implicitly convert string masks such as "user1" to "$pylinkacc:user1"
This keeps it in line with other services packages and is way nicer to read.
2017-08-07 16:31:17 -07:00
James Lu
a070ec5c32 PyLinkNetworkCore: add stubs for disconnect() and connect() 2017-08-06 21:49:52 -07:00
James Lu
d3f635901b classes: reorganize methods in NetworkCore 2017-08-06 21:49:41 -07:00
James Lu
a72f710a69 Add regex variants to checkban and massban 2017-08-06 20:02:20 -07:00
James Lu
d12f12ae22 Add a 'massban' command
Closes #174.
2017-08-06 19:21:55 -07:00
James Lu
c8a9163f57 ChannelState: add __repr__ 2017-08-06 18:09:37 -07:00
James Lu
c9c0e0a85b ChannelState: add copy and __contains__ methods 2017-08-06 18:04:46 -07:00
James Lu
cbb3c88e11 NetworkCoreWithUtils: add new match_all() method 2017-08-06 17:55:43 -07:00
James Lu
32249ace3e Store channels case-insensitively in a new classes.ChannelState
Closes #372.
2017-08-06 17:52:52 -07:00
James Lu
9ae851e1fc classes: rename NetworkCore.aborted to _aborted 2017-08-05 22:16:52 -07:00
James Lu
8d15d05711 IRCNetwork: use disconnect() to kill networks if parsing a command errors
This is more standard, as aborted is solely an internal value.
2017-08-05 22:14:44 -07:00
James Lu
f4da1fc94c Merge branch 'master' into devel
Conflicts:
	VERSION
	classes.py
	docs/faq.md
	example-conf.yml
	protocols/p10.py
	pylink
	world.py
2017-08-05 22:11:22 -07:00