description | IRC client framework (wrapper around libircclient library). |
owner | said@saidachmiz.net |
last change | Tue, 21 Dec 2021 22:44:30 +0000 (21 17:44 -0500) |
URL | git://repo.or.cz/IRCClient.git |
https://repo.or.cz/IRCClient.git | |
push URL | ssh://repo.or.cz/IRCClient.git |
https://repo.or.cz/IRCClient.git (learn more) | |
bundle info | IRCClient.git downloadable bundles |
content tags |
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/.
(using Xcode) (these instructions apply to Xcode 7.1.1, build 7B1005)
Place the entire IRCClient
folder in your project folder
Using File -> Add Files…, add IRCClient.xcodeproj
to your project
Build the IRCClient
framework target
Make sure the Header Search Paths build setting of your project contains the following entry:
$(PROJECT_DIR)/
(non-recursive)
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
Import IRCClient’s API into your code using #import <IRCClient/IRCClient.h>
If you’re using Swift in your project, add IRCClient/IRCClient.h
to the Objective-C Bridging Header build setting.
See the following header files for documentation:
IRCClientSession.h
IRCClientSessionDelegate.h
IRCClientChannel.h
IRCClientChannelDelegate.h
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.
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/.
2 years ago | master | logtree |