Skip to content
This repository was archived by the owner on Jul 3, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions Sources/App/Classes/IRC/IRCClient.m
Original file line numberDiff line numberDiff line change
Expand Up@@ -224,6 +224,7 @@ @interface IRCClient ()
@property (nonatomic, strong) TLOTimer *whoTimer;
@property (nonatomic, assign) BOOL capabilityNegotiationIsPaused;
@property (nonatomic, assign) BOOL invokingISONCommandForFirstTime;
@property (nonatomic, assign) BOOL invokingBatchedISONCommand;
@property (nonatomic, assign) BOOL isTerminating; // Is being destroyed
@property (nonatomic, assign) BOOL inWhoisResponse;
@property (nonatomic, assign) BOOL inWhowasResponse;
Expand All@@ -241,6 +242,7 @@ @interface IRCClient ()
@property (nonatomic, assign) NSUInteger autojoinDelayedWarningCount;
@property (nonatomic, copy, nullable) NSString *tryingNicknameSentNickname;
@property (nonatomic, strong) NSMutableArray<IRCChannel *> *channelListPrivate;
@property (nonatomic, strong) NSMutableArray<NSString *> *onlineNicknames;
@property (nonatomic, strong, nullable) NSMutableArray<IRCChannel *> *channelsToAutojoin;
@property (nonatomic, strong) IRCAddressBookMatchCache *addressBookMatchCache;
@property (nonatomic, strong) IRCAddressBookUserTrackingContainer *trackedUsers;
Expand DownExpand Up@@ -320,6 +322,8 @@ - (void)prepareInitialState

self.trackedUsers = [[IRCAddressBookUserTrackingContainer alloc] initWithClient:self];

self.onlineNicknames = [NSMutableArray array];

self.requestedCommands = [IRCClientRequestedCommands new];

self.lastMessageServerTime = self.config.lastMessageServerTime;
Expand DownExpand Up@@ -9463,6 +9467,16 @@ - (void)receiveNumericReply:(IRCMessage *)m

NSArray *onlineNicknames = [onlineNicknamesString componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];

[self.onlineNicknames addObjectsFromArray: onlineNicknames];

/* If we were invoking a batched ISON command and there's still
batches to process, wait until we've the last batch before
updating the channel list */
if (self.invokingBatchedISONCommand)
return;

onlineNicknames = self.onlineNicknames;

/* Start going over the list of tracked nicknames */
NSDictionary *trackedUsers = self.trackedUsers.trackedUsers;

Expand DownExpand Up@@ -12161,16 +12175,21 @@ - (void)_sendIsonForNicknames:(NSArray<NSString *> *)nicknames hideResponse:(BOO
if (nicknames.count == 0) {
return;
}

[self.onlineNicknames removeAllObjects];

if (hideResponse == NO) {
[self.requestedCommands recordIsonRequestOpenedAsVisible];
} else {
[self.requestedCommands recordIsonRequestOpened];
}

NSString *nicknamesString = [nicknames componentsJoinedByString:@" "];

[self send:@"ISON", nicknamesString, nil];
self.invokingBatchedISONCommand = true;
[nicknames enumerateSubarraysOfSize:8 usingBlock:^(NSArray *objects, BOOL *stop) {
NSString *nicknamesString = [objects componentsJoinedByString:@" "];
[self send:@"ISON", nicknamesString, nil];
}];
self.invokingBatchedISONCommand = false;
}

- (void)requestChannelList
Expand Down