1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Moved disconnect code to profanity module

This commit is contained in:
James Booth 2012-11-19 22:23:48 +00:00
parent b3e1d473a2
commit 346ed2a8e8
3 changed files with 11 additions and 4 deletions

View File

@ -953,10 +953,7 @@ _cmd_disconnect(gchar **args, struct cmd_help_t help)
{
if (jabber_get_connection_status() == JABBER_CONNECTED) {
char *jid = strdup(jabber_get_jid());
jabber_disconnect();
contact_list_clear();
jabber_restart();
cons_show("%s logged out successfully.", jid);
prof_handle_disconnect(jid);
free(jid);
} else {
cons_show("You are not currently connected.");

View File

@ -215,6 +215,15 @@ prof_handle_failed_login(void)
log_info("disconnected");
}
void
prof_handle_disconnect(const char * const jid)
{
jabber_disconnect();
contact_list_clear();
jabber_restart();
cons_show("%s logged out successfully.", jid);
}
void
prof_handle_room_history(const char * const room_jid, const char * const nick,
GTimeVal tv_stamp, const char * const message)

View File

@ -29,6 +29,7 @@ void prof_run(const int disable_tls, char *log_level);
void prof_handle_login_success(const char *jid);
void prof_handle_lost_connection(void);
void prof_handle_disconnect(const char * const jid);
void prof_handle_failed_login(void);
void prof_handle_typing(char *from);
void prof_handle_contact_online(char *contact, char *show, char *status);