diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-10-24 14:34:46 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-10-24 14:34:46 +0200 |
commit | 864f3610b30d684a19fe86eff22835a5ba2e92c4 (patch) | |
tree | 008580a0bbe476744d2648a6fe503d9b137ad211 /src/eu/siacs/conversations/ui | |
parent | 1dae59141d345ae023ce94679f087f92b8b999d2 (diff) |
picture notification and some drive by bug fixes
Diffstat (limited to 'src/eu/siacs/conversations/ui')
3 files changed, 14 insertions, 21 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java index 8a647f30c..28325eea8 100644 --- a/src/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/eu/siacs/conversations/ui/ConversationActivity.java @@ -629,23 +629,11 @@ public class ConversationActivity extends XmppActivity implements @Override protected void onNewIntent(Intent intent) { if (xmppConnectionServiceBound) { - if ((Intent.ACTION_VIEW.equals(intent.getAction()) && (VIEW_CONVERSATION - .equals(intent.getType())))) { - String convToView = (String) intent.getExtras().get( - CONVERSATION); - updateConversationList(); - for (int i = 0; i < conversationList.size(); ++i) { - if (conversationList.get(i).getUuid().equals(convToView)) { - setSelectedConversation(conversationList.get(i)); - break; - } - } - paneShouldBeOpen = false; - String text = intent.getExtras().getString(TEXT, null); - swapConversationFragment().setText(text); + if (intent != null + && VIEW_CONVERSATION.equals(getIntent().getType())) { + handleViewConversationIntent(intent); } } else { - handledViewIntent = false; setIntent(intent); } } @@ -705,11 +693,7 @@ public class ConversationActivity extends XmppActivity implements mOpenConverstaion = null; } else if (getIntent() != null && VIEW_CONVERSATION.equals(getIntent().getType())) { - String uuid = (String) getIntent().getExtras().get(CONVERSATION); - String text = getIntent().getExtras().getString(TEXT, null); - selectConversationByUuid(uuid); - paneShouldBeOpen = false; - swapConversationFragment().setText(text); + handleViewConversationIntent(getIntent()); setIntent(null); } else { showConversationsOverview(); @@ -731,6 +715,14 @@ public class ConversationActivity extends XmppActivity implements } ExceptionHelper.checkForCrash(this, this.xmppConnectionService); } + + private void handleViewConversationIntent(Intent intent) { + String uuid = (String) intent.getExtras().get(CONVERSATION); + String text = intent.getExtras().getString(TEXT, null); + selectConversationByUuid(uuid); + paneShouldBeOpen = false; + swapConversationFragment().setText(text); + } private void selectConversationByUuid(String uuid) { for (int i = 0; i < conversationList.size(); ++i) { diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java index c04a4c0b3..02157e747 100644 --- a/src/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/eu/siacs/conversations/ui/XmppActivity.java @@ -58,7 +58,6 @@ public abstract class XmppActivity extends Activity { public XmppConnectionService xmppConnectionService; public boolean xmppConnectionServiceBound = false; - protected boolean handledViewIntent = false; protected int mPrimaryTextColor; protected int mSecondaryTextColor; diff --git a/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java index 0c294e7e7..b2e5dd077 100644 --- a/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -100,6 +100,8 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { mLastMessage.setText(""); } } else if (message.getEncryption() == Message.ENCRYPTION_PGP) { + imagePreview.setVisibility(View.GONE); + mLastMessage.setVisibility(View.VISIBLE); mLastMessage.setText(R.string.encrypted_message_received); } else { mLastMessage.setVisibility(View.GONE); |