diff --git a/src/IRCConnection.h b/src/IRCConnection.h index 7f44d53..e5351a0 100644 --- a/src/IRCConnection.h +++ b/src/IRCConnection.h @@ -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 diff --git a/src/IRCConnection.m b/src/IRCConnection.m index 729598f..7a5d76e 100644 --- a/src/IRCConnection.m +++ b/src/IRCConnection.m @@ -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];