Skip to content

Commit

Permalink
Fix display of expanded netsplit events
Browse files Browse the repository at this point in the history
  • Loading branch information
c99koder committed Nov 22, 2013
1 parent a8d1bad commit bb84804
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions IRCCloud/Classes/CollapsedEvents.m
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ -(void)addCollapsedEvent:(CollapsedEvent *)event {
e.type = kCollapsedEventPopIn;
}
e.eid = event.eid;
e.netsplit = event.netsplit;
[event copyModes:e];
} else {
[_data addObject:event];
Expand Down Expand Up @@ -341,7 +342,7 @@ -(BOOL)addEvent:(Event *)event {
if(event.type == kCollapsedEventNetSplit && [event.msg isEqualToString:event.msg])
match = YES;
}
if(!match) {
if(!match && _data.count > 0) {
CollapsedEvent *e = [[CollapsedEvent alloc] init];
e.type = kCollapsedEventNetSplit;
e.msg = event.msg;
Expand Down Expand Up @@ -435,6 +436,7 @@ -(NSString *)collapse:(BOOL)showChan {
break;
}
} else {
BOOL isNetsplit = NO;
[_data sortUsingSelector:@selector(compare:)];
NSEnumerator *i = [_data objectEnumerator];
CollapsedEvent *last = nil;
Expand All @@ -448,7 +450,7 @@ -(NSString *)collapse:(BOOL)showChan {

do {
next = [i nextObject];
} while(next.netsplit);
} while(isNetsplit && next.netsplit);

if(message.length > 0 && e.type < kCollapsedEventNickChange && ((next == nil || next.type != e.type) && last != nil && last.type == e.type)) {
if(groupcount == 1) {
Expand All @@ -461,6 +463,8 @@ -(NSString *)collapse:(BOOL)showChan {
if(last == nil || last.type != e.type) {
switch(e.type) {
case kCollapsedEventNetSplit:
isNetsplit = YES;
NSLog(@"Netsplit");
break;
case kCollapsedEventMode:
if(message.length)
Expand Down

0 comments on commit bb84804

Please sign in to comment.