From 50a00bbe987a3408b750e620030814589927f1e4 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sat, 10 Sep 2011 23:11:18 +0000 Subject: [PATCH] Add support for kicking a user. FossilOrigin-Name: 4e0ae8ca4e99ea1eaefd15503ca0d2402814a1a10d4ad3267b0b9e2442ed2aa2 --- src/IRCConnection.h | 7 +++++-- src/IRCConnection.m | 8 ++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/IRCConnection.h b/src/IRCConnection.h index f787ed5..c7c250c 100644 --- a/src/IRCConnection.h +++ b/src/IRCConnection.h @@ -85,6 +85,8 @@ @property (copy) OFString *nickname, *username, *realname; @property (retain) id delegate; +- (void)sendLine: (OFString*)line; +- (void)sendLineWithFormat: (OFConstantString*)line, ...; - (void)connect; - (void)disconnect; - (void)disconnectWithReason: (OFString*)reason; @@ -92,8 +94,6 @@ - (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 @@ -102,5 +102,8 @@ toUser: (IRCUser*)user; - (void)sendNotice: (OFString*)notice toChannel: (IRCChannel*)channel; +- (void)kickUser: (IRCUser*)user + fromChannel: (IRCChannel*)channel + withReason: (OFString*)reason; - (void)handleConnection; @end diff --git a/src/IRCConnection.m b/src/IRCConnection.m index 5c4d657..afb597b 100644 --- a/src/IRCConnection.m +++ b/src/IRCConnection.m @@ -150,6 +150,14 @@ [self sendLineWithFormat: @"NOTICE %@ :%@", channel.name, notice]; } +- (void)kickUser: (IRCUser*)user + fromChannel: (IRCChannel*)channel + withReason: (OFString*)reason +{ + [self sendLineWithFormat: @"KICK %@ %@ :%@", + channel.name, user.nickname, reason]; +} + - (void)handleConnection { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];