Mercurial > pidgin
diff libpurple/plugins/signals-test.c @ 21364:5a7202fa43a0
I figured a signal firing on a connection error would be useful.
author | Will Thompson <will.thompson@collabora.co.uk> |
---|---|
date | Wed, 24 Oct 2007 17:33:12 +0000 |
parents | 8e3ef71c4362 |
children | 38cc722159ff |
line wrap: on
line diff
--- a/libpurple/plugins/signals-test.c Wed Oct 24 14:48:58 2007 +0000 +++ b/libpurple/plugins/signals-test.c Wed Oct 24 17:33:12 2007 +0000 @@ -226,6 +226,18 @@ purple_account_get_username(purple_connection_get_account(gc))); } +static void +connection_error_cb(PurpleConnection *gc, + PurpleConnectionError err, + const gchar *desc, + void *data) +{ + const gchar *username = + purple_account_get_username(purple_connection_get_account(gc)); + purple_debug_misc("signals test", "connection-error (%s, %u, %s)\n", + username, err, desc); +} + /************************************************************************** * Conversation subsystem signal callbacks **************************************************************************/ @@ -626,6 +638,8 @@ plugin, PURPLE_CALLBACK(signing_off_cb), NULL); purple_signal_connect(conn_handle, "signed-off", plugin, PURPLE_CALLBACK(signed_off_cb), NULL); + purple_signal_connect(conn_handle, "connection-error", + plugin, PURPLE_CALLBACK(connection_error_cb), NULL); /* Conversations subsystem signals */ purple_signal_connect(conv_handle, "writing-im-msg",