From 842476ea96e5115d9ade3ac7163ab07a326269e2 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sat, 10 Sep 2011 19:59:12 +0000 Subject: [PATCH] Add support for sending notices. FossilOrigin-Name: 84aa37ee2ebcf403cbbaea796a48c5af26d800bd7db673ff7894f5ca8a685bbd --- src/IRCConnection.h | 4 ++++ src/IRCConnection.m | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/IRCConnection.h b/src/IRCConnection.h index 02c7149..f787ed5 100644 --- a/src/IRCConnection.h +++ b/src/IRCConnection.h @@ -98,5 +98,9 @@ toChannel: (IRCChannel*)channel; - (void)sendMessage: (OFString*)msg toUser: (IRCUser*)user; +- (void)sendNotice: (OFString*)notice + toUser: (IRCUser*)user; +- (void)sendNotice: (OFString*)notice + toChannel: (IRCChannel*)channel; - (void)handleConnection; @end diff --git a/src/IRCConnection.m b/src/IRCConnection.m index f1062d7..5c4d657 100644 --- a/src/IRCConnection.m +++ b/src/IRCConnection.m @@ -138,6 +138,18 @@ [self sendLineWithFormat: @"PRIVMSG %@ :%@", user.nickname, msg]; } +- (void)sendNotice: (OFString*)notice + toUser: (IRCUser*)user +{ + [self sendLineWithFormat: @"NOTICE %@ :%@", user.nickname, notice]; +} + +- (void)sendNotice: (OFString*)notice + toChannel: (IRCChannel*)channel +{ + [self sendLineWithFormat: @"NOTICE %@ :%@", channel.name, notice]; +} + - (void)handleConnection { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];