--- a/src/com/beem/project/beem/service/BeemChatManager.java Wed Mar 17 02:16:17 2010 +0100
+++ b/src/com/beem/project/beem/service/BeemChatManager.java Thu Mar 18 02:32:04 2010 +0100
@@ -51,7 +51,6 @@
import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.ChatManager;
import org.jivesoftware.smack.ChatManagerListener;
-import org.jivesoftware.smack.util.StringUtils;
import android.app.Notification;
import android.app.PendingIntent;
@@ -113,7 +112,9 @@
*/
@Override
public IChat createChat(Contact contact, IMessageListener listener) {
- String jid = contact.getJID();
+ String jid = contact.getJIDWithRes();
+ Log.d(TAG, "Get chat key1 = ");
+
return createChat(jid, listener);
}
@@ -126,7 +127,7 @@
public IChat createChat(String jid, IMessageListener listener) {
String key = jid;
ChatAdapter result;
- Log.d(TAG, "Get chat key = " + key);
+ Log.d(TAG, "Get chat key2 = ");
if (mChats.containsKey(key)) {
result = mChats.get(key);
result.addMessageListener(listener);
@@ -182,7 +183,7 @@
@Override
public ChatAdapter getChat(Contact contact) {
- String key = StringUtils.parseBareAddress(contact.getJID());
+ String key = contact.getJIDWithRes();
return mChats.get(key);
}
@@ -305,7 +306,7 @@
notifyNewChat(chat);
}
} catch (RemoteException e) {
- Log.w(TAG, e.getMessage());
+ Log.e(TAG, e.getMessage());
}
}
--- a/src/com/beem/project/beem/service/ChatAdapter.java Wed Mar 17 02:16:17 2010 +0100
+++ b/src/com/beem/project/beem/service/ChatAdapter.java Thu Mar 18 02:32:04 2010 +0100
@@ -101,6 +101,7 @@
public void sendMessage(com.beem.project.beem.service.Message message) throws RemoteException {
org.jivesoftware.smack.packet.Message send = new org.jivesoftware.smack.packet.Message();
send.setTo(message.getTo());
+ Log.w(TAG, "message to " + message.getTo());
send.setBody(message.getBody());
send.setThread(message.getThread());
send.setSubject(message.getSubject());
--- a/src/com/beem/project/beem/ui/Chat.java Wed Mar 17 02:16:17 2010 +0100
+++ b/src/com/beem/project/beem/ui/Chat.java Thu Mar 18 02:32:04 2010 +0100
@@ -363,7 +363,7 @@
}
/**
- * Convert a list of Mesage coming from the service to a list of MessageText that can be displayed in UI.
+ * Convert a list of Message coming from the service to a list of MessageText that can be displayed in UI.
* @param chatMessages the list of Message
* @return a list of message that can be displayed.
*/
@@ -805,6 +805,8 @@
if (!"".equals(inputContent)) {
Message msgToSend = new Message(mContact.getJIDWithRes(), Message.MSG_TYPE_CHAT);
msgToSend.setBody(inputContent);
+ Log.d(TAG, "jid " + mContact.getJIDWithRes());
+
try {
if (mChat == null) {