changeset 29503:7adebf6acc50

jabber: Print an error message to the current conversation when failing to send an attention using UI
author Marcus Lundblad <ml@update.uu.se>
date Sun, 28 Feb 2010 19:34:49 +0000
parents 5802999803db
children 27a94015e239
files libpurple/protocols/jabber/jabber.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Sun Feb 28 19:19:37 2010 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sun Feb 28 19:34:49 2010 +0000
@@ -2957,7 +2957,16 @@
 	gchar *error = NULL;
 
 	if (!_jabber_send_buzz(js, username, &error)) {
+		PurpleAccount *account = purple_connection_get_account(gc);
+		PurpleConversation *conv =
+			purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, username, account);
 		purple_debug_error("jabber", "jabber_send_attention: jabber_cmd_buzz failed with error: %s\n", error ? error : "(NULL)");
+
+		if (conv) {
+			purple_conversation_write(conv, username, error, PURPLE_MESSAGE_ERROR,
+			    time(NULL));
+		}
+
 		g_free(error);
 		return FALSE;
 	}