Add support for sending messages.

FossilOrigin-Name: a372ef7d502ced8bb8228baed8f1fbaef3452b6de1efd0f5106e4e673d3384a2
This commit is contained in:
Jonathan Schleifer 2011-09-09 17:00:22 +00:00
parent c841e501f9
commit f530dc0633
2 changed files with 16 additions and 0 deletions

View file

@ -79,5 +79,9 @@
withReason: (OFString*)reason;
- (void)sendLine: (OFString*)line;
- (void)sendLineWithFormat: (OFConstantString*)line, ...;
- (void)sendMessage: (OFString*)msg
toChannel: (IRCChannel*)channel;
- (void)sendMessage: (OFString*)msg
toUser: (IRCUser*)user;
- (void)handleConnection;
@end

View file

@ -126,6 +126,18 @@
[pool release];
}
- (void)sendMessage: (OFString*)msg
toChannel: (IRCChannel*)channel
{
[self sendLineWithFormat: @"PRIVMSG %@ :%@", channel.name, msg];
}
- (void)sendMessage: (OFString*)msg
toUser: (IRCUser*)user
{
[self sendLineWithFormat: @"PRIVMSG %@ :%@", user.nickname, msg];
}
- (void)handleConnection
{
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];