descriptionIRC client framework (wrapper around libircclient library).
ownersaid@saidachmiz.net
last changeTue, 21 Dec 2021 22:44:30 +0000 (21 17:44 -0500)
content tags
add:
README.md

This is a modified version of the IRCClient framework by Nathan Ollerenshaw. It is partly based on the libircclient library by Georgy Yunaev. (See LICENSE for more info.) I’ve rewritten it to allow robust support for arbitrary text encodings, and fixed various other problems, as well making it fully Objective C native code. The original version of IRCClient, as well as libircclient, is available here: http://sourceforge.net/projects/libircclient/.


Adding IRCClient to your application

(using Xcode) (these instructions apply to Xcode 7.1.1, build 7B1005)

  1. Place the entire IRCClient folder in your project folder

  2. Using File -> Add Files…, add IRCClient.xcodeproj to your project

  3. Build the IRCClient framework target

  4. Make sure the Header Search Paths build setting of your project contains the following entry:

$(PROJECT_DIR)/
    (non-recursive)
  1. Configure the build phases for your application target thusly:

    * Add `IRCClient.framework` to **Link Binary With Libraries**
    * Add `IRCClient.framework` to **Target Dependencies**
    * Add a **Copy Files** build phase
    * Set destination for the just-added **Copy Files** build phase to **Frameworks**
    * Add `IRCClient.framework` to the just-added **Copy Files** build phase
    
  2. Import IRCClient’s API into your code using #import <IRCClient/IRCClient.h>

  3. If you’re using Swift in your project, add IRCClient/IRCClient.h to the Objective-C Bridging Header build setting.

Documentation

See the following header files for documentation:

NOTE on strings

IRCClient stores and passes all strings (messages, nicks, channel names, mode strings, channel topics, etc.) as NSData objects. Values passed to framework methods (such as the IRC commands) should also be in this format[^1]. This means that IRCClient is encoding-agnostic[^1]; it is up to you to pass it properly encoded representations of your text strings, and it is also up to you to select an appropriate encoding for display or other handling of received strings, as necessary. The encoding property of IRCClientSession and IRCClientChannel may be useful in this regard (i.e. for the convenience of associating a server’s or channel’s preferred encoding with the relevant server or channel object), although note that this property is almost entirely epiphenomenal[^2].

[^1]: Of course, IRCClient does not support UTF-16 nor any other non-8-bit encoding, as the IRC protocol does not support such encodings either.

[^2]: The encoding property of IRCClientSession does have one effect: it controls the encoding used by replies to CTCP TIME requests.


Usage

To use this framework, you will need to write an IRCClientSessionDelegate to handle all of the events generated by the server, and an IRCClientChannelDelegate to handle all of the events generated by channels on that server.

You then create an IRCClientSession object in your code, assign the required properties, and call -[connect:] to connect to the server, place the connection on a new event queue and start receiving events. For example:

IRCClientSession *session = [IRCClientSession session];
MyIRCClientSessionDelegate *controller = [[MyIRCClientSessionDelegate alloc] init];

session.delegate = controller;
controller.session = session;

session.server = @"irc.libera.chat".dataAsUTF8;
session.port = 6667;
[session setNickname:@"test".dataAsUTF8
            username:@"test".dataAsUTF8
            realname:@"test".dataAsUTF8];
[session connect];

If you have questions, bug reports, or suggestions regarding IRCClient, find Obormot on the Libera.Chat IRC network.

If you have any questions, bug reports, suggestions regarding libircclient, please visit http://sourceforge.net/projects/libircclient/.

shortlog
2021-12-21 Said AchmizRewrite of core IRC code in Objective C (NSStream)master
2021-12-13 Said AchmizTransition from libircclient color conversion to native
2021-12-05 achmizsPrep for future functionality; added comments
2021-12-05 achmizsSome more code cleanup
2021-12-05 achmizsUpdated for SA_NSDataExtensions changes
2021-12-05 achmizsMiscellaneous fixes and code cleanup to libircclient
2021-12-05 achmizsDeleted README
2021-12-05 achmizsUpdated info comments, README.md, and LICENSE
2021-12-05 achmizsUpdated README
2021-12-05 achmizsLarge refactoring
2021-12-05 achmizsCode style cleanup
2021-12-05 achmizsRewrite some IRCClientChannel functionality to rely...
2021-12-05 achmizsUpdated project layout
2021-12-05 achmizsRemove submodule
2021-12-04 achmizsAdded #define to IRCClient.h
2016-04-03 Said AchmizFixed bug in IRCClientSession join method
...
heads
2 years ago master