Home arrow Delphi-Kylix arrow Page 4 - A Brief Look at Indy
DELPHI-KYLIX

A Brief Look at Indy


In this second article in a three-part series, we will discuss the Indy suite, a component which can be used for building an IRC client in Delphi. We will examine its capabilities and determine the minimum level of functionality needed for an IRC client.

Author Info:
By: Leidago
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
January 15, 2007
TABLE OF CONTENTS:
  1. · A Brief Look at Indy
  2. · idIRCclient Component Properties
  3. · idIRCclient Component Events
  4. · More Events

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
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.

blog comments powered by Disqus
DELPHI-KYLIX ARTICLES

- Loading an XML Document into the DOM
- Delphi Wrapper Classes and XML
- Delphi and the DOM
- Delphi and XML
- Internet Access: Client Service
- Finishing the Client for an Internet Access ...
- The Client for an Internet Access Control Ap...
- User Management for an Internet Access Contr...
- Important Procedures for an Internet Access ...
- Server Code for an Internet Access Control A...
- Constructing the Interface for an Internet A...
- Building a Server Application for an Interne...
- Building an Internet Access Control Applicat...
- Client Dataset: Working with Data Packets an...
- Using the Client Dataset in an N-Tiered Appl...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials