Add support for sending messages.
FossilOrigin-Name: a372ef7d502ced8bb8228baed8f1fbaef3452b6de1efd0f5106e4e673d3384a2
This commit is contained in:
parent
c841e501f9
commit
f530dc0633
2 changed files with 16 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue