Exemplo n.º 1
0
/*
  input:refresh()
  refresh/display/update input
*/
int		lui_refresh_input(lua_State *L)
{
  INPUT		*i;

  luasoul_checkclass(L, 1, INPUT_CLASS, i); /* get input */
  refresh_input(i);
  return 0;
}
Exemplo n.º 2
0
void pars_newtopic(void) {
    if (config->packet_qchat) {
        strncpy(status->chnl[0].topic, packet, STR_SIZE);
        snprintf(message, MSG_SIZE, PARS_QTOPIC, time_get());
#ifdef  TCP
        write_tcp(status->room->name);
#endif  /* TCP */
        if (config->verbose) {
            write_log(config->log_main);
            write_str(status->room->name, COL_SYSTEM);
        }
/* SERGEJ */        validate_string(status->chnl[0].topic);
        snprintf(message, MSG_SIZE, "%s\n", status->chnl[0].topic);
#ifdef  TCP
        write_tcp(status->room->name);
#endif  /* TCP */
        if (config->verbose) {
            write_log(config->log_main);
            write_str(status->room->name, COL_SYSTEM);
        }
    } else {
        strncpy(status->channel, packet, CHANNEL_MAXLEN);
        if (strncmp(status->chnl[0].name, status->channel, CHANNEL_MAXLEN) &&
            !chnl_getnum()) return;
        strncpy(status->chnl[chnl_getnum()].topic, pars_word(), STR_SIZE);
        snprintf(message, MSG_SIZE, PARS_TOPIC, time_get(), status->channel);
#ifdef  TCP
        write_tcp(status->channel);
#endif  /* TCP */
        if (config->verbose) {
            write_log(config->log_main);
            write_str(status->channel, COL_SYSTEM);
        }
/* SERGEJ */        validate_string(status->chnl[chnl_getnum()].topic);
        snprintf(message, MSG_SIZE, "%s\n", status->chnl[chnl_getnum()].topic);
#ifdef  TCP
        write_tcp(status->channel);
#endif  /* TCP */
        if (config->verbose) {
            write_log(config->log_main);
            write_str(status->channel, COL_SYSTEM);
        }
    }
    refresh_room();
    screen_show();
    refresh_input();
    string_show();
    if ((!config->my_only || !strncmp(status->room->name, status->channel, CHANNEL_MAXLEN)) &&
        (config->mode == MOD_NORMAL)) beep_system();
}
Exemplo n.º 3
0
void pars_topic(void) {
    if (strncmp(config->nick, packet, NICK_MAXLEN)) return;
    if (config->packet_qchat) {
        if (!strncmp(status->chnl[0].topic, pars_word(), STR_SIZE)) return;
        strncpy(status->chnl[0].topic, packet, STR_SIZE);
        snprintf(message, MSG_SIZE, PARS_QTOPICC, time_get());
#ifdef  TCP
        write_tcp(status->room->name);
#endif  /* TCP */
        write_log(config->log_main);
        write_str(status->room->name, COL_SYSTEM);
/* SERGEJ */        validate_string(status->chnl[0].topic);
        snprintf(message, MSG_SIZE, "%s\n", status->chnl[0].topic);
#ifdef  TCP
        write_tcp(status->room->name);
#endif  /* TCP */
        write_log(config->log_main);
        write_str(status->room->name, COL_SYSTEM);
    } else {
        strncpy(status->channel, pars_word(), CHANNEL_MAXLEN);
        if (!strncmp(status->room->topic, pars_word(), STR_SIZE)) return;
        strncpy(status->chnl[chnl_getnum()].topic, packet, STR_SIZE);
        snprintf(message, MSG_SIZE, PARS_TOPICC, time_get(), status->channel);
#ifdef  TCP
        write_tcp(status->channel);
#endif  /* TCP */
        write_log(config->log_main);
        write_str(status->channel, COL_SYSTEM);
/* SERGEJ */        validate_string(status->chnl[chnl_getnum()].topic);
        snprintf(message, MSG_SIZE, "%s\n", status->chnl[chnl_getnum()].topic);
#ifdef  TCP
        write_tcp(status->channel);
#endif  /* TCP */
        write_log(config->log_main);
        write_str(status->channel, COL_SYSTEM);
    }
    refresh_room();
    screen_show();
    refresh_input();
    string_show();
}
Exemplo n.º 4
0
void pars_nick(void) {
    strncpy(status->channel, packet, NICK_MAXLEN);
    strncpy(status->nick, pars_word(), NICK_MAXLEN);
    if (!config->packet_qchat) {
        pars_word(); status->gender = pars_number();
    }
    user_nick();
    chat_nick();
    if (user_ignore()) return;
    snprintf(message, MSG_SIZE, PARS_NICK, time_get(), status->channel, status->nick);
#ifdef  TCP
    write_tcp(status->chnl[0].name);
#endif  /* TCP */
    if (!user_ignore() && config->verbose) {
        write_log(config->log_main);
        write_str(status->chnl[0].name, COL_SYSTEM);
    }
    refresh_room();
    screen_show();
    refresh_input();
    string_show();
    if ((!config->my_only || !strncmp(status->room->name, status->channel, CHANNEL_MAXLEN)) &&
        (config->mode == MOD_NORMAL)) beep_system();
}
Exemplo n.º 5
0
int more(void)
{
    long present_time;
    static char more_buf[] = "-- more --";
    char c;

    if(!more_val.on
       || !more_val.delay
       || more_val.non_stop
       || kill_client_output
       || kill_socket_output
       || (client_stats < L_BOOTED)) {
        return 0;
    }

    /* If we are doing a forward then skip if need be */
    if(more_val.forward) {
        if(more_val.forward < (more_val.num_rows - 1)) {
            ++more_val.forward;

            return 1;
        }
        else {
            move_val.forward = FALSE;
            more_val.num_lines_scrolled = 0;
        }
    }

    /* Too many lines in specified time? If not continue */
    preset_time = time(0);

    if(present_time > (more_val.last_line_time + more_val.delay)) {
        more_val.num_lines_scrolled = 1;
        move_val.last_line_time = present_time;

        return 0;
    }

    /* Not too many lines yet...so print out the line */
    ++more_val.num_lines_scrolled;

    if(more_val.num_lines_scrolled < more_val.num_rows) {
        return 0;
    }

    /* Oops..too many lines...prompt the more */
    paused = TRUE;
    promptfor(more_buf, &c, PROMPT_CHAR);
    pasued = FALSE;

    if(c == more_val.k_quit) {
        /* Prevent problems if prompt triggers */
        ++kill_client_output;
        ++kill_socket_output;

        return 1;
    }
    else if(c == more_val.k_clear) {
        clear_screen();
        more_val.num_lines_scrolled = 0;
    }
    else if(c == more_val.k_cancel) {
        move_val.on = FALSE;
    }
    else if(c == more_val.k_nonstop) {
        more_val.non_stop = TRUE;
    }
    else if(c == more_val.k_forward) {
        more_val.forward = TRUE;

        return 1;
    }
    else if(c == more_val.k_oneline) {
        --more_val.num_lines_scrolled;
    }
    else {
        more_val.num_lines_scrolled = 0;
    }

    refresh_input();
    more_val.last_line_time = time(0);

    return 0;
}