Keep track of users in a channel.
FossilOrigin-Name: 5f51d55981a74610c7d36038d540cc689b15d41194b00b2e8b0c7428bf102341
This commit is contained in:
parent
77e2dba178
commit
318f4a2c1b
5 changed files with 83 additions and 1 deletions
|
@ -23,7 +23,7 @@
|
|||
#import "IRCChannel.h"
|
||||
|
||||
@implementation IRCChannel
|
||||
@synthesize name;
|
||||
@synthesize name, users;
|
||||
|
||||
+ channelWithName: (OFString*)name
|
||||
{
|
||||
|
@ -36,6 +36,7 @@
|
|||
|
||||
@try {
|
||||
name = [name_ copy];
|
||||
users = [[OFMutableSet alloc] init];
|
||||
} @catch (id e) {
|
||||
[self release];
|
||||
@throw e;
|
||||
|
@ -47,6 +48,7 @@
|
|||
- (void)dealloc
|
||||
{
|
||||
[name release];
|
||||
[users release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
@ -55,4 +57,14 @@
|
|||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
- (void)IRC_addUser: (OFString*)user
|
||||
{
|
||||
[users addObject: user];
|
||||
}
|
||||
|
||||
- (void)IRC_removeUser: (OFString*)user
|
||||
{
|
||||
[users removeObject: user];
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue