aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2015-08-11 20:30:11 +0200
committerlookshe <github@lookshe.org>2015-08-11 20:30:11 +0200
commit639babfdb5289a035e0a22bf607c068caefa5c99 (patch)
tree6a11aa6a189f3a5988d5d1e1c733d2027bc3494f /src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java
parent1b5966ae3b1108c88a810d7d32a0aefa8812d11f (diff)
parent8fd688ca96005152be754eeba1be72c7c0aab9ad (diff)
Merge branch 'trz/rebase' into trz/rename
Conflicts: build.gradle src/main/java/de/thedevstack/conversationsplus/crypto/OtrEngine.java src/main/java/de/thedevstack/conversationsplus/entities/Account.java src/main/java/de/thedevstack/conversationsplus/entities/Contact.java src/main/java/de/thedevstack/conversationsplus/entities/Downloadable.java src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java src/main/java/de/thedevstack/conversationsplus/entities/DownloadablePlaceholder.java src/main/java/de/thedevstack/conversationsplus/entities/Message.java src/main/java/de/thedevstack/conversationsplus/generator/IqGenerator.java src/main/java/de/thedevstack/conversationsplus/http/HttpConnection.java src/main/java/de/thedevstack/conversationsplus/http/HttpConnectionManager.java src/main/java/de/thedevstack/conversationsplus/parser/AbstractParser.java src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java src/main/java/de/thedevstack/conversationsplus/parser/PresenceParser.java src/main/java/de/thedevstack/conversationsplus/persistance/DatabaseBackend.java src/main/java/de/thedevstack/conversationsplus/persistance/FileBackend.java src/main/java/de/thedevstack/conversationsplus/services/NotificationService.java src/main/java/de/thedevstack/conversationsplus/services/XmppConnectionService.java src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java src/main/java/de/thedevstack/conversationsplus/ui/SettingsActivity.java src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java src/main/java/de/thedevstack/conversationsplus/ui/adapter/AccountAdapter.java src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java src/main/java/de/thedevstack/conversationsplus/ui/adapter/ListItemAdapter.java src/main/java/de/thedevstack/conversationsplus/ui/adapter/MessageAdapter.java src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java src/main/java/de/thedevstack/conversationsplus/xmpp/jingle/JingleConnection.java src/main/java/de/thedevstack/conversationsplus/xmpp/jingle/JingleConnectionManager.java src/main/java/de/thedevstack/conversationsplus/xmpp/jingle/JingleInbandTransport.java src/main/java/de/thedevstack/conversationsplus/xmpp/jingle/JingleSocks5Transport.java src/main/java/de/thedevstack/conversationsplus/xmpp/stanzas/MessagePacket.java src/main/java/eu/siacs/conversations/crypto/OtrEngine.java src/main/java/eu/siacs/conversations/crypto/OtrService.java src/main/java/eu/siacs/conversations/entities/DownloadablePlaceholder.java src/main/java/eu/siacs/conversations/entities/TransferablePlaceholder.java src/main/java/eu/siacs/conversations/http/HttpConnection.java src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java src/main/res/layout/activity_about.xml
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java
index c0500375..c5ac3985 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/StartConversationActivity.java
@@ -42,6 +42,7 @@ import android.widget.Checkable;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Spinner;
+import android.widget.Toast;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
@@ -64,6 +65,7 @@ import de.thedevstack.conversationsplus.services.XmppConnectionService.OnRosterU
import de.thedevstack.conversationsplus.ui.adapter.KnownHostsAdapter;
import de.thedevstack.conversationsplus.ui.adapter.ListItemAdapter;
import de.thedevstack.conversationsplus.utils.XmppUri;
+import de.thedevstack.conversationsplus.xmpp.XmppConnection;
import de.thedevstack.conversationsplus.xmpp.OnUpdateBlocklist;
import de.thedevstack.conversationsplus.xmpp.jid.InvalidJidException;
import de.thedevstack.conversationsplus.xmpp.jid.Jid;
@@ -262,9 +264,12 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
protected void openConversationForBookmark(int position) {
Bookmark bookmark = (Bookmark) conferences.get(position);
- Conversation conversation = xmppConnectionService
- .findOrCreateConversation(bookmark.getAccount(),
- bookmark.getJid(), true);
+ Jid jid = bookmark.getJid();
+ if (jid == null) {
+ Toast.makeText(this,R.string.invalid_jid,Toast.LENGTH_SHORT).show();
+ return;
+ }
+ Conversation conversation = xmppConnectionService.findOrCreateConversation(bookmark.getAccount(),jid, true);
conversation.setBookmark(bookmark);
if (!conversation.getMucOptions().online()) {
xmppConnectionService.joinMuc(conversation);
@@ -757,14 +762,16 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
} else {
activity.contact_context_id = acmi.position;
final Blockable contact = (Contact) activity.contacts.get(acmi.position);
-
final MenuItem blockUnblockItem = menu.findItem(R.id.context_contact_block_unblock);
- if (blockUnblockItem != null) {
+ XmppConnection xmpp = contact.getAccount().getXmppConnection();
+ if (xmpp != null && xmpp.getFeatures().blocking()) {
if (contact.isBlocked()) {
blockUnblockItem.setTitle(R.string.unblock_contact);
} else {
blockUnblockItem.setTitle(R.string.block_contact);
}
+ } else {
+ blockUnblockItem.setVisible(false);
}
}
}