Skip to content

Commit

Permalink
stats overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
c99koder committed Sep 5, 2018
1 parent 88eedb1 commit 64e291c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
1 change: 0 additions & 1 deletion IRCCloud/Classes/EventsDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ -(id)init {
@"server_luserconns": status, @"server_luserme": status, @"server_n_local": status,
@"server_luserchannels": status, @"server_n_global": status, @"server_yourhost": status,
@"server_created": status, @"server_luserunknown": status,
@"help_topics_start": status, @"help_topics": status, @"help_topics_end": status, @"helphdr": status, @"helpop": status, @"helptlr": status, @"helphlp": status, @"helpfwd": status, @"helpign": status, @"help": status,
@"btn_metadata_set": status, @"logged_in_as": status, @"sasl_success": status, @"you_are_operator": status,
@"server_snomask": status, @"starircd_welcome": status, @"zurna_motd": status, @"codepage": status, @"logged_out": status,
@"nick_locked": status, @"text": status, @"admin_info": status,
Expand Down
17 changes: 12 additions & 5 deletions IRCCloud/Classes/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -956,22 +956,29 @@ - (void)handleEvent:(NSNotification *)notification {
o = notification.object;
type = o.type;

if([type isEqualToString:@"help"]) {
if([type isEqualToString:@"help"] || [type isEqualToString:@"stats"]) {
TextTableViewController *tv;
if([self.presentedViewController isKindOfClass:UINavigationController.class] && [((UINavigationController *)self.presentedViewController).viewControllers.firstObject isKindOfClass:TextTableViewController.class]) {
tv = ((UINavigationController *)self.presentedViewController).viewControllers.firstObject;
if(![tv.type isEqualToString:type])
tv = nil;
}
NSString *msg = [o objectForKey:@"parts"];
if([[o objectForKey:@"msg"] length]) {
if(msg.length)
msg = [msg stringByAppendingFormat:@": %@", [o objectForKey:@"msg"]];
else
msg = [o objectForKey:@"msg"];
}
msg = [msg stringByAppendingString:@"\n"];
if(tv) {
[tv appendText:[o objectForKey:@"msg"]];
[tv appendText:@"\n"];
[tv appendText:msg];
} else {
tv = [[TextTableViewController alloc] initWithText:[o objectForKey:@"msg"]];
tv = [[TextTableViewController alloc] initWithText:msg];
if([[o objectForKey:@"command"] length])
tv.navigationItem.title = [NSString stringWithFormat:@"HELP For %@", [o objectForKey:@"command"]];
else
tv.navigationItem.title = @"HELP";
tv.navigationItem.title = type.uppercaseString;
tv.server = [[ServersDataSource sharedInstance] getServer:_buffer.cid];
tv.type = type;
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:tv];
Expand Down
3 changes: 1 addition & 2 deletions IRCCloud/Classes/NetworkConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -969,12 +969,11 @@ -(id)init {
@"wallops", @"logged_in_as", @"sasl_fail", @"sasl_too_long", @"sasl_aborted", @"sasl_already",
@"you_are_operator", @"btn_metadata_set", @"sasl_success", @"version", @"channel_name_change",
@"cap_ls", @"cap_list", @"cap_new", @"cap_del", @"cap_req",@"cap_ack",@"cap_nak",@"cap_raw",@"cap_invalid",
@"help_topics_start", @"help_topics", @"help_topics_end", @"helphdr", @"helpop", @"helptlr", @"helphlp", @"helpfwd", @"helpign", @"help",
@"newsflash", @"invited", @"server_snomask", @"codepage", @"logged_out", @"nick_locked", @"info_response", @"generic_server_info",
@"unknown_umode", @"bad_ping", @"cap_raw", @"rehashed_config", @"knock", @"bad_channel_mask", @"kill_deny",
@"chan_own_priv_needed", @"not_for_halfops", @"chan_forbidden", @"starircd_welcome", @"zurna_motd",
@"ambiguous_error_message", @"list_usage", @"list_syntax", @"who_syntax", @"text", @"admin_info",
@"watch_status", @"sqline_nick", @"user_chghost", @"loaded_module", @"unloaded_module", @"invite_notify"]) {
@"watch_status", @"sqline_nick", @"user_chghost", @"loaded_module", @"unloaded_module", @"invite_notify", @"help"]) {
[parserMap setObject:msg forKey:type];
}

Expand Down
1 change: 0 additions & 1 deletion IRCCloud/Classes/TextTableViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@
-(id)initWithData:(NSArray *)data;
-(id)initWithText:(NSString *)text;
-(void)appendData:(NSArray *)data;
-(void)setText:(NSString *)text;
-(void)appendText:(NSString *)text;
@end

0 comments on commit 64e291c

Please sign in to comment.