resolution du soucis de status
authornikita@nikita-rack
Tue, 07 Apr 2009 21:50:45 +0200
changeset 83 2e6e98e9f8ef
parent 82 ff92a9c95c78
child 85 7d0e36aa1be5
child 89 3f6eb9233987
child 92 e48817ca2398
resolution du soucis de status
src/com/beem/project/beem/BeemService.java
src/com/beem/project/beem/service/Contact.java
--- a/src/com/beem/project/beem/BeemService.java	Tue Apr 07 20:12:30 2009 +0200
+++ b/src/com/beem/project/beem/BeemService.java	Tue Apr 07 21:50:45 2009 +0200
@@ -91,7 +91,7 @@
 	} else {
 	    mConnectionConfiguration = new ConnectionConfiguration(mHost);
 	}
-	mConnectionConfiguration.setSendPresence(false);
+	mConnectionConfiguration.setSendPresence(true);
     }
 
     /**
--- a/src/com/beem/project/beem/service/Contact.java	Tue Apr 07 20:12:30 2009 +0200
+++ b/src/com/beem/project/beem/service/Contact.java	Tue Apr 07 21:50:45 2009 +0200
@@ -169,26 +169,36 @@
 	} else {
 	    Log.d(TAG, "Presence OK");
 	    Mode mode = presence.getMode();
-	    switch (mode) {
-		case available:
-		    mStatus = Contact.CONTACT_STATUS_AVAILABLE;
-		    break;
-		case away:
-		    mStatus = Contact.CONTACT_STATUS_AWAY;
-		    break;
-		case chat:
-		    mStatus = Contact.CONTACT_STATUS_AVAILABLE_FOR_CHAT;
-		    break;
-		case dnd:
-		    mStatus = Contact.CONTACT_STATUS_BUSY;
-		    break;
-		case xa:
-		    mStatus = Contact.CONTACT_STATUS_UNAVAILABLE;
-		    break;
-		default:
-		    Log.e("RosterAdapter", "Status mode non gere");
+	    if (mode == null) {
+		mStatus = Contact.CONTACT_STATUS_AVAILABLE;
+	    }
+	    else {
+		switch (mode) {
+		    case available:
+			Log.d(TAG, "Available");
+			mStatus = Contact.CONTACT_STATUS_AVAILABLE;
+			break;
+		    case away:
+			Log.d(TAG, "Away");
+			mStatus = Contact.CONTACT_STATUS_AWAY;
+			break;
+		    case chat:
+			Log.d(TAG, "Chat");
+			mStatus = Contact.CONTACT_STATUS_AVAILABLE_FOR_CHAT;
+			break;
+		    case dnd:
+			Log.d(TAG, "Dnd");
+			mStatus = Contact.CONTACT_STATUS_BUSY;
+			break;
+		    case xa:
+			Log.d(TAG, "Xa");
+			mStatus = Contact.CONTACT_STATUS_UNAVAILABLE;
+			break;
+		    default:
+			Log.d(TAG, "Status mode non gere");
 		    mStatus = Contact.CONTACT_STATUS_DISCONNECT;
 		    break;
+		}
 	    }
 	}
     }