Example #1
0
static void
feature_notify_excepts(void)
{
    char imaxlist[BUFSIZE] = "";
    char cmodebuf[BUFSIZE] = "";

    if (feature_bool(FEAT_EXCEPTS)) {
        add_isupport_s("EXCEPTS", "e");
        add_isupport_i("MAXEXCEPTS", feature_int(FEAT_MAXEXCEPTS));
    } else {
        del_isupport("EXCEPTS");
        del_isupport("MAXEXCEPTS");
    }

    /* "be,AkU,Ll,aCcDdiMmNnOpQRrSsTtZz" */

    ircd_snprintf(0, cmodebuf, BUFSIZE, "b%s,%sk%s,Ll,aCcDdiMmNnOpQRrSsTtZz",
                  feature_bool(FEAT_EXCEPTS) ? "e" : "",
                  feature_bool(FEAT_OPLEVELS) ? "A" : "",
                  feature_bool(FEAT_OPLEVELS) ? "U" : "");

    add_isupport_s("CHANMODES", cmodebuf);

    strcat(imaxlist, "b:");
    strcat(imaxlist, itoa(feature_int(FEAT_MAXBANS)));
    if (feature_bool(FEAT_EXCEPTS)) {
        strcat(imaxlist, ",e:");
        strcat(imaxlist, itoa(feature_int(FEAT_MAXEXCEPTS)));
    }

    add_isupport_s("MAXLIST", imaxlist);
}
Example #2
0
/** Set EXTBANS if they are enabled. */
static void
set_isupport_extbans(void)
{
  char imaxlist[BUFSIZE] = "";

  if (feature_bool(FEAT_EXTBANS)) {
    strcat(imaxlist, "~,");

    if (feature_bool(FEAT_EXTBAN_a))
      strcat(imaxlist, "a");
    if (feature_bool(FEAT_EXTBAN_c))
      strcat(imaxlist, "c");
    if (feature_bool(FEAT_EXTBAN_j))
      strcat(imaxlist, "j");
    if (feature_bool(FEAT_EXTBAN_n))
      strcat(imaxlist, "n");
    if (feature_bool(FEAT_EXTBAN_q))
      strcat(imaxlist, "q");
    if (feature_bool(FEAT_EXTBAN_r))
      strcat(imaxlist, "r");
    if (feature_bool(FEAT_EXTBAN_R))
      strcat(imaxlist, "R");
    if (feature_bool(FEAT_EXTBAN_t))
      strcat(imaxlist, "t");

    add_isupport_s("EXTBANS", imaxlist);
  }
}
Example #3
0
/** Set EXCEPTS, MAXEXCEPTS, and CHANMODES based on if HALFOPS are enabled or not */
static void
set_isupport_excepts(void)
{
    char imaxlist[BUFSIZE] = "";

    if (feature_bool(FEAT_EXCEPTS)) {
      add_isupport_s("EXCEPTS", "e");
      add_isupport_i("MAXEXCEPTS", feature_int(FEAT_MAXEXCEPTS));
    } else {
      del_isupport("EXCEPTS");
      del_isupport("MAXEXCEPTS");
    }

    add_isupport_s("CHANMODES", feature_bool(FEAT_EXCEPTS) ? "be,k,lL,acimnprstzCMNOQSTZ" : "b,k,lL,acimnprstzCMNOQSTZ");

    strcat(imaxlist, "b:");
    strcat(imaxlist, itoa(feature_int(FEAT_MAXBANS)));
    if (feature_bool(FEAT_EXCEPTS)) {
      strcat(imaxlist, ",e:");
      strcat(imaxlist, itoa(feature_int(FEAT_MAXEXCEPTS)));
    }

    add_isupport_s("MAXLIST", imaxlist);
}
Example #4
0
/** Set MAXBANS, self explanatory */
static void
set_isupport_maxbans(void)
{
    char imaxlist[BUFSIZE] = "";

    add_isupport_i("MAXBANS", feature_int(FEAT_MAXBANS));

    strcat(imaxlist, "b:");
    strcat(imaxlist, itoa(feature_int(FEAT_MAXBANS)));
    if (feature_bool(FEAT_EXCEPTS)) {
        strcat(imaxlist, ",e:");
        strcat(imaxlist, itoa(feature_int(FEAT_MAXEXCEPTS)));
    }

    add_isupport_s("MAXLIST", imaxlist);
}
Example #5
0
/** Update whether #me has oplevels support or not.
*/
static void
feature_notify_oplevels(void)
{
    char cmodebuf[BUFSIZE] = "";

    if (feature_bool(FEAT_OPLEVELS))
        SetOpLevels(&me);
    else
        ClearOpLevels(&me);

    /* "be,AkU,Ll,aCcDdiMmNnOpQRrSsTtZz" */

    ircd_snprintf(0, cmodebuf, BUFSIZE, "b%s,%sk%s,Ll,aCcDdiMmNnOpQRrSsTtZz",
                  feature_bool(FEAT_EXCEPTS) ? "e" : "",
                  feature_bool(FEAT_OPLEVELS) ? "A" : "",
                  feature_bool(FEAT_OPLEVELS) ? "U" : "");

    add_isupport_s("CHANMODES", cmodebuf);
}
Example #6
0
/** Set NETWORK, self explanatory */
static void
set_isupport_network(void)
{
    add_isupport_s("NETWORK", feature_str(FEAT_NETWORK));
}
Example #7
0
/** Set CHANTYPES, self explanatory */
static void
set_isupport_chantypes(void)
{
    add_isupport_s("CHANTYPES", feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#");
}
Example #8
0
/** Set PREFIX and STATUSMSG modes based on if HALFOPS are enabled or not */
static void
set_isupport_halfops(void)
{
    add_isupport_s("PREFIX", feature_bool(FEAT_HALFOPS) ? "(ohv)@%+" : "(ov)@+");
    add_isupport_s("STATUSMSG", feature_bool(FEAT_HALFOPS) ? "@%+" : "@+");
}