Index: src/IRCConnection.h ================================================================== --- src/IRCConnection.h +++ src/IRCConnection.h @@ -77,7 +77,11 @@ - (void)leaveChannel: (IRCChannel*)channel; - (void)leaveChannel: (IRCChannel*)channel 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 Index: src/IRCConnection.m ================================================================== --- src/IRCConnection.m +++ src/IRCConnection.m @@ -123,10 +123,22 @@ [self sendLine: line]; [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]; OFString *line;