Some fixes
authorDa Risk <darisk972@gmail.com>
Wed, 24 Jun 2009 20:27:50 +0200
changeset 298 ffffa9b4428c
parent 297 f882aa78e0f9
child 299 2fae05fe318c
Some fixes
src/com/beem/project/beem/service/Contact.java
src/com/beem/project/beem/ui/SendIM.java
--- a/src/com/beem/project/beem/service/Contact.java	Wed Jun 24 20:02:07 2009 +0200
+++ b/src/com/beem/project/beem/service/Contact.java	Wed Jun 24 20:27:50 2009 +0200
@@ -307,8 +307,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	Wed Jun 24 20:02:07 2009 +0200
+++ b/src/com/beem/project/beem/ui/SendIM.java	Wed Jun 24 20:27:50 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);
     }
@@ -243,8 +245,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());