예제 #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
파일: muc.c 프로젝트: pasis/profanity
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
파일: muc.c 프로젝트: NYAMNYAM3/profanity
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
파일: muc.c 프로젝트: Liangwz/profanity
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
파일: bookmark.c 프로젝트: mrshu/profanity
static char *
_bookmark_find(char *search_str)
{
    return autocomplete_complete(bookmark_ac, search_str);
}
예제 #9
0
파일: bookmark.c 프로젝트: 0xPoly/profanity
char*
bookmark_find(const char *const search_str)
{
    return autocomplete_complete(bookmark_ac, search_str, TRUE);
}
예제 #10
0
파일: bookmark.c 프로젝트: pasis/profanity
char*
bookmark_find(const char *const search_str, gboolean previous)
{
    return autocomplete_complete(bookmark_ac, search_str, TRUE, previous);
}
예제 #11
0
파일: muc.c 프로젝트: Liangwz/profanity
char *
muc_invites_find(char *search_str)
{
    return autocomplete_complete(invite_ac, search_str, TRUE);
}
예제 #12
0
파일: muc.c 프로젝트: pasis/profanity
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
파일: muc.c 프로젝트: NYAMNYAM3/profanity
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
파일: tlscerts.c 프로젝트: jowlo/profanity
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
파일: muc.c 프로젝트: pasis/profanity
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
파일: gpg.c 프로젝트: klement/profanity
char*
p_gpg_autocomplete_key(const char *const search_str)
{
    return autocomplete_complete(key_ac, search_str, TRUE);
}