These are chat archives for IndySockets/Indy
TIdIRCreceives a message, the sender's nickname is put in the
TIdIRC.FSenderNickmember, and the sender's hostname in the
TIdIRC.FSenderHostmember, before the
OnRawevent is triggered. Those members are then passed to various event handlers (
OnNotice, etc), but not to
OnRaw. So you will have to access the members directly. They are
protectedso you can derive a class from
TIdIRCto declare your own properties to read them.
Nameis the component's name on the Form, not the sender's name
TIdIRCdoesn't do that for you. Though, if you knew the text was always UTF-8, you could set the
IndyTextEncoding_UTF8beforehand. But IRC is more flexible than that, and there may be multiple charsets used in a single channel at a time. You might have to use
IndyTextEncoding_8bitinstead and manually parse the raw bytes to detect which charsets are being used.
IndyTextEncoding_...are functions in
IdGlobal.hppthat return such interfaces, eg:
IdIRC1->IOHandler->DefStringEncoding = IndyTextEncoding_UTF8();
TIdIRCconnect to servers in the exact same way
TIdIRCis a multi-threaded component. It uses an internal worker thread to read incoming data. The
TIdContextparameter represents the thread that is calling the event handlers. Similar to the events in
TIdTCPServer. However, in the case of the
OnRawevent in particular, the
NULLfor outgoing commands. The
TIdContextwill only be non-
NULLfor incoming commands/notifications from the server.