mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Moved disconnect code to profanity module
This commit is contained in:
parent
b3e1d473a2
commit
346ed2a8e8
@ -953,10 +953,7 @@ _cmd_disconnect(gchar **args, struct cmd_help_t help)
|
|||||||
{
|
{
|
||||||
if (jabber_get_connection_status() == JABBER_CONNECTED) {
|
if (jabber_get_connection_status() == JABBER_CONNECTED) {
|
||||||
char *jid = strdup(jabber_get_jid());
|
char *jid = strdup(jabber_get_jid());
|
||||||
jabber_disconnect();
|
prof_handle_disconnect(jid);
|
||||||
contact_list_clear();
|
|
||||||
jabber_restart();
|
|
||||||
cons_show("%s logged out successfully.", jid);
|
|
||||||
free(jid);
|
free(jid);
|
||||||
} else {
|
} else {
|
||||||
cons_show("You are not currently connected.");
|
cons_show("You are not currently connected.");
|
||||||
|
@ -215,6 +215,15 @@ prof_handle_failed_login(void)
|
|||||||
log_info("disconnected");
|
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
|
void
|
||||||
prof_handle_room_history(const char * const room_jid, const char * const nick,
|
prof_handle_room_history(const char * const room_jid, const char * const nick,
|
||||||
GTimeVal tv_stamp, const char * const message)
|
GTimeVal tv_stamp, const char * const message)
|
||||||
|
@ -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_login_success(const char *jid);
|
||||||
void prof_handle_lost_connection(void);
|
void prof_handle_lost_connection(void);
|
||||||
|
void prof_handle_disconnect(const char * const jid);
|
||||||
void prof_handle_failed_login(void);
|
void prof_handle_failed_login(void);
|
||||||
void prof_handle_typing(char *from);
|
void prof_handle_typing(char *from);
|
||||||
void prof_handle_contact_online(char *contact, char *show, char *status);
|
void prof_handle_contact_online(char *contact, char *show, char *status);
|
||||||
|
Loading…
Reference in New Issue
Block a user