Changeset f7cc734 for irc_util.c


Ignore:
Timestamp:
2018-07-31T04:41:25Z (6 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
9767d03
Parents:
c82e4ca
git-author:
Philippe Daouadi <philippe@…> (15-03-17 17:06:52)
git-committer:
dequis <dx@…> (31-07-18 04:41:25)
Message:

irc: implement server-time capability

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_util.c

    rc82e4ca rf7cc734  
    120120}
    121121
     122char *irc_format_servertime(irc_t *irc, time_t msg_ts)
     123{
     124        struct tm msg;
     125
     126        if (msg_ts <= 0) {
     127                return NULL;
     128        }
     129
     130        gmtime_r(&msg_ts, &msg);
     131
     132        return g_strdup_printf("@time=%04d-%02d-%02dT"
     133                               "%02d:%02d:%02d.000Z",
     134                               msg.tm_year + 1900, msg.tm_mon + 1, msg.tm_mday,
     135                               msg.tm_hour, msg.tm_min, msg.tm_sec);
     136}
    122137
    123138char *set_eval_self_messages(set_t *set, char *value)
Note: See TracChangeset for help on using the changeset viewer.