Пример #1
0
char*
roster_barejid_autocomplete(const char *const search_str, gboolean previous)
{
    assert(roster != NULL);

    return autocomplete_complete(roster->barejid_ac, search_str, TRUE, previous);
}
Пример #2
0
char*
roster_group_autocomplete(const char *const search_str)
{
    assert(roster != NULL);

    return autocomplete_complete(roster->groups_ac, search_str, TRUE);
}
Пример #3
0
char*
roster_barejid_autocomplete(const char *const search_str)
{
    assert(roster != NULL);

    return autocomplete_complete(roster->barejid_ac, search_str, TRUE);
}
Пример #4
0
char*
roster_contact_autocomplete(const char *const search_str)
{
    assert(roster != NULL);

    return autocomplete_complete(roster->name_ac, search_str, TRUE);
}
Пример #5
0
char*
muc_autocomplete(ProfWin *window, const char *const input, gboolean previous)
{
    if (window->type != WIN_MUC) {
        return NULL;
    }

    ProfMucWin *mucwin = (ProfMucWin*)window;
    assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK);
    ChatRoom *chat_room = g_hash_table_lookup(rooms, mucwin->roomjid);
    if (chat_room == NULL || chat_room->nick_ac == NULL) {
        return NULL;
    }

    const char * search_str = NULL;

    gchar *last_space = g_strrstr(input, " ");
    if (!last_space) {
        search_str = input;
        if (!chat_room->autocomplete_prefix) {
            chat_room->autocomplete_prefix = strdup("");
        }
    } else {
        search_str = last_space+1;
        if (!chat_room->autocomplete_prefix) {
            chat_room->autocomplete_prefix = g_strndup(input, search_str - input);
        }
    }

    char *result = autocomplete_complete(chat_room->nick_ac, search_str, FALSE, previous);
    if (result == NULL) {
        return NULL;
    }

    GString *replace_with = g_string_new(chat_room->autocomplete_prefix);
    g_string_append(replace_with, result);

    if (strlen(chat_room->autocomplete_prefix) == 0) {
        g_string_append(replace_with, ": ");
    }
    g_free(result);
    result = replace_with->str;
    g_string_free(replace_with, FALSE);
    return result;
}
Пример #6
0
void
muc_autocomplete(char *input, int *size)
{
    char *recipient = ui_current_recipient();
    Autocomplete nick_ac = muc_get_roster_ac(recipient);
    if (nick_ac != NULL) {
        input[*size] = '\0';
        gchar *last_space = g_strrstr(input, " ");
        char *result = NULL;
        if (last_space == NULL) {
            result = autocomplete_complete(nick_ac, input);
        } else {
            int len = (last_space - input);
            char *start_str = strndup(input, len);
            result = autocomplete_param_with_ac(input, size, start_str, nick_ac);
            free(start_str);
        }
        if (result != NULL) {
            ui_replace_input(input, result, size);
            g_free(result);
            return;
        }
    }
}
Пример #7
0
void
muc_autocomplete(char *input, int *size)
{
    char *recipient = ui_current_recipient();
    ChatRoom *chat_room = g_hash_table_lookup(rooms, recipient);

    if (chat_room && chat_room->nick_ac) {
        input[*size] = '\0';
        char *search_str = NULL;

        gchar *last_space = g_strrstr(input, " ");
        if (!last_space) {
            search_str = input;
            if (!chat_room->autocomplete_prefix) {
                chat_room->autocomplete_prefix = strdup("");
            }
        } else {
            search_str = last_space+1;
            if (!chat_room->autocomplete_prefix) {
                chat_room->autocomplete_prefix = g_strndup(input, search_str - input);
            }
        }

        char *result = autocomplete_complete(chat_room->nick_ac, search_str, FALSE);
        if (result) {
            GString *replace_with = g_string_new(chat_room->autocomplete_prefix);
            g_string_append(replace_with, result);
            if (!last_space || (*(last_space+1) == '\0')) {
                g_string_append(replace_with, ": ");
            }
            ui_replace_input(input, replace_with->str, size);
            g_string_free(replace_with, TRUE);
            g_free(result);
        }
    }
}
Пример #8
0
static char *
_bookmark_find(char *search_str)
{
    return autocomplete_complete(bookmark_ac, search_str);
}
Пример #9
0
char*
bookmark_find(const char *const search_str)
{
    return autocomplete_complete(bookmark_ac, search_str, TRUE);
}
Пример #10
0
char*
bookmark_find(const char *const search_str, gboolean previous)
{
    return autocomplete_complete(bookmark_ac, search_str, TRUE, previous);
}
Пример #11
0
char *
muc_invites_find(char *search_str)
{
    return autocomplete_complete(invite_ac, search_str, TRUE);
}
Пример #12
0
char*
muc_invites_find(const char *const search_str, gboolean previous)
{
    return autocomplete_complete(invite_ac, search_str, TRUE, previous);
}
Пример #13
0
char *
roster_find_group(char *search_str)
{
    return autocomplete_complete(groups_ac, search_str, TRUE);
}
Пример #14
0
char *
muc_find_invite(char *search_str)
{
    return autocomplete_complete(invite_ac, search_str);
}
Пример #15
0
char*
accounts_find_all(const char *const prefix)
{
    return autocomplete_complete(all_ac, prefix, TRUE);
}
Пример #16
0
char*
tlscerts_complete(const char *const prefix)
{
    return autocomplete_complete(certs_ac, prefix, TRUE);
}
Пример #17
0
char*
roster_barejid_autocomplete(const char *const search_str)
{
    return autocomplete_complete(barejid_ac, search_str, TRUE);
}
Пример #18
0
char*
roster_group_autocomplete(const char *const search_str)
{
    return autocomplete_complete(groups_ac, search_str, TRUE);
}
Пример #19
0
char*
roster_contact_autocomplete(const char *const search_str)
{
    return autocomplete_complete(name_ac, search_str, TRUE);
}
Пример #20
0
char*
muc_confserver_find(const char *const search_str, gboolean previous)
{
    return autocomplete_complete(confservers_ac, search_str, TRUE, previous);
}
Пример #21
0
char*
blocked_ac_find(const char *const search_str)
{
    return autocomplete_complete(blocked_ac, search_str, TRUE);
}
Пример #22
0
char *
roster_find_contact(char *search_str)
{
    return autocomplete_complete(name_ac, search_str, TRUE);
}
Пример #23
0
char*
accounts_find_enabled(const char *const prefix)
{
    return autocomplete_complete(enabled_ac, prefix, TRUE);
}
Пример #24
0
static char *
_presence_sub_request_find(char * search_str)
{
    return autocomplete_complete(sub_requests_ac, search_str, TRUE);
}
Пример #25
0
char *
prefs_autocomplete_boolean_choice(char *prefix)
{
    return autocomplete_complete(boolean_choice_ac, prefix);
}
Пример #26
0
char*
prefs_autocomplete_room_trigger(const char *const prefix)
{
    return autocomplete_complete(room_trigger_ac, prefix, TRUE);
}
Пример #27
0
char *
roster_find_resource(char *search_str)
{
    return autocomplete_complete(fulljid_ac, search_str, TRUE);
}
Пример #28
0
char*
prefs_autocomplete_boolean_choice(const char *const prefix)
{
    return autocomplete_complete(boolean_choice_ac, prefix, TRUE);
}
Пример #29
0
char *
roster_find_jid(char *search_str)
{
    return autocomplete_complete(barejid_ac, search_str, TRUE);
}
Пример #30
0
char*
p_gpg_autocomplete_key(const char *const search_str)
{
    return autocomplete_complete(key_ac, search_str, TRUE);
}