char* roster_barejid_autocomplete(const char *const search_str, gboolean previous) { assert(roster != NULL); return autocomplete_complete(roster->barejid_ac, search_str, TRUE, previous); }
char* roster_group_autocomplete(const char *const search_str) { assert(roster != NULL); return autocomplete_complete(roster->groups_ac, search_str, TRUE); }
char* roster_barejid_autocomplete(const char *const search_str) { assert(roster != NULL); return autocomplete_complete(roster->barejid_ac, search_str, TRUE); }
char* roster_contact_autocomplete(const char *const search_str) { assert(roster != NULL); return autocomplete_complete(roster->name_ac, search_str, TRUE); }
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; }
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; } } }
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); } } }
static char * _bookmark_find(char *search_str) { return autocomplete_complete(bookmark_ac, search_str); }
char* bookmark_find(const char *const search_str) { return autocomplete_complete(bookmark_ac, search_str, TRUE); }
char* bookmark_find(const char *const search_str, gboolean previous) { return autocomplete_complete(bookmark_ac, search_str, TRUE, previous); }
char * muc_invites_find(char *search_str) { return autocomplete_complete(invite_ac, search_str, TRUE); }
char* muc_invites_find(const char *const search_str, gboolean previous) { return autocomplete_complete(invite_ac, search_str, TRUE, previous); }
char * roster_find_group(char *search_str) { return autocomplete_complete(groups_ac, search_str, TRUE); }
char * muc_find_invite(char *search_str) { return autocomplete_complete(invite_ac, search_str); }
char* accounts_find_all(const char *const prefix) { return autocomplete_complete(all_ac, prefix, TRUE); }
char* tlscerts_complete(const char *const prefix) { return autocomplete_complete(certs_ac, prefix, TRUE); }
char* roster_barejid_autocomplete(const char *const search_str) { return autocomplete_complete(barejid_ac, search_str, TRUE); }
char* roster_group_autocomplete(const char *const search_str) { return autocomplete_complete(groups_ac, search_str, TRUE); }
char* roster_contact_autocomplete(const char *const search_str) { return autocomplete_complete(name_ac, search_str, TRUE); }
char* muc_confserver_find(const char *const search_str, gboolean previous) { return autocomplete_complete(confservers_ac, search_str, TRUE, previous); }
char* blocked_ac_find(const char *const search_str) { return autocomplete_complete(blocked_ac, search_str, TRUE); }
char * roster_find_contact(char *search_str) { return autocomplete_complete(name_ac, search_str, TRUE); }
char* accounts_find_enabled(const char *const prefix) { return autocomplete_complete(enabled_ac, prefix, TRUE); }
static char * _presence_sub_request_find(char * search_str) { return autocomplete_complete(sub_requests_ac, search_str, TRUE); }
char * prefs_autocomplete_boolean_choice(char *prefix) { return autocomplete_complete(boolean_choice_ac, prefix); }
char* prefs_autocomplete_room_trigger(const char *const prefix) { return autocomplete_complete(room_trigger_ac, prefix, TRUE); }
char * roster_find_resource(char *search_str) { return autocomplete_complete(fulljid_ac, search_str, TRUE); }
char* prefs_autocomplete_boolean_choice(const char *const prefix) { return autocomplete_complete(boolean_choice_ac, prefix, TRUE); }
char * roster_find_jid(char *search_str) { return autocomplete_complete(barejid_ac, search_str, TRUE); }
char* p_gpg_autocomplete_key(const char *const search_str) { return autocomplete_complete(key_ac, search_str, TRUE); }