# HG changeset patch # User Vincent V. # Date 1326020902 -3600 # Node ID 039fe4e3534f7a8c06f90df490f29d85a6e4cd12 # Parent 7c079b0f146ab919f749d01f5bfc2fafc7ddf76e muc : setup auto-join option diff -r 7c079b0f146a -r 039fe4e3534f src/com/beem/project/beem/BeemService.java --- a/src/com/beem/project/beem/BeemService.java Thu Jan 05 23:26:33 2012 +0100 +++ b/src/com/beem/project/beem/BeemService.java Sun Jan 08 12:08:22 2012 +0100 @@ -566,26 +566,28 @@ } } + //Bookmark : Muc if (mConnection.containsKey(accountName)) { Connection xmppCo = mConnection.get(accountName).getAdaptee(); Collection list = null; - try { + try { BookmarkManager bm = BookmarkManager.getBookmarkManager(xmppCo); list = bm.getBookmarkedConferences(); } catch (XMPPException e) { Log.e(TAG, "BookmarkManager", e); } for (BookmarkedConference bookmarkedConference : list) { - Log.e("TAG + BOOKMARK", bookmarkedConference.getName()); - // Create a MultiUserChat using a Connection for a room - MultiUserChat muc2 = new MultiUserChat(xmppCo, bookmarkedConference.getJid()); + 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); + 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); + } } } }