Changeset 9767d03


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.

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • dcc.c

    rf7cc734 r9767d03  
    214214                              df->ft->file_name, ipaddr, port, df->ft->file_size);
    215215
    216         irc_send_msg_raw(iu, "PRIVMSG", iu->irc->user->nick, cmd, 0);
     216        irc_send_msg_raw(iu, "PRIVMSG", iu->irc->user->nick, cmd);
    217217
    218218        g_free(cmd);
  • irc.h

    rf7cc734 r9767d03  
    343343void irc_send_whois(irc_user_t *iu);
    344344void irc_send_who(irc_t *irc, GSList *l, const char *channel);
    345 void irc_send_msg(irc_user_t *iu, const char *type, const char *dst, const char *msg, const char *prefix, time_t ts);
    346 void irc_send_msg_raw(irc_user_t *iu, const char *type, const char *dst, const char* tags, const char *msg);
     345void irc_send_msg(irc_user_t *iu, const char *type, const char *dst, const char *msg, const char *prefix);
     346void irc_send_msg_raw(irc_user_t *iu, const char *type, const char *dst, const char *msg);
    347347void irc_send_msg_f(irc_user_t *iu, const char *type, const char *dst, const char *format, ...) G_GNUC_PRINTF(4, 5);
    348348void irc_send_nick(irc_user_t *iu, const char *new_nick);
     
    352352void irc_send_cap(irc_t *irc, char *subcommand, char *body);
    353353void irc_send_away_notify(irc_user_t *iu);
     354
     355G_GNUC_INTERNAL void irc_send_msg_ts(irc_user_t *iu, const char *type, const char *dst, const char *msg, const char *prefix, time_t ts);
     356G_GNUC_INTERNAL void irc_send_msg_raw_tags(irc_user_t *iu, const char *type, const char *dst, const char* tags, const char *msg);
    354357
    355358/* irc_user.c */
     
    365368char *set_eval_timezone(struct set *set, char *value);
    366369char *irc_format_timestamp(irc_t *irc, time_t msg_ts);
    367 char *irc_format_servertime(irc_t *irc, time_t msg_ts);
     370G_GNUC_INTERNAL char *irc_format_servertime(irc_t *irc, time_t msg_ts);
    368371char *set_eval_self_messages(struct set *set, char *value);
    369372
  • irc_channel.c

    rf7cc734 r9767d03  
    500500        va_end(params);
    501501
    502         irc_send_msg(ic->irc->root, "PRIVMSG", ic->name, text, NULL, 0);
     502        irc_send_msg(ic->irc->root, "PRIVMSG", ic->name, text, NULL);
    503503        g_free(text);
    504504}
  • irc_commands.c

    rf7cc734 r9767d03  
    524524           for lag checks, so try to support that. */
    525525        if (nick_cmp(NULL, cmd[1], irc->user->nick) == 0) {
    526                 irc_send_msg(irc->user, "NOTICE", irc->user->nick, cmd[2], NULL, 0);
     526                irc_send_msg(irc->user, "NOTICE", irc->user->nick, cmd[2], NULL);
    527527        } else if ((iu = irc_user_by_name(irc, cmd[1]))) {
    528528                iu->f->privmsg(iu, cmd[2]);
     
    825825        int i;
    826826
    827         irc_send_msg_raw(irc->root, "NOTICE", irc->user->nick, "COMPLETIONS OK", 0);
     827        irc_send_msg_raw(irc->root, "NOTICE", irc->user->nick, "COMPLETIONS OK");
    828828
    829829        for (i = 0; root_commands[i].command; i++) {
     
    839839        }
    840840
    841         irc_send_msg_raw(irc->root, "NOTICE", irc->user->nick, "COMPLETIONS END", 0);
     841        irc_send_msg_raw(irc->root, "NOTICE", irc->user->nick, "COMPLETIONS END");
    842842}
    843843
  • irc_im.c

    rf7cc734 r9767d03  
    305305
    306306        wrapped = word_wrap(msg, IRC_WORD_WRAP);
    307         irc_send_msg(src_iu, message_type, dst, wrapped, prefix, sent_at);
     307        irc_send_msg_ts(src_iu, message_type, dst, wrapped, prefix, sent_at);
    308308        g_free(wrapped);
    309309
     
    347347        g_string_append_c(msg, '\001');
    348348
    349         irc_send_msg((irc_user_t *) bu->ui_data, "NOTICE", irc->user->nick, msg->str, NULL, 0);
     349        irc_send_msg((irc_user_t *) bu->ui_data, "NOTICE", irc->user->nick, msg->str, NULL);
    350350
    351351        g_string_free(msg, TRUE);
     
    707707
    708708        wrapped = word_wrap(msg, IRC_WORD_WRAP);
    709         irc_send_msg(iu, "PRIVMSG", ic->name, wrapped, ts, sent_at);
     709        irc_send_msg_ts(iu, "PRIVMSG", ic->name, wrapped, ts, sent_at);
    710710        g_free(ts);
    711711        g_free(wrapped);
     
    819819        irc_send_msg_f(iu, "PRIVMSG", irc->user->nick, "<< \002BitlBee\002 - Invitation to chatroom %s >>", name);
    820820        if (msg) {
    821                 irc_send_msg(iu, "PRIVMSG", irc->user->nick, msg, NULL, 0);
     821                irc_send_msg(iu, "PRIVMSG", irc->user->nick, msg, NULL);
    822822        }
    823823        if (chan) {
  • 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",
  • irc_user.c

    rf7cc734 r9767d03  
    261261static gboolean self_privmsg(irc_user_t *iu, const char *msg)
    262262{
    263         irc_send_msg(iu, "PRIVMSG", iu->nick, msg, NULL, 0);
     263        irc_send_msg(iu, "PRIVMSG", iu->nick, msg, NULL);
    264264
    265265        return TRUE;
Note: See TracChangeset for help on using the changeset viewer.