Add support for kicking a user.

FossilOrigin-Name: 4e0ae8ca4e99ea1eaefd15503ca0d2402814a1a10d4ad3267b0b9e2442ed2aa2
This commit is contained in:
Jonathan Schleifer 2011-09-10 23:11:18 +00:00
parent 842476ea96
commit 50a00bbe98
2 changed files with 13 additions and 2 deletions

View file

@ -85,6 +85,8 @@
@property (copy) OFString *nickname, *username, *realname; @property (copy) OFString *nickname, *username, *realname;
@property (retain) id <IRCConnectionDelegate, OFObject> delegate; @property (retain) id <IRCConnectionDelegate, OFObject> delegate;
- (void)sendLine: (OFString*)line;
- (void)sendLineWithFormat: (OFConstantString*)line, ...;
- (void)connect; - (void)connect;
- (void)disconnect; - (void)disconnect;
- (void)disconnectWithReason: (OFString*)reason; - (void)disconnectWithReason: (OFString*)reason;
@ -92,8 +94,6 @@
- (void)leaveChannel: (IRCChannel*)channel; - (void)leaveChannel: (IRCChannel*)channel;
- (void)leaveChannel: (IRCChannel*)channel - (void)leaveChannel: (IRCChannel*)channel
withReason: (OFString*)reason; withReason: (OFString*)reason;
- (void)sendLine: (OFString*)line;
- (void)sendLineWithFormat: (OFConstantString*)line, ...;
- (void)sendMessage: (OFString*)msg - (void)sendMessage: (OFString*)msg
toChannel: (IRCChannel*)channel; toChannel: (IRCChannel*)channel;
- (void)sendMessage: (OFString*)msg - (void)sendMessage: (OFString*)msg
@ -102,5 +102,8 @@
toUser: (IRCUser*)user; toUser: (IRCUser*)user;
- (void)sendNotice: (OFString*)notice - (void)sendNotice: (OFString*)notice
toChannel: (IRCChannel*)channel; toChannel: (IRCChannel*)channel;
- (void)kickUser: (IRCUser*)user
fromChannel: (IRCChannel*)channel
withReason: (OFString*)reason;
- (void)handleConnection; - (void)handleConnection;
@end @end

View file

@ -150,6 +150,14 @@
[self sendLineWithFormat: @"NOTICE %@ :%@", channel.name, notice]; [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 - (void)handleConnection
{ {
OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];