about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-10-26 22:43:32 +0000
committerJames Booth <boothj5@gmail.com>2015-10-26 22:43:32 +0000
commit8f45f332ade58b188f1f51d86304f525f1951647 (patch)
tree12b66b315da348b490609ade71d581bc16fcac8e
parentc99ff8d941ef5528cb228020936d6d6efcef6d20 (diff)
downloadprofani-tty-8f45f332ade58b188f1f51d86304f525f1951647.tar.gz
Removed ui_chat_win_exists
-rw-r--r--src/event/server_events.c10
-rw-r--r--src/ui/chatwin.c7
-rw-r--r--src/ui/ui.h1
-rw-r--r--src/window_list.c7
-rw-r--r--src/window_list.h2
-rw-r--r--tests/unittests/ui/stub_ui.c4
6 files changed, 14 insertions, 17 deletions
diff --git a/src/event/server_events.c b/src/event/server_events.c
index d58633ce..4173fa7f 100644
--- a/src/event/server_events.c
+++ b/src/event/server_events.c
@@ -318,7 +318,7 @@ void
 sv_ev_typing(char *barejid, char *resource)
 {
     ui_contact_typing(barejid, resource);
-    if (ui_chat_win_exists(barejid)) {
+    if (wins_chat_exists(barejid)) {
         chat_session_recipient_typing(barejid, resource);
     }
 }
@@ -326,7 +326,7 @@ sv_ev_typing(char *barejid, char *resource)
 void
 sv_ev_paused(char *barejid, char *resource)
 {
-    if (ui_chat_win_exists(barejid)) {
+    if (wins_chat_exists(barejid)) {
         chat_session_recipient_paused(barejid, resource);
     }
 }
@@ -334,7 +334,7 @@ sv_ev_paused(char *barejid, char *resource)
 void
 sv_ev_inactive(char *barejid, char *resource)
 {
-    if (ui_chat_win_exists(barejid)) {
+    if (wins_chat_exists(barejid)) {
         chat_session_recipient_inactive(barejid, resource);
     }
 }
@@ -343,7 +343,7 @@ void
 sv_ev_gone(const char *const barejid, const char *const resource)
 {
     ui_recipient_gone(barejid, resource);
-    if (ui_chat_win_exists(barejid)) {
+    if (wins_chat_exists(barejid)) {
         chat_session_recipient_gone(barejid, resource);
     }
 }
@@ -351,7 +351,7 @@ sv_ev_gone(const char *const barejid, const char *const resource)
 void
 sv_ev_activity(const char *const barejid, const char *const resource, gboolean send_states)
 {
-    if (ui_chat_win_exists(barejid)) {
+    if (wins_chat_exists(barejid)) {
         chat_session_recipient_active(barejid, resource, send_states);
     }
 }
diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c
index 6cf5885a..7f394b47 100644
--- a/src/ui/chatwin.c
+++ b/src/ui/chatwin.c
@@ -46,13 +46,6 @@
 
 static void _win_show_history(ProfChatWin *chatwin, const char *const contact);
 
-gboolean
-ui_chat_win_exists(const char *const barejid)
-{
-    ProfChatWin *chatwin = wins_get_chat(barejid);
-    return (chatwin != NULL);
-}
-
 void
 ui_message_receipt(const char *const barejid, const char *const id)
 {
diff --git a/src/ui/ui.h b/src/ui/ui.h
index c7e3a8ee..a6795e25 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -210,7 +210,6 @@ void ui_show_lines(ProfWin *window, const gchar** lines);
 void ui_redraw_all_room_rosters(void);
 void ui_show_all_room_rosters(void);
 void ui_hide_all_room_rosters(void);
-gboolean ui_chat_win_exists(const char *const barejid);
 void ui_handle_software_version_error(const char *const roomjid, const char *const message);
 void ui_show_software_version(const char *const jid, const char *const  presence,
     const char *const name, const char *const version, const char *const os);
diff --git a/src/window_list.c b/src/window_list.c
index ad43f888..c026e875 100644
--- a/src/window_list.c
+++ b/src/window_list.c
@@ -69,6 +69,13 @@ wins_get_console(void)
     return g_hash_table_lookup(windows, GINT_TO_POINTER(1));
 }
 
+gboolean
+wins_chat_exists(const char *const barejid)
+{
+    ProfChatWin *chatwin = wins_get_chat(barejid);
+    return (chatwin != NULL);
+}
+
 ProfChatWin*
 wins_get_chat(const char *const barejid)
 {
diff --git a/src/window_list.h b/src/window_list.h
index e3e446f4..4b7dca8c 100644
--- a/src/window_list.h
+++ b/src/window_list.h
@@ -45,6 +45,8 @@ ProfWin* wins_new_muc(const char *const roomjid);
 ProfWin* wins_new_muc_config(const char *const roomjid, DataForm *form);
 ProfWin* wins_new_private(const char *const fulljid);
 
+gboolean wins_chat_exists(const char *const barejid);
+
 ProfWin* wins_get_console(void);
 ProfChatWin* wins_get_chat(const char *const barejid);
 ProfMucWin* wins_get_muc(const char *const roomjid);
diff --git a/tests/unittests/ui/stub_ui.c b/tests/unittests/ui/stub_ui.c
index 3e8d532b..47e7e9e9 100644
--- a/tests/unittests/ui/stub_ui.c
+++ b/tests/unittests/ui/stub_ui.c
@@ -256,10 +256,6 @@ void ui_group_added(const char * const contact, const char * const group) {}
 void ui_group_removed(const char * const contact, const char * const group) {}
 void ui_chat_win_contact_online(PContact contact, Resource *resource, GDateTime *last_activity) {}
 void ui_chat_win_contact_offline(PContact contact, char *resource, char *status) {}
-gboolean ui_chat_win_exists(const char * const barejid)
-{
-    return TRUE;
-}
 
 void ui_contact_offline(char *barejid, char *resource, char *status) {}