Package twisted :: Package protocols :: Module irc :: Class DccChat

[show private | hide private]
[frames | no frames]

## Class DccChat

    BaseProtocol --+
                   |
            Protocol --+
                       |
            LineReceiver --+
                           |
               Ephemeral --+
                           |
                          DccChat

Direct Client Connection protocol type CHAT.

DCC CHAT is really just your run o' the mill basic.LineReceiver protocol. This class only varies from that slightly, accepting either LF or CR LF for a line delimeter for incoming messages while always using CR LF for outgoing.

The lineReceived method implemented here uses the DCC connection's 'client' attribute (provided upon construction) to deliver incoming lines from the DCC chat via IRCClient's normal privmsg interface. That's something of a spoof, which you may well want to override.

Method Summary
| ``__init__`(self, client, queryData)` Initialize a new DCC CHAT session.
| `__getstate__(self)` (inherited from `Ephemeral`)
| `__setstate__(self, state)` (inherited from `Ephemeral`)
| ``connectionFailed`(self)` (Deprecated) (inherited from `Protocol`)
| ``connectionLost`(self, reason)` Called when the connection is shut down. (inherited from `Protocol`)
| ``connectionMade`(self)` Called when a connection is made. (inherited from `BaseProtocol`)
| ``dataReceived`(self, data)` Protocol.dataReceived.
| ``lineLengthExceeded`(self, line)` Called when the maximum line length has been reached. (inherited from `LineReceiver`)
| ``lineReceived`(self, line)` Override this for when each line is received.
| ``makeConnection`(self, transport)` Make a connection to a transport and a server. (inherited from `BaseProtocol`)
| ``rawDataReceived`(self, data)` Override this for when raw data is received. (inherited from `LineReceiver`)
| ``sendLine`(self, line)` Sends a line to the other end of the connection. (inherited from `LineReceiver`)
| ``setLineMode`(self, extra)` Sets the line-mode of this receiver. (inherited from `LineReceiver`)
| ``setRawMode`(self)` Sets the raw mode of this receiver. (inherited from `LineReceiver`)

Class Variable Summary
`str` | `buffer`
`NoneType` | `client`
`str` | `delimiter`
`NoneType` | `queryData`
`NoneType` | `remoteParty`

Method Details

### __init__(self, client, queryData=None)
(Constructor)

Initialize a new DCC CHAT session.

queryData is a 3-tuple of (fromUser, targetUserOrChannel, data) as received by the CTCP query.

(To be honest, fromUser is the only thing that's currently used here. targetUserOrChannel is potentially useful, while the 'data' argument is soley for informational purposes.)

### dataReceived(self, data)

Protocol.dataReceived. Translates bytes into lines, and calls lineReceived (or rawDataReceived, depending on mode.)

  Overrides:
    `twisted.protocols.basic.LineReceiver.dataReceived` (inherited documentation)

### lineReceived(self, line)

Override this for when each line is received.

  Overrides:
    `twisted.protocols.basic.LineReceiver.lineReceived` (inherited documentation)

Class Variable Details

### buffer

  Type:
    `str`
  Value:

        ''

### client

  Type:
    `NoneType`
  Value:

        None

### delimiter

  Type:
    `str`
  Value:

        '''\r
        '''

### queryData

  Type:
    `NoneType`
  Value:

        None

### remoteParty

  Type:
    `NoneType`
  Value:

        None

Generated by Epydoc 1.1 on Thu May 8 13:18:49 2003 | http://epydoc.sf.net