muc clean
authorVincent V.<marseille@beem-project.com>
Tue, 21 Feb 2012 19:35:15 +0100
changeset 933 20b3b1db3d29
parent 932 cdbfa28949bb
child 934 53e19596d22c
muc clean
src/com/beem/project/beem/BeemService.java
src/com/beem/project/beem/ui/ContactList.java
--- a/src/com/beem/project/beem/BeemService.java	Mon Feb 20 19:51:02 2012 +0100
+++ b/src/com/beem/project/beem/BeemService.java	Tue Feb 21 19:35:15 2012 +0100
@@ -50,9 +50,11 @@
 import org.jivesoftware.smack.Connection;
 import org.jivesoftware.smack.Roster;
 import org.jivesoftware.smack.Roster.SubscriptionMode;
+import org.jivesoftware.smack.PacketListener;
 import org.jivesoftware.smack.SmackConfiguration;
 import org.jivesoftware.smack.XMPPConnection;
 import org.jivesoftware.smack.XMPPException;
+import org.jivesoftware.smack.packet.Packet;
 import org.jivesoftware.smack.provider.ProviderManager;
 import org.jivesoftware.smackx.PrivateDataManager;
 import org.jivesoftware.smackx.bookmark.BookmarkManager;
@@ -529,12 +531,12 @@
 		    break;
 		case MESSAGE_MUC_JOIN:
 		    String mucjid = b.getString(BeemIntent.EXTRA_JID);
-		    MultiUserChat muc2 = new MultiUserChat(connection.getAdaptee(), mucjid);
+		    MultiUserChat muc = new MultiUserChat(connection.getAdaptee(), mucjid);
 
 		    DiscussionHistory history = new DiscussionHistory();
 		    history.setMaxStanzas(5);
 		    try {
-			muc2.join("beem", "", history, SmackConfiguration.getPacketReplyTimeout());
+			muc.join("beem", "", history, SmackConfiguration.getPacketReplyTimeout());
 		    } catch (XMPPException e) {
 			Log.e(TAG, "MUC Join Problem", e);
 		    }
@@ -585,31 +587,8 @@
 	    }
 	}
 	//Bookmark : Muc
-	//TODO : Get muc from provider and connect
-	//TODO : Add muc in BeemSync
 	if (mConnection.containsKey(accountName)) {
-	    Connection xmppCo = mConnection.get(accountName).getAdaptee();
-	    Collection<BookmarkedConference> list = null;
-	    try {
-		BookmarkManager bm = BookmarkManager.getBookmarkManager(xmppCo);
-		list = bm.getBookmarkedConferences();
-	    } catch (XMPPException e) {
-		Log.e(TAG, "BookmarkManager", e);
-	    }
-	    for (BookmarkedConference bookmarkedConference : list) {
-		if (bookmarkedConference.isAutoJoin()) {
-		    MultiUserChat muc2 = new MultiUserChat(xmppCo, bookmarkedConference.getJid());
-
-		    DiscussionHistory history = new DiscussionHistory();
-		    history.setMaxStanzas(5);
-		    try {
-			muc2.join(bookmarkedConference.getNickname(), bookmarkedConference.getPassword(), history,
-			    SmackConfiguration.getPacketReplyTimeout());
-		    } catch (XMPPException e) {
-			Log.e(TAG, "MUC Join Problem", e);
-		    }
-		}
-	    }
+	    //TODO AutoConnect
 	}
 	//TODO: ADD MESSAGE || TOAST TO CONFIRM CONNECTION OF THE ACCOUNT
 	sendBroadcast(res);
--- a/src/com/beem/project/beem/ui/ContactList.java	Mon Feb 20 19:51:02 2012 +0100
+++ b/src/com/beem/project/beem/ui/ContactList.java	Tue Feb 21 19:35:15 2012 +0100
@@ -575,9 +575,9 @@
 	    intent.putExtra(BeemIntent.EXTRA_JID, jid);
 	    startService(intent);
 
-	    //	    Intent i = new Intent(ContactList.this, Chat.class);
-	    //	    i.setData(Uri.parse("imto://jabber/" + jid));
-	    //	    startActivity(i);
+	    	    Intent i = new Intent(ContactList.this, Chat.class);
+	    	    i.setData(Uri.parse("imto://jabber/" + jid));
+	    	    startActivity(i);
 	}
     }