From 00c74503abf508b92d8704ed503ab5480e7cf5a1 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 21 Jan 2015 16:18:38 +0100 Subject: deal with user entering full jids in join conference dialog --- .../java/eu/siacs/conversations/services/XmppConnectionService.java | 4 +++- .../java/eu/siacs/conversations/ui/StartConversationActivity.java | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/eu') diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 8b225228..d4f40fec 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -997,8 +997,10 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa conversation.setAccount(account); if (muc) { conversation.setMode(Conversation.MODE_MULTI); + conversation.setContactJid(jid); } else { conversation.setMode(Conversation.MODE_SINGLE); + conversation.setContactJid(jid.toBareJid()); } conversation.setNextEncryption(-1); conversation.addAll(0, databaseBackend.getMessages(conversation, Config.PAGE_SIZE)); @@ -1015,7 +1017,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa conversation = new Conversation(conversationName, account, jid, Conversation.MODE_MULTI); } else { - conversation = new Conversation(conversationName, account, jid, + conversation = new Conversation(conversationName, account, jid.toBareJid(), Conversation.MODE_SINGLE); } this.databaseBackend.createConversation(conversation); diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index 209c0a7b..2154754b 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -448,8 +448,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU if (account.hasBookmarkFor(conferenceJid)) { jid.setError(getString(R.string.bookmark_already_exists)); } else { - final Bookmark bookmark = new Bookmark(account, - conferenceJid); + final Bookmark bookmark = new Bookmark(account,conferenceJid.toBareJid()); bookmark.setAutojoin(true); account.getBookmarks().add(bookmark); xmppConnectionService -- cgit v1.2.3