diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-05-02 21:23:02 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-05-02 21:23:02 +0200 |
commit | 78b8918524aa065165c0c382440a287c40338348 (patch) | |
tree | 864cbbd2134dcb3c11a3dc2c286e886cb1728273 /src/main/java | |
parent | 13ac701df5221e8c6cc1e0af532f96a17fdd6879 (diff) |
added 'view conversation' to context menu
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/SearchActivity.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/SearchActivity.java b/src/main/java/de/pixart/messenger/ui/SearchActivity.java index 7c43bf37c..298bca6c0 100644 --- a/src/main/java/de/pixart/messenger/ui/SearchActivity.java +++ b/src/main/java/de/pixart/messenger/ui/SearchActivity.java @@ -129,6 +129,9 @@ public class SearchActivity extends XmppActivity implements TextWatcher, OnSearc final Message message = selectedMessageReference.get(); if (message != null) { switch (item.getItemId()) { + case R.id.open_conversation: + switchToConversation(wrap(message.getConversation())); + break; case R.id.share_with: ShareUtil.share(this, message); break; @@ -140,6 +143,7 @@ public class SearchActivity extends XmppActivity implements TextWatcher, OnSearc break; case R.id.quote_message: quote(message); + break; } } return super.onContextItemSelected(item); @@ -148,17 +152,20 @@ public class SearchActivity extends XmppActivity implements TextWatcher, OnSearc private void quote(Message message) { String text = MessageUtils.prepareQuote(message); final Conversational conversational = message.getConversation(); + switchToConversationAndQuote(wrap(message.getConversation()), text); + } + + private Conversation wrap(Conversational conversational) { final Conversation conversation; if (conversational instanceof Conversation) { - conversation = (Conversation) conversational; + return (Conversation) conversational; } else { - conversation = xmppConnectionService.findOrCreateConversation(conversational.getAccount(), + return xmppConnectionService.findOrCreateConversation(conversational.getAccount(), conversational.getJid(), conversational.getMode() == Conversational.MODE_MULTI, true, true); } - switchToConversationAndQuote(conversation, text); } @Override |