Fix deprecated method use in CTCP TIME reply code
This commit is contained in:
parent
1982408acd
commit
247b3785c3
@ -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(¤t_time);
|
||||||
|
time_info = localtime(¤t_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
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user