diff --git a/src/callbacks.cc b/src/callbacks.cc index 2a5d34a..26fb6be 100644 --- a/src/callbacks.cc +++ b/src/callbacks.cc @@ -265,6 +265,10 @@ ft_disconnect_function (LmConnection *conn, state was not FT_AUTH, etc) */ do_set_conn_status (FT_DEAD); + + /* run another hook which actually lets scripts reconnect + */ + scm_run_hook (ex_disconnected_hook, scm_list_n (scm_from_int (reason), SCM_UNDEFINED)); return; } diff --git a/src/extensions.cc b/src/extensions.cc index ada58e8..deba806 100644 --- a/src/extensions.cc +++ b/src/extensions.cc @@ -33,6 +33,7 @@ SCM ex_message_send_hook; SCM ex_presence_receive_hook; SCM ex_subscribe_receive_hook; SCM ex_disconnect_hook; +SCM ex_disconnected_hook; SCM ex_command_hook; SCM ex_login_hook; SCM ex_quit_hook; @@ -105,6 +106,9 @@ register_hooks () ex_disconnect_hook = scm_make_hook (scm_from_int (1)); scm_c_define ("ft-disconnect-hook", ex_disconnect_hook); + ex_disconnected_hook = scm_make_hook (scm_from_int (1)); + scm_c_define ("ft-disconnected-hook", ex_disconnected_hook); + ex_command_hook = scm_make_hook (scm_from_int (2)); scm_c_define ("ft-command-hook", ex_command_hook); diff --git a/src/extensions.h b/src/extensions.h index 00d6828..88e75bb 100644 --- a/src/extensions.h +++ b/src/extensions.h @@ -27,6 +27,7 @@ extern SCM ex_message_send_hook; extern SCM ex_presence_receive_hook; extern SCM ex_subscribe_receive_hook; extern SCM ex_disconnect_hook; +extern SCM ex_disconnected_hook; extern SCM ex_command_hook; extern SCM ex_login_hook; extern SCM ex_quit_hook;