From da3a6d87437ce14215acbb5f1740cb81066df39d Mon Sep 17 00:00:00 2001 From: MarcoPolo-PasTonMolo Date: Fri, 22 Oct 2021 10:24:51 +0300 Subject: Move declaration and definition of win_get_last_sent_message to the correct place --- src/ui/window.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/ui/window.c') diff --git a/src/ui/window.c b/src/ui/window.c index 3123e211..7442ce9c 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -398,6 +398,35 @@ win_get_tab_identifier(ProfWin* window) } } +char* +win_get_last_sent_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; +} + char* win_to_string(ProfWin* window) { -- cgit 1.4.1-2-gfad0