diff options
| author | MarcoPolo-PasTonMolo <marcopolopastonmolo@protonmail.com> | 2021-10-22 10:24:51 +0300 |
|---|---|---|
| committer | MarcoPolo-PasTonMolo <marcopolopastonmolo@protonmail.com> | 2021-10-22 10:24:51 +0300 |
| commit | da3a6d87437ce14215acbb5f1740cb81066df39d (patch) | |
| tree | b1ad228c653e53176928e7bc3fcfd288f85e2a9d /src/command | |
| parent | 6b0f15a1c90116a01463a8c9e26c32f4112810e7 (diff) | |
| download | profani-tty-da3a6d87437ce14215acbb5f1740cb81066df39d.tar.gz | |
Move declaration and definition of win_get_last_sent_message to the correct place
Diffstat (limited to 'src/command')
| -rw-r--r-- | src/command/cmd_ac.c | 32 | ||||
| -rw-r--r-- | src/command/cmd_ac.h | 1 | ||||
| -rw-r--r-- | src/command/cmd_funcs.c | 2 |
3 files changed, 3 insertions, 32 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index a0d57a18..ee0f717e 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -49,6 +49,7 @@ #include "command/cmd_funcs.h" #include "tools/parser.h" #include "plugins/plugins.h" +#include "ui/ui.h" #include "ui/win_types.h" #include "ui/window_list.h" #include "xmpp/muc.h" @@ -4032,42 +4033,13 @@ static char* _correct_autocomplete(ProfWin* window, const char* const input, gboolean previous) { GString* result_str = g_string_new("/correct "); - g_string_append(result_str, _get_last_message(window)); + g_string_append(result_str, win_get_last_sent_message(window)); char* result = result_str->str; g_string_free(result_str, FALSE); return result; } -char* -_get_last_message(ProfWin* window) -{ - char* last_message = NULL; - switch (window->type) { - case WIN_CHAT: - { - ProfChatWin* chatwin = (ProfChatWin*)window; - assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK); - last_message = chatwin->last_message; - break; - } - case WIN_MUC: - { - ProfMucWin* mucwin = (ProfMucWin*)window; - assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK); - last_message = mucwin->last_message; - } - default: - break; - } - - if (last_message == NULL) { - return NULL; - } - - return last_message; -} - static char* _software_autocomplete(ProfWin* window, const char* const input, gboolean previous) { diff --git a/src/command/cmd_ac.h b/src/command/cmd_ac.h index c0485916..ef715310 100644 --- a/src/command/cmd_ac.h +++ b/src/command/cmd_ac.h @@ -59,6 +59,5 @@ void cmd_ac_add_form_fields(DataForm* form); void cmd_ac_remove_form_fields(DataForm* form); char* cmd_ac_complete_filepath(const char* const input, char* const startstr, gboolean previous); -char* _get_last_message(ProfWin* window); #endif diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 55a05be2..fdf6e3d9 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -9569,7 +9569,7 @@ cmd_correct_editor(ProfWin* window, const char* const command, gchar** args) return TRUE; } - gchar* initial_message = _get_last_message(window); + gchar* initial_message = win_get_last_sent_message(window); gchar* message = NULL; if (_get_message_from_editor(initial_message, &message)) { |