2015-09-07 08:11:31 +02:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
|
|
<html><head><title>Python: module inspircd</title>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
|
</head><body bgcolor="#f0f0f8">
|
|
|
|
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
|
|
|
<tr bgcolor="#7799ee">
|
|
|
|
<td valign=bottom> <br>
|
|
|
|
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>inspircd</strong></big></big></font></td
|
|
|
|
><td align=right valign=bottom
|
|
|
|
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/gl/pylink/protocols/inspircd.py">/home/gl/pylink/protocols/inspircd.py</a></font></td></tr></table>
|
|
|
|
<p></p>
|
|
|
|
<p>
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
<tr bgcolor="#aa55cc">
|
|
|
|
<td colspan=3 valign=bottom> <br>
|
|
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
|
|
|
|
|
|
|
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
|
|
|
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="hashlib.html">hashlib</a><br>
|
|
|
|
<a href="os.html">os</a><br>
|
|
|
|
<a href="re.html">re</a><br>
|
|
|
|
</td><td width="25%" valign=top><a href="socket.html">socket</a><br>
|
|
|
|
<a href="ssl.html">ssl</a><br>
|
|
|
|
<a href="sys.html">sys</a><br>
|
|
|
|
</td><td width="25%" valign=top><a href="threading.html">threading</a><br>
|
|
|
|
<a href="time.html">time</a><br>
|
|
|
|
<a href="utils.html">utils</a><br>
|
|
|
|
</td><td width="25%" valign=top><a href="world.html">world</a><br>
|
|
|
|
</td></tr></table></td></tr></table><p>
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
<tr bgcolor="#ee77aa">
|
|
|
|
<td colspan=3 valign=bottom> <br>
|
|
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
|
|
|
|
|
|
|
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
|
|
|
<td width="100%"><dl>
|
|
|
|
<dt><font face="helvetica, arial"><a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a>(<a href="classes.html#Protocol">classes.Protocol</a>)
|
|
|
|
</font></dt><dd>
|
|
|
|
<dl>
|
|
|
|
<dt><font face="helvetica, arial"><a href="inspircd.html#InspIRCdProtocol">InspIRCdProtocol</a>
|
|
|
|
</font></dt></dl>
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
<p>
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
<tr bgcolor="#ffc8d8">
|
|
|
|
<td colspan=3 valign=bottom> <br>
|
|
|
|
<font color="#000000" face="helvetica, arial"><strong>Class</strong> = <a name="Class">class InspIRCdProtocol</a>(<a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a>)</font></td></tr>
|
|
|
|
|
|
|
|
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
|
|
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
|
|
<dd><a href="inspircd.html#InspIRCdProtocol">InspIRCdProtocol</a></dd>
|
|
|
|
<dd><a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a></dd>
|
|
|
|
<dd><a href="classes.html#Protocol">classes.Protocol</a></dd>
|
|
|
|
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
|
|
|
</dl>
|
|
|
|
<hr>
|
|
|
|
Methods defined here:<br>
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-__init__"><strong>__init__</strong></a>(self, irc)</dt></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-awayClient"><strong>awayClient</strong></a>(self, source, text)</dt><dd><tt>Sends an AWAY message from a PyLink client. <text> can be an empty string<br>
|
|
|
|
to unset AWAY status.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-connect"><strong>connect</strong></a>(self)</dt><dd><tt>Initializes a connection to a server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_away"><strong>handle_away</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming AWAY messages.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_encap"><strong>handle_encap</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming encapsulated commands (ENCAP). Hook arguments<br>
|
|
|
|
returned by this should have a parse_as field, that sets the correct<br>
|
|
|
|
hook name for the message.<br>
|
|
|
|
<br>
|
|
|
|
For InspIRCd, the only ENCAP command we handle right now is KNOCK.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_endburst"><strong>handle_endburst</strong></a>(self, numeric, command, args)</dt><dd><tt>ENDBURST handler; sends a hook with empty contents.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_events"><strong>handle_events</strong></a>(self, data)</dt><dd><tt>Event handler for the InspIRCd protocol. This passes most commands to<br>
|
|
|
|
the various handle_ABCD() functions elsewhere in this module, but also<br>
|
|
|
|
handles commands sent in the initial server linking phase.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_fhost"><strong>handle_fhost</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles FHOST, used for denoting hostname changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_fident"><strong>handle_fident</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles FIDENT, used for denoting ident changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_fjoin"><strong>handle_fjoin</strong></a>(self, servernumeric, command, args)</dt><dd><tt>Handles incoming FJOIN commands (InspIRCd equivalent of JOIN/SJOIN).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_fmode"><strong>handle_fmode</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles the FMODE command, used for channel mode changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_fname"><strong>handle_fname</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles FNAME, used for denoting real name/gecos changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_ftopic"><strong>handle_ftopic</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming FTOPIC (sets topic on burst).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_idle"><strong>handle_idle</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles the IDLE command, sent between servers in remote WHOIS queries.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_invite"><strong>handle_invite</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming INVITEs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_opertype"><strong>handle_opertype</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming OPERTYPE, which is used to denote an oper up.<br>
|
|
|
|
<br>
|
|
|
|
This calls the internal hook PYLINK_CLIENT_OPERED, sets the internal<br>
|
|
|
|
opertype of the client, and assumes setting user mode +o on the caller.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_ping"><strong>handle_ping</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PING commands, so we don't time out.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_pong"><strong>handle_pong</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PONG commands. This is used to keep track of whether<br>
|
|
|
|
the uplink is alive by the Irc() internals - a server that fails to reply<br>
|
|
|
|
to our PINGs eventually times out and is disconnected.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_server"><strong>handle_server</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SERVER commands (introduction of servers).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_uid"><strong>handle_uid</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming UID commands (user introduction).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-inviteClient"><strong>inviteClient</strong></a>(self, numeric, target, channel)</dt><dd><tt>Sends an INVITE from a PyLink client..</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-joinClient"><strong>joinClient</strong></a>(self, client, channel)</dt><dd><tt>Joins an internal spawned client <client> to a channel.</tt></dd></dl>
|
|
|
|
|
2015-09-07 08:18:27 +02:00
|
|
|
<dl><dt><a name="InspIRCdProtocol-killClient"><strong>killClient</strong></a>(self, numeric, target, reason)</dt><dd><tt>Sends a kill from a PyLink client.</tt></dd></dl>
|
2015-09-07 08:11:31 +02:00
|
|
|
|
2015-09-07 08:18:27 +02:00
|
|
|
<dl><dt><a name="InspIRCdProtocol-killServer"><strong>killServer</strong></a>(self, numeric, target, reason)</dt><dd><tt>Sends a kill from a PyLink server.</tt></dd></dl>
|
2015-09-07 08:11:31 +02:00
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-knockClient"><strong>knockClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a KNOCK from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-modeClient"><strong>modeClient</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends modes from a PyLink client. <modes> should be<br>
|
|
|
|
a list of (mode, arg) tuples, i.e. the format of utils.parseModes() output.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-modeServer"><strong>modeServer</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends modes from a PyLink server. <list of modes> should be<br>
|
|
|
|
a list of (mode, arg) tuples, i.e. the format of utils.parseModes() output.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-numericServer"><strong>numericServer</strong></a>(self, source, numeric, text)</dt></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-pingServer"><strong>pingServer</strong></a>(self, source=None, target=None)</dt><dd><tt>Sends a PING to a target server. Periodic PINGs are sent to our uplink<br>
|
|
|
|
automatically by the Irc() internals; plugins shouldn't have to use this.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-sjoinServer"><strong>sjoinServer</strong></a>(self, server, channel, users, ts=None)</dt><dd><tt>Sends an SJOIN for a group of users to a channel.<br>
|
|
|
|
<br>
|
|
|
|
The sender should always be a Server ID (SID). TS is optional, and defaults<br>
|
|
|
|
to the one we've stored in the channel state if not given.<br>
|
|
|
|
<users> is a list of (prefix mode, UID) pairs:<br>
|
|
|
|
<br>
|
|
|
|
Example uses:<br>
|
2015-09-07 08:18:27 +02:00
|
|
|
<a href="#Class-sjoinServer">sjoinServer</a>('100', '#test', [('', '100AAABBC'), ('qo', 100AAABBB'), ('h', '100AAADDD')])<br>
|
|
|
|
<a href="#Class-sjoinServer">sjoinServer</a>(self.<strong>irc</strong>.sid, '#test', [('o', self.<strong>irc</strong>.pseudoclient.uid)])</tt></dd></dl>
|
2015-09-07 08:11:31 +02:00
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-spawnClient"><strong>spawnClient</strong></a>(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype=None)</dt><dd><tt>Spawns a client with nick <nick> on the given IRC connection.<br>
|
|
|
|
<br>
|
|
|
|
Note: No nick collision / valid nickname checks are done here; it is<br>
|
|
|
|
up to plugins to make sure they don't introduce anything invalid.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-spawnServer"><strong>spawnServer</strong></a>(self, name, sid=None, uplink=None, desc=None)</dt><dd><tt>Spawns a server off a PyLink server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-squitServer"><strong>squitServer</strong></a>(self, source, target, text='No reason given')</dt><dd><tt>SQUITs a PyLink server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-topicServer"><strong>topicServer</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a burst topic from a PyLink server. This is usally used on burst.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-updateClient"><strong>updateClient</strong></a>(self, numeric, field, text)</dt><dd><tt>Updates the ident, host, or realname of a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
Methods inherited from <a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a>:<br>
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_error"><strong>handle_error</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles ERROR messages - these mean that our uplink has disconnected us!</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_kick"><strong>handle_kick</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming KICKs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_kill"><strong>handle_kill</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming KILLs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_mode"><strong>handle_mode</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming user mode changes. For channel mode changes,<br>
|
2015-09-07 08:18:27 +02:00
|
|
|
TMODE (TS6/charybdis) and FMODE (InspIRCd) are used instead.</tt></dd></dl>
|
2015-09-07 08:11:31 +02:00
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_nick"><strong>handle_nick</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming NICK changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_notice"><strong>handle_notice</strong></a> = handle_privmsg(self, source, command, args)</dt><dd><tt>Handles incoming PRIVMSG/NOTICE.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_part"><strong>handle_part</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PART commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_privmsg"><strong>handle_privmsg</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PRIVMSG/NOTICE.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_quit"><strong>handle_quit</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming QUITs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_save"><strong>handle_save</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SAVE messages, used to handle nick collisions.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_squit"><strong>handle_squit</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SQUITs (netsplits).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_topic"><strong>handle_topic</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming TOPIC changes from clients. For topic bursts,<br>
|
2015-09-07 08:18:27 +02:00
|
|
|
TB (TS6/charybdis) and FTOPIC (InspIRCd) are used instead.</tt></dd></dl>
|
2015-09-07 08:11:31 +02:00
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-kickClient"><strong>kickClient</strong></a>(self, numeric, channel, target, reason=None)</dt><dd><tt>Sends a kick from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-kickServer"><strong>kickServer</strong></a>(self, numeric, channel, target, reason=None)</dt><dd><tt>Sends a kick from a PyLink server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-messageClient"><strong>messageClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a PRIVMSG from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-nickClient"><strong>nickClient</strong></a>(self, numeric, newnick)</dt><dd><tt>Changes the nick of a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-noticeClient"><strong>noticeClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a NOTICE from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-parseArgs"><strong>parseArgs</strong></a>(self, args)</dt><dd><tt>Parses a string of <a href="http://www.rfc-editor.org/rfc/rfc1459.txt">RFC1459</a>-style arguments split into a list, where ":" may<br>
|
|
|
|
be used for multi-word arguments that last until the end of a line.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-parseTS6Args"><strong>parseTS6Args</strong></a>(self, args)</dt><dd><tt>Similar to <a href="#Class-parseArgs">parseArgs</a>(), but stripping leading colons from the first argument<br>
|
|
|
|
of a line (usually the sender field).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-partClient"><strong>partClient</strong></a>(self, client, channel, reason=None)</dt><dd><tt>Sends a part from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-quitClient"><strong>quitClient</strong></a>(self, numeric, reason)</dt><dd><tt>Quits a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-removeClient"><strong>removeClient</strong></a>(self, numeric)</dt><dd><tt>Internal function to remove a client from our internal state.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-topicClient"><strong>topicClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a TOPIC change from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
Data descriptors inherited from <a href="classes.html#Protocol">classes.Protocol</a>:<br>
|
|
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
|
|
</dl>
|
|
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
|
|
</dl>
|
|
|
|
</td></tr></table> <p>
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
<tr bgcolor="#ffc8d8">
|
|
|
|
<td colspan=3 valign=bottom> <br>
|
|
|
|
<font color="#000000" face="helvetica, arial"><a name="InspIRCdProtocol">class <strong>InspIRCdProtocol</strong></a>(<a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a>)</font></td></tr>
|
|
|
|
|
|
|
|
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
|
|
|
|
<td width="100%"><dl><dt>Method resolution order:</dt>
|
|
|
|
<dd><a href="inspircd.html#InspIRCdProtocol">InspIRCdProtocol</a></dd>
|
|
|
|
<dd><a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a></dd>
|
|
|
|
<dd><a href="classes.html#Protocol">classes.Protocol</a></dd>
|
|
|
|
<dd><a href="builtins.html#object">builtins.object</a></dd>
|
|
|
|
</dl>
|
|
|
|
<hr>
|
|
|
|
Methods defined here:<br>
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-__init__"><strong>__init__</strong></a>(self, irc)</dt></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-awayClient"><strong>awayClient</strong></a>(self, source, text)</dt><dd><tt>Sends an AWAY message from a PyLink client. <text> can be an empty string<br>
|
|
|
|
to unset AWAY status.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-connect"><strong>connect</strong></a>(self)</dt><dd><tt>Initializes a connection to a server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_away"><strong>handle_away</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming AWAY messages.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_encap"><strong>handle_encap</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming encapsulated commands (ENCAP). Hook arguments<br>
|
|
|
|
returned by this should have a parse_as field, that sets the correct<br>
|
|
|
|
hook name for the message.<br>
|
|
|
|
<br>
|
|
|
|
For InspIRCd, the only ENCAP command we handle right now is KNOCK.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_endburst"><strong>handle_endburst</strong></a>(self, numeric, command, args)</dt><dd><tt>ENDBURST handler; sends a hook with empty contents.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_events"><strong>handle_events</strong></a>(self, data)</dt><dd><tt>Event handler for the InspIRCd protocol. This passes most commands to<br>
|
|
|
|
the various handle_ABCD() functions elsewhere in this module, but also<br>
|
|
|
|
handles commands sent in the initial server linking phase.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_fhost"><strong>handle_fhost</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles FHOST, used for denoting hostname changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_fident"><strong>handle_fident</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles FIDENT, used for denoting ident changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_fjoin"><strong>handle_fjoin</strong></a>(self, servernumeric, command, args)</dt><dd><tt>Handles incoming FJOIN commands (InspIRCd equivalent of JOIN/SJOIN).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_fmode"><strong>handle_fmode</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles the FMODE command, used for channel mode changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_fname"><strong>handle_fname</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles FNAME, used for denoting real name/gecos changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_ftopic"><strong>handle_ftopic</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming FTOPIC (sets topic on burst).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_idle"><strong>handle_idle</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles the IDLE command, sent between servers in remote WHOIS queries.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_invite"><strong>handle_invite</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming INVITEs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_opertype"><strong>handle_opertype</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming OPERTYPE, which is used to denote an oper up.<br>
|
|
|
|
<br>
|
|
|
|
This calls the internal hook PYLINK_CLIENT_OPERED, sets the internal<br>
|
|
|
|
opertype of the client, and assumes setting user mode +o on the caller.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_ping"><strong>handle_ping</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PING commands, so we don't time out.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_pong"><strong>handle_pong</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PONG commands. This is used to keep track of whether<br>
|
|
|
|
the uplink is alive by the Irc() internals - a server that fails to reply<br>
|
|
|
|
to our PINGs eventually times out and is disconnected.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_server"><strong>handle_server</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SERVER commands (introduction of servers).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_uid"><strong>handle_uid</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming UID commands (user introduction).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-inviteClient"><strong>inviteClient</strong></a>(self, numeric, target, channel)</dt><dd><tt>Sends an INVITE from a PyLink client..</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-joinClient"><strong>joinClient</strong></a>(self, client, channel)</dt><dd><tt>Joins an internal spawned client <client> to a channel.</tt></dd></dl>
|
|
|
|
|
2015-09-07 08:18:27 +02:00
|
|
|
<dl><dt><a name="InspIRCdProtocol-killClient"><strong>killClient</strong></a>(self, numeric, target, reason)</dt><dd><tt>Sends a kill from a PyLink client.</tt></dd></dl>
|
2015-09-07 08:11:31 +02:00
|
|
|
|
2015-09-07 08:18:27 +02:00
|
|
|
<dl><dt><a name="InspIRCdProtocol-killServer"><strong>killServer</strong></a>(self, numeric, target, reason)</dt><dd><tt>Sends a kill from a PyLink server.</tt></dd></dl>
|
2015-09-07 08:11:31 +02:00
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-knockClient"><strong>knockClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a KNOCK from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-modeClient"><strong>modeClient</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends modes from a PyLink client. <modes> should be<br>
|
|
|
|
a list of (mode, arg) tuples, i.e. the format of utils.parseModes() output.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-modeServer"><strong>modeServer</strong></a>(self, numeric, target, modes, ts=None)</dt><dd><tt>Sends modes from a PyLink server. <list of modes> should be<br>
|
|
|
|
a list of (mode, arg) tuples, i.e. the format of utils.parseModes() output.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-numericServer"><strong>numericServer</strong></a>(self, source, numeric, text)</dt></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-pingServer"><strong>pingServer</strong></a>(self, source=None, target=None)</dt><dd><tt>Sends a PING to a target server. Periodic PINGs are sent to our uplink<br>
|
|
|
|
automatically by the Irc() internals; plugins shouldn't have to use this.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-sjoinServer"><strong>sjoinServer</strong></a>(self, server, channel, users, ts=None)</dt><dd><tt>Sends an SJOIN for a group of users to a channel.<br>
|
|
|
|
<br>
|
|
|
|
The sender should always be a Server ID (SID). TS is optional, and defaults<br>
|
|
|
|
to the one we've stored in the channel state if not given.<br>
|
|
|
|
<users> is a list of (prefix mode, UID) pairs:<br>
|
|
|
|
<br>
|
|
|
|
Example uses:<br>
|
2015-09-07 08:18:27 +02:00
|
|
|
<a href="#InspIRCdProtocol-sjoinServer">sjoinServer</a>('100', '#test', [('', '100AAABBC'), ('qo', 100AAABBB'), ('h', '100AAADDD')])<br>
|
|
|
|
<a href="#InspIRCdProtocol-sjoinServer">sjoinServer</a>(self.<strong>irc</strong>.sid, '#test', [('o', self.<strong>irc</strong>.pseudoclient.uid)])</tt></dd></dl>
|
2015-09-07 08:11:31 +02:00
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-spawnClient"><strong>spawnClient</strong></a>(self, nick, ident='null', host='null', realhost=None, modes=set(), server=None, ip='0.0.0.0', realname=None, ts=None, opertype=None)</dt><dd><tt>Spawns a client with nick <nick> on the given IRC connection.<br>
|
|
|
|
<br>
|
|
|
|
Note: No nick collision / valid nickname checks are done here; it is<br>
|
|
|
|
up to plugins to make sure they don't introduce anything invalid.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-spawnServer"><strong>spawnServer</strong></a>(self, name, sid=None, uplink=None, desc=None)</dt><dd><tt>Spawns a server off a PyLink server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-squitServer"><strong>squitServer</strong></a>(self, source, target, text='No reason given')</dt><dd><tt>SQUITs a PyLink server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-topicServer"><strong>topicServer</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a burst topic from a PyLink server. This is usally used on burst.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-updateClient"><strong>updateClient</strong></a>(self, numeric, field, text)</dt><dd><tt>Updates the ident, host, or realname of a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
Methods inherited from <a href="ts6_common.html#TS6BaseProtocol">ts6_common.TS6BaseProtocol</a>:<br>
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_error"><strong>handle_error</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles ERROR messages - these mean that our uplink has disconnected us!</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_kick"><strong>handle_kick</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming KICKs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_kill"><strong>handle_kill</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming KILLs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_mode"><strong>handle_mode</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming user mode changes. For channel mode changes,<br>
|
2015-09-07 08:18:27 +02:00
|
|
|
TMODE (TS6/charybdis) and FMODE (InspIRCd) are used instead.</tt></dd></dl>
|
2015-09-07 08:11:31 +02:00
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_nick"><strong>handle_nick</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming NICK changes.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_notice"><strong>handle_notice</strong></a> = handle_privmsg(self, source, command, args)</dt><dd><tt>Handles incoming PRIVMSG/NOTICE.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_part"><strong>handle_part</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PART commands.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_privmsg"><strong>handle_privmsg</strong></a>(self, source, command, args)</dt><dd><tt>Handles incoming PRIVMSG/NOTICE.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_quit"><strong>handle_quit</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming QUITs.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_save"><strong>handle_save</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SAVE messages, used to handle nick collisions.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_squit"><strong>handle_squit</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming SQUITs (netsplits).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-handle_topic"><strong>handle_topic</strong></a>(self, numeric, command, args)</dt><dd><tt>Handles incoming TOPIC changes from clients. For topic bursts,<br>
|
2015-09-07 08:18:27 +02:00
|
|
|
TB (TS6/charybdis) and FTOPIC (InspIRCd) are used instead.</tt></dd></dl>
|
2015-09-07 08:11:31 +02:00
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-kickClient"><strong>kickClient</strong></a>(self, numeric, channel, target, reason=None)</dt><dd><tt>Sends a kick from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-kickServer"><strong>kickServer</strong></a>(self, numeric, channel, target, reason=None)</dt><dd><tt>Sends a kick from a PyLink server.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-messageClient"><strong>messageClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a PRIVMSG from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-nickClient"><strong>nickClient</strong></a>(self, numeric, newnick)</dt><dd><tt>Changes the nick of a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-noticeClient"><strong>noticeClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a NOTICE from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-parseArgs"><strong>parseArgs</strong></a>(self, args)</dt><dd><tt>Parses a string of <a href="http://www.rfc-editor.org/rfc/rfc1459.txt">RFC1459</a>-style arguments split into a list, where ":" may<br>
|
|
|
|
be used for multi-word arguments that last until the end of a line.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-parseTS6Args"><strong>parseTS6Args</strong></a>(self, args)</dt><dd><tt>Similar to <a href="#InspIRCdProtocol-parseArgs">parseArgs</a>(), but stripping leading colons from the first argument<br>
|
|
|
|
of a line (usually the sender field).</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-partClient"><strong>partClient</strong></a>(self, client, channel, reason=None)</dt><dd><tt>Sends a part from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-quitClient"><strong>quitClient</strong></a>(self, numeric, reason)</dt><dd><tt>Quits a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-removeClient"><strong>removeClient</strong></a>(self, numeric)</dt><dd><tt>Internal function to remove a client from our internal state.</tt></dd></dl>
|
|
|
|
|
|
|
|
<dl><dt><a name="InspIRCdProtocol-topicClient"><strong>topicClient</strong></a>(self, numeric, target, text)</dt><dd><tt>Sends a TOPIC change from a PyLink client.</tt></dd></dl>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
Data descriptors inherited from <a href="classes.html#Protocol">classes.Protocol</a>:<br>
|
|
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
|
|
</dl>
|
|
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
|
|
</dl>
|
|
|
|
</td></tr></table></td></tr></table><p>
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
<tr bgcolor="#55aa55">
|
|
|
|
<td colspan=3 valign=bottom> <br>
|
|
|
|
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
|
|
|
|
|
|
|
|
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
|
2015-09-07 08:18:27 +02:00
|
|
|
<td width="100%"><strong>conf</strong> = {'bot': {'loglevel': 'CRITICAL', 'nick': 'PyLink', 'realname': 'PyLink Service Client', 'serverdesc': 'PyLink unit tests', 'user': 'pylink'}, 'servers': defaultdict(<function <lambda> at 0x7f0dbb516c80>, {})}<br>
|
2015-09-07 08:11:31 +02:00
|
|
|
<strong>curdir</strong> = 'protocols'<br>
|
|
|
|
<strong>log</strong> = <logging.RootLogger object></td></tr></table>
|
|
|
|
</body></html>
|