Ejemplo n.º 1
0
void
chatwin_outgoing_msg(ProfChatWin *chatwin, const char *const message, char *id, prof_enc_t enc_mode)
{
    assert(chatwin != NULL);

    char enc_char = '-';
    if (enc_mode == PROF_MSG_OTR) {
        enc_char = prefs_get_otr_char();
    } else if (enc_mode == PROF_MSG_PGP) {
        enc_char = prefs_get_pgp_char();
    }

    if (prefs_get_boolean(PREF_RECEIPTS_REQUEST) && id) {
        win_print_with_receipt((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message, id);
    } else {
        win_print((ProfWin*)chatwin, enc_char, 0, NULL, 0, THEME_TEXT_ME, "me", message);
    }
}
Ejemplo n.º 2
0
void
win_print_incoming_message(ProfWin *window, GDateTime *timestamp,
    const char *const from, const char *const message, prof_enc_t enc_mode)
{
    char enc_char = '-';

    switch (window->type)
    {
        case WIN_CHAT:
            if (enc_mode == PROF_MSG_OTR) {
                enc_char = prefs_get_otr_char();
            } else if (enc_mode == PROF_MSG_PGP) {
                enc_char = prefs_get_pgp_char();
            }
            win_print(window, enc_char, 0, timestamp, NO_ME, THEME_TEXT_THEM, from, message);
            break;
        case WIN_PRIVATE:
            win_print(window, '-', 0, timestamp, NO_ME, THEME_TEXT_THEM, from, message);
            break;
        default:
            assert(FALSE);
            break;
    }
}