about summary refs log tree commit diff stats
path: root/src/server_events.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-01-05 20:58:19 +0000
committerJames Booth <boothj5@gmail.com>2014-01-05 20:58:19 +0000
commitda03617e8becf41242495f7b1ce2ecbd9d1667ca (patch)
tree6afdd2aa8b6fc3929df9af8bd40114222967194e /src/server_events.c
parent87cdbe015a8dfe20067b2933322a7c9ca17745f2 (diff)
downloadprofani-tty-da03617e8becf41242495f7b1ce2ecbd9d1667ca.tar.gz
Moved handle_login_account_success to server_events
Diffstat (limited to 'src/server_events.c')
-rw-r--r--src/server_events.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/server_events.c b/src/server_events.c
index 58c62488..aecfbccb 100644
--- a/src/server_events.c
+++ b/src/server_events.c
@@ -20,8 +20,9 @@
  *
  */
 
-#include "ui/ui.h"
+#include "log.h"
 #include "muc.h"
+#include "ui/ui.h"
 
 void
 handle_error_message(const char *from, const char *err_msg)
@@ -38,3 +39,19 @@ handle_error_message(const char *from, const char *err_msg)
     }
 }
 
+void
+handle_login_account_success(char *account_name)
+{
+    ProfAccount *account = accounts_get_account(account_name);
+    resource_presence_t resource_presence = accounts_get_login_presence(account->name);
+    contact_presence_t contact_presence = contact_presence_from_resource_presence(resource_presence);
+    cons_show_login_success(account);
+    title_bar_set_status(contact_presence);
+    log_info("%s logged in successfully", account->jid);
+    ui_current_page_off();
+    status_bar_print_message(account->jid);
+    status_bar_refresh();
+
+    accounts_free_account(account);
+}
+