jabber: Print an error message to the current conversation when failing to

Sun, 28 Feb 2010 19:34:49 +0000

author
Marcus Lundblad <malu@pidgin.im>
date
Sun, 28 Feb 2010 19:34:49 +0000
changeset 29787
645de6afcc0a
parent 29786
7f1b7429119c
child 29788
cb8663d9a5f9

jabber: Print an error message to the current conversation when failing to
send an attention using UI

libpurple/protocols/jabber/jabber.c file | annotate | diff | comparison | revisions
--- 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;
 	}

mercurial