Fix deprecated method use in CTCP TIME reply code

This commit is contained in:
Said Achmiz 2016-03-11 21:23:29 -05:00
parent 1982408acd
commit 247b3785c3

View File

@ -477,7 +477,16 @@ static NSDictionary* ircNumericCodeList;
} }
else if (!strcmp (the_request, "TIME")) else if (!strcmp (the_request, "TIME"))
{ {
// irc_cmd_ctcp_reply(_irc_session, the_nick, [[[NSDate dateWithTimeIntervalSinceNow:0] descriptionWithCalendarFormat:@"TIME %a %b %e %H:%M:%S %Z %Y" timeZone:nil locale:[[NSUserDefaults standardUserDefaults] dictionaryRepresentation]] cStringUsingEncoding:_encoding]); time_t current_time;
char timestamp[40];
struct tm *time_info;
time(&current_time);
time_info = localtime(&current_time);
strftime(timestamp, 40, "TIME %a %b %e %H:%M:%S %Z %Y", time_info);
irc_cmd_ctcp_reply(_irc_session, the_nick, timestamp);
} }
else else
{ {