Changeset 9767d03 for irc_send.c


Ignore:
Timestamp:
2018-07-31T04:41:55Z (6 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
fa1bc1d
Parents:
f7cc734
git-author:
dequis <dx@…> (31-07-18 04:41:21)
git-committer:
dequis <dx@…> (31-07-18 04:41:55)
Message:

Modify server-time implementation to not change API

The new functions with the different paramters are flagged as internal,
so it doesn't even add new symbols.

abi-compliance checker says it's 100% compatible, yay.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_send.c

    rf7cc734 r9767d03  
    136136
    137137        dst = irc_user_msgdest(iu);
    138         irc_send_msg(iu, cmd, dst, text, NULL, 0);
     138        irc_send_msg(iu, cmd, dst, text, NULL);
    139139}
    140140
     
    363363}
    364364
    365 void irc_send_msg(irc_user_t *iu, const char *type, const char *dst, const char *msg, const char *prefix, time_t ts)
     365void irc_send_msg(irc_user_t *iu, const char *type, const char *dst, const char *msg, const char *prefix)
     366{
     367        irc_send_msg_ts(iu, type, dst, msg, prefix, 0);
     368}
     369
     370void irc_send_msg_ts(irc_user_t *iu, const char *type, const char *dst, const char *msg, const char *prefix, time_t ts)
    366371{
    367372        char last = 0;
     
    384389                }
    385390                if (*s == 0 || *s == '\n') {
    386                         if (ts)
     391                        if (ts) {
    387392                                tags = irc_format_servertime(iu->irc, ts);
     393                        }
    388394                        if (g_strncasecmp(line, "/me ", 4) == 0 && (!prefix || !*prefix) &&
    389395                            g_strcasecmp(type, "PRIVMSG") == 0) {
     
    391397                                strncat(raw_msg, line + 4, s - line - 4);
    392398                                strcat(raw_msg, "\001");
    393                                 irc_send_msg_raw(iu, type, dst, tags, raw_msg);
     399                                irc_send_msg_raw_tags(iu, type, dst, tags, raw_msg);
    394400                        } else {
    395401                                *raw_msg = '\0';
     
    398404                                }
    399405                                strncat(raw_msg, line, s - line);
    400                                 irc_send_msg_raw(iu, type, dst, tags, raw_msg);
     406                                irc_send_msg_raw_tags(iu, type, dst, tags, raw_msg);
    401407                        }
    402                         if (ts)
     408                        if (ts) {
    403409                                g_free(tags);
     410                        }
    404411                        line = s + 1;
    405412                }
     
    408415}
    409416
    410 void irc_send_msg_raw(irc_user_t *iu, const char *type, const char *dst, const char* tags, const char *msg)
     417void irc_send_msg_raw(irc_user_t *iu, const char *type, const char *dst, const char *msg)
     418{
     419        irc_send_msg_raw_tags(iu, type, dst, NULL, msg);
     420}
     421
     422void irc_send_msg_raw_tags(irc_user_t *iu, const char *type, const char *dst, const char* tags, const char *msg)
    411423{
    412424        irc_write(iu->irc, "%s%s:%s!%s@%s %s %s :%s",
Note: See TracChangeset for help on using the changeset viewer.