Changeset b57fed0 for irc_commands.c


Ignore:
Timestamp:
2015-09-11T02:31:10Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
d797fb4
Parents:
dc96e6e
git-author:
dequis <dx@…> (18-08-15 04:46:34)
git-committer:
dequis <dx@…> (11-09-15 02:31:10)
Message:

CAP LS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_commands.c

    rdc96e6e rb57fed0  
    110110}
    111111
     112/* version can be "302" or NULL, but we don't need cap-3.2 for anything yet */
     113static void irc_cmd_cap_ls(irc_t *irc, char *version) {
     114        int i;
     115        GString *str = g_string_sized_new(256);
     116
     117        for (i = 0; supported_caps[i].name; i++) {
     118                if (i != 0) {
     119                        g_string_append_c(str, ' ');
     120                }
     121                g_string_append(str, supported_caps[i].name);
     122        }
     123
     124        irc_send_cap(irc, "LS", str->str);
     125
     126        g_string_free(str, TRUE);
     127}
     128
    112129static void irc_cmd_cap(irc_t *irc, char **cmd)
    113130{
     
    118135
    119136        if (g_strcasecmp(cmd[1], "LS") == 0) {
    120                 /* gboolean irc302 = (g_strcmp0(cmd[2], "302") == 0); */
    121                 //char *ls = g_strjoinv(" ", (char **) supported_caps);
    122 
    123                 irc_send_cap(irc, "LS", "foo bar");
    124 
    125                 //g_free(ls);
     137                irc_cmd_cap_ls(irc, cmd[2]);
    126138
    127139        } else if (g_strcasecmp(cmd[1], "LIST") == 0) {
Note: See TracChangeset for help on using the changeset viewer.