about summary refs log tree commit diff stats
path: root/src/ui/window.c
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-10-22 12:38:39 +0200
committerGitHub <noreply@github.com>2021-10-22 12:38:39 +0200
commit59063aa3b43cd973ab328b406f1ab40dcf09b41a (patch)
tree59efb04637298ba2b34bfb7351b40823b02c062c /src/ui/window.c
parent37e1699c84bfb34dafaee4cd061eedad79fc114d (diff)
parentda3a6d87437ce14215acbb5f1740cb81066df39d (diff)
downloadprofani-tty-59063aa3b43cd973ab328b406f1ab40dcf09b41a.tar.gz
Merge pull request #1601 from MarcoPolo-PasTonMolo/master
Add /correct-editor command
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c29
1 files changed, 29 insertions, 0 deletions
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
@@ -399,6 +399,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)
 {
     assert(window != NULL);