merge
authornikita@localhost
Thu, 25 Jun 2009 10:02:44 +0200
changeset 302 0af8e2bbb107
parent 301 b952180fd935 (current diff)
parent 299 2fae05fe318c (diff)
child 303 5427deeda4e0
merge
src/com/beem/project/beem/service/Contact.java
--- a/res/values/strings.xml	Thu Jun 25 10:02:31 2009 +0200
+++ b/res/values/strings.xml	Thu Jun 25 10:02:44 2009 +0200
@@ -63,6 +63,7 @@
 	</string>
 	<string name="CDSure2DeleteYes">Yes</string>
 	<string name="CDSure2DeleteNo">No</string>
+	
 	<!-- AccountCreation class -->
 	<string name="ACLogin">Login:</string>
 	<string name="ACEmail">Email:</string>
@@ -99,7 +100,6 @@
 	<string name="SendIMNoStatusSet">No status set</string>
 	
 	<!--  ChangeStatus class -->
-
 	<string name="ChangeStatusText">Type here your status message :</string>
 	<string name="ChangeStatusActTitle">Beem - Change status</string>
 
--- a/src/com/beem/project/beem/BeemService.java	Thu Jun 25 10:02:31 2009 +0200
+++ b/src/com/beem/project/beem/BeemService.java	Thu Jun 25 10:02:44 2009 +0200
@@ -17,6 +17,7 @@
 import android.app.Service;
 import android.content.Intent;
 import android.content.SharedPreferences;
+import android.content.SharedPreferences.Editor;
 import android.os.IBinder;
 import android.os.RemoteException;
 import android.util.Log;
@@ -159,7 +160,11 @@
 			    sendNotification(id, notif);
 			}
 		    }, filter);
-		    Log.i("BeemService", "onConnect()");
+		    // set status connect in the preferences
+		    // private static final int AVAILABLE_IDX = 5;
+		    Editor edit = mSettings.edit();
+		    edit.putInt(getString(R.string.PreferenceStatus), 1);
+		    edit.commit();
 		}
 
 		@Override
--- a/src/com/beem/project/beem/service/BeemChatManager.java	Thu Jun 25 10:02:31 2009 +0200
+++ b/src/com/beem/project/beem/service/BeemChatManager.java	Thu Jun 25 10:02:44 2009 +0200
@@ -104,7 +104,6 @@
 	public void processMessage(Chat chat, Message message) {
 	    ChatAdapter newchat = getChat(chat);
 	    try {
-		Log.d(TAG, message.getBody());
 		if (message.getBody() != null)
 		    newchat.addMessage(new com.beem.project.beem.service.Message(message));
 		final int n = mRemoteMessageListeners.beginBroadcast();
--- a/src/com/beem/project/beem/service/Contact.java	Thu Jun 25 10:02:31 2009 +0200
+++ b/src/com/beem/project/beem/service/Contact.java	Thu Jun 25 10:02:44 2009 +0200
@@ -306,8 +306,11 @@
      */
     public Uri toUri() {
 	StringBuilder build = new StringBuilder("xmpp:");
-	build.append(StringUtils.parseName(mJID)).append('@').append(
-		StringUtils.parseServer(mJID));
+	String name = StringUtils.parseName(mJID);
+	build.append(name);
+	if (! "".equals(name))
+	    build.append('@');
+	build.append(StringUtils.parseServer(mJID));
 	Uri u = Uri.parse(build.toString());
 	return u;
     }
--- a/src/com/beem/project/beem/ui/SendIM.java	Thu Jun 25 10:02:31 2009 +0200
+++ b/src/com/beem/project/beem/ui/SendIM.java	Thu Jun 25 10:02:44 2009 +0200
@@ -130,6 +130,8 @@
 	if (mContactName == null || "".equals(mContactName)) {
 	    mContactName = mContact.getJID();
 	    mContactName = StringUtils.parseName(mContactName);
+	    if ("".equals(mContactName))
+		mContactName = mContact.getJID();
 	}
 	mLogin.setText(mContactName);
     }
@@ -218,7 +220,8 @@
     protected void onPause() {
 	super.onPause();
 	try {
-	    mChat.setOpen(false);
+	    if (mChat!=null)
+		mChat.setOpen(false);
 	} catch (RemoteException e) {
 	    Log.d(TAG, "Error while closing chat", e);
 	}
@@ -243,8 +246,6 @@
     protected void onStart() {
 	super.onStart();
 	// TODO cancel the notification if any
-	if (mContact == null)
-	    mContact = getIntent().getParcelableExtra("contact");
 	try {
 	    if (mRoster != null)
 		mContact = mRoster.getContact(mContact.getJID());