Bug 259856 The error message when the chat message cannot be sent is not correct.
diff --git a/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/Messages.java b/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/Messages.java
index c7fa0d5..bf8fc86 100644
--- a/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/Messages.java
+++ b/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/Messages.java
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007 Composent, Inc. and others.
+ * Copyright (c) 2007, 2009 Composent, Inc. and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -201,6 +201,7 @@
 	public static String MessagesView_ClearChatLogDialogMessage;
 	public static String MessagesView_ShowTimestamps;
 	public static String MessagesView_CouldNotSendMessage;
+	public static String MessagesView_CouldNotSendMessageCauseKnown;
 	public static String MessagesView_TypingNotification;
 	public static String MessagesView_Copy;
 	public static String MessagesView_SelectAll;
diff --git a/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/messages.properties b/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/messages.properties
index cb54da8..725ef0f 100644
--- a/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/messages.properties
+++ b/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/internal/presence/ui/messages.properties
@@ -1,5 +1,5 @@
 ################################################################################
-# Copyright (c) 2007 Composent, Inc. and others.
+# Copyright (c) 2007, 2009 Composent, Inc. and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -47,7 +47,8 @@
 MessagesView_ClearChatLogDialogMessage = Are you sure you wish to clear the chat log with {0}?
 MessagesView_WARNING_HYPERLINKING_NOT_AVAILABLE=Source viewer not available.  Hyperlinking will be disabled.
 MessagesView_ShowTimestamps = &Show Timestamps
-MessagesView_CouldNotSendMessage = The message could not be sent: {0}
+MessagesView_CouldNotSendMessage = The message could not be sent.
+MessagesView_CouldNotSendMessageCauseKnown = The message could not be sent: {0}
 MessagesView_TypingNotification = {0} is typing a message...
 MessagesView_Copy = &Copy
 MessagesView_SelectAll = &Select All
diff --git a/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/MessagesView.java b/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/MessagesView.java
index 0c5d5f3..b299cd8 100644
--- a/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/MessagesView.java
+++ b/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/MessagesView.java
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007 Remy Suen, Composent, Inc., and others.
+ * Copyright (c) 2007, 2009 Remy Suen, Composent, Inc., and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *    Remy Suen <remy.suen@gmail.com> - initial API and implementation
+ *    Hiroyuki Inaba <hiroyuki.inaba@gmail.com> - Bug 259856 The error message when the chat message cannot be sent is not correct.
  *****************************************************************************/
 package org.eclipse.ecf.presence.ui;
 
@@ -275,7 +276,19 @@
 									}
 									append(localID, text);
 								} catch (ECFException ex) {
-									setContentDescription(Messages.MessagesView_CouldNotSendMessage);
+									String message = ex.getMessage();
+									if (message == null || message.equals("")) { //$NON-NLS-1$
+										message = ex.getStatus().getMessage();
+										if (message == null || message.equals("")) { //$NON-NLS-1$
+											message = ex.getCause().getMessage();
+										}
+									}
+
+									if (message == null || message.equals("")) { //$NON-NLS-1$
+										setContentDescription(Messages.MessagesView_CouldNotSendMessage);
+									} else {
+										setContentDescription(NLS.bind(Messages.MessagesView_CouldNotSendMessageCauseKnown, message));
+									}
 								}
 								e.doit = false;
 								sendTyping = false;