about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-12-22 00:01:43 +0000
committerJames Booth <boothj5@gmail.com>2014-12-22 00:01:43 +0000
commit86dc29d8e896c70f4adfee90651ebfa9317d31dc (patch)
tree324d50acf132cdb973c3590fd79af10b10aee9c0 /src/ui
parentd5dee1632dd6e68a616a748456a880ea05983b3e (diff)
downloadprofani-tty-86dc29d8e896c70f4adfee90651ebfa9317d31dc.tar.gz
Removed functions from window.c
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/core.c13
-rw-r--r--src/ui/window.c33
-rw-r--r--src/ui/window.h3
3 files changed, 8 insertions, 41 deletions
diff --git a/src/ui/core.c b/src/ui/core.c
index f72ec732..dc9cb73b 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -829,11 +829,13 @@ _ui_win_has_unsaved_form(int num)
 {
     ProfWin *window = wins_get_by_num(num);
 
-    if (window->type != WIN_MUC_CONFIG) {
+    if (window->type == WIN_MUC_CONFIG) {
+        ProfMucConfWin *confwin = (ProfMucConfWin*)window;
+        assert(confwin->memcheck == PROFCONFWIN_MEMCHECK);
+        return confwin->form->modified;
+    } else {
         return FALSE;
     }
-
-    return win_has_modified_form(window);
 }
 
 static gboolean
@@ -3017,7 +3019,9 @@ _win_show_history(int win_index, const char * const contact)
 {
     ProfWin *window = wins_get_by_num(win_index);
     if (window->type == WIN_CHAT) {
-        if (win_chat_history_shown(window)) {
+        ProfChatWin *chatwin = (ProfChatWin*) window;
+        assert(chatwin->memcheck == PROFCHATWIN_MEMCHECK);
+        if (!chatwin->history_shown) {
             Jid *jid = jid_create(jabber_get_fulljid());
             GSList *history = chat_log_get_previous(jid->barejid, contact);
             jid_destroy(jid);
@@ -3040,7 +3044,6 @@ _win_show_history(int win_index, const char * const contact)
                 }
                 curr = g_slist_next(curr);
             }
-            ProfChatWin *chatwin = (ProfChatWin*)window;
             chatwin->history_shown = TRUE;
 
             g_slist_free_full(history, free);
diff --git a/src/ui/window.c b/src/ui/window.c
index 607dddc1..dd459ece 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -921,39 +921,6 @@ win_has_active_subwin(ProfWin *window)
     }
 }
 
-gboolean
-win_chat_history_shown(ProfWin *window)
-{
-    if (window->type == WIN_CHAT) {
-        ProfChatWin *chatwin = (ProfChatWin*)window;
-        return chatwin->history_shown;
-    } else {
-        return FALSE;
-    }
-}
-
-gboolean
-win_has_chat_resource(ProfWin *window)
-{
-    if (window->type == WIN_CHAT) {
-        ProfChatWin *chatwin = (ProfChatWin*)window;
-        return (chatwin->resource != NULL);
-    } else {
-        return FALSE;
-    }
-}
-
-gboolean
-win_has_modified_form(ProfWin *window)
-{
-    if (window->type == WIN_MUC_CONFIG) {
-        ProfMucConfWin *confwin = (ProfMucConfWin*)window;
-        return confwin->form->modified;
-    } else {
-        return FALSE;
-    }
-}
-
 int
 win_unread(ProfWin *window)
 {
diff --git a/src/ui/window.h b/src/ui/window.h
index ce74c973..0f04faae 100644
--- a/src/ui/window.h
+++ b/src/ui/window.h
@@ -177,8 +177,5 @@ void win_printline_nowrap(WINDOW *win, char *msg);
 
 int win_unread(ProfWin *window);
 gboolean win_has_active_subwin(ProfWin *window);
-gboolean win_has_modified_form(ProfWin *window);
-gboolean win_chat_history_shown(ProfWin *window);
-gboolean win_has_chat_resource(ProfWin *window);
 
 #endif