A Brief Look at Indy - More Events
(Page 4 of 4 )
The following CTCP query event handlers can suppress the standard response by setting the Suppress parameter to True.
OnCTCPQuery A user sent you a CTCP query.
OnCTCPReply Received a reply from a CTCP query.
OnOped You were oped in a channel.
OnDeoped You were deoped in a channel.
OnBanned You were banned in a channel.
OnUnbanned You were unbanned in a channel.
OnVoiced You were given a voice in a channel.
OnDevoiced Your voice was taken away in a channel.
OnKilled You were killed.
OnNotify A person on your notify list has joined IRC.
OnDenotify A person on your notify list has left IRC.
OnLag Update on the current lag time.
DCC events to be added later:
OnChat Someone wants to initiate a DCC chat.
OnChatClosed The DCC chat was closed.
OnFileReceive Someone wants to send you a file.
OnFileReceived The file was received successfully.
OnFileSend A file is offered to someone.
OnFileSent The file was sent successfully.
OnFileError There was an error during file transfer.
OnDCC General DCC event handler.
OnDCCChat Someone wants to DCC Chat
OnDCCSend Someone wants to Send you a File Via DCC
OnDCCResume Someone is requesting a DCC File RESUME
OnDCCAccept Someone has ACCEPTED your DCC File RESUME request
Methods:
Connect Connect to the IRC network.
Disconnect Force a disconnect from the IRC network.
Raw Send the command directly to the IRC server.
Say Send a message to a user/channel.
Notice Send a notice to a user/channel.
Join Join channel/s with given key/s.
Part Part channel/s with an optional reason (if supported
by the IRC server).
Kick Kick a person from a channel.
Quit Quit the IRC network.
CTCP Send a CTCP command to a user/channel.
CTCPReply Send a reply to a CTCP command.
IsChannel Returns True if the name is a channel name.
IsOp Returns True if the user has operator status.
IsVoice Returns True if the user has a voice.
MatchHostmask Returns True if the address matches the hostmask.
GetTopic Get the topic for the specified channel.
SetTopic Set the topic for the specific channel.
Ban Ban hostmask/s from a channel.
Unban Unban hostmask/s from a channel.
Op Op nick/s in a channel.
Deop Deop nick/s in a channel.
Voice Give a voice to nick/s.
Devoice Take voice from nick/s.
Invite Invite someone to a channel.
DCCChat Initiate a DCC chat.
DCCSend Initiate a DCC send of a file.
As you can see, the idIRCclient component is very extensive and implements almost all of the commands that are required by the Internet Relay Chat Protocol. Also, you will note that there is a huge number of commands. And so the question arises: how many of these commands must you implement in order to have a reasonably acceptable IRC client? That would depend on your needs. To build a client with minimal implementation, you need to have the following functionality:
- Client must be able to connect to an IRC server.
- Client must be able to join a channel.
- Client must be able to send a message.
- Client must be able to receive messages.
Conclusion
The sheer number of commands that need to be implemented can frighten a programmer away from trying to write an IRC client. But it is not really that difficult to write a client as you will see in the next article. The list does not contain all the commands that are listed in the idirc.pas file, but it does contain the ones that are the most used and needed. In this article we worked out what a minimal IRC client will need to work comfortably with many IRC servers. However in the next article we will implement a client that will meet and surpass these requirements.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |