about summary refs log tree commit diff stats
path: root/src/chat_session.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-10-30 01:50:39 +0000
committerJames Booth <boothj5@gmail.com>2012-10-30 01:50:39 +0000
commitbee708c9d253524d4af3a9d1599300722ff69044 (patch)
treee4bf627a576d531f25a8f278b6551033d8b7837c /src/chat_session.c
parentd339004f55b4620b611a668b4fad0703999f8a54 (diff)
downloadprofani-tty-bee708c9d253524d4af3a9d1599300722ff69044.tar.gz
Create chat session on send if none exists
Diffstat (limited to 'src/chat_session.c')
-rw-r--r--src/chat_session.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/chat_session.c b/src/chat_session.c
index f352fea0..283860de 100644
--- a/src/chat_session.c
+++ b/src/chat_session.c
@@ -52,6 +52,18 @@ chat_sessions_clear(void)
     g_hash_table_remove_all(sessions);
 }
 
+gboolean
+chat_session_exists(const char * const recipient)
+{
+    ChatSession session = g_hash_table_lookup(sessions, recipient);
+
+    if (session != NULL) {
+        return TRUE;
+    } else {
+        return FALSE;
+    }
+}
+
 void
 chat_session_start(const char * const recipient, gboolean recipient_supports)
 {