diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-03-30 22:11:11 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-03-30 22:11:11 +0200 |
commit | 47a6f6f5371842c68505acbf0a71dde935e7ee19 (patch) | |
tree | be9fef300a0523e31550ab64f7c56be1867c2a36 /src/main/java/de/pixart/messenger/ui/ConversationFragment.java | |
parent | 255406a86fd8bfa757b39b07c1adac7cfe493cc5 (diff) |
added dedicated scan button
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/ConversationFragment.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index d056194a5..718b0d8b9 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -1851,28 +1851,31 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke } private void reInit(Conversation conversation) { - Log.d(Config.LOGTAG, "reInit()"); + reInit(conversation, false); + } + + private void reInit(Conversation conversation, boolean restore) { if (conversation == null) { - Log.d(Config.LOGTAG, "conversation was null :("); return; } if (this.activity == null) { - Log.d(Config.LOGTAG, "activity was null"); this.conversation = conversation; return; } - + Log.d(Config.LOGTAG, "reInit(restore=" + Boolean.toString(restore) + ")"); setupIme(); if (this.conversation != null) { final String msg = this.binding.textinput.getText().toString(); if (this.conversation.setNextMessage(msg)) { activity.xmppConnectionService.updateConversation(conversation); } - if (this.conversation != conversation) { + if (this.conversation != conversation && !restore) { updateChatState(this.conversation, msg); messageListAdapter.stopAudioPlayer(); } - this.conversation.trim(); + if (!restore) { + this.conversation.trim(); + } } if (activity != null) { @@ -2624,7 +2627,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke clearPending(); return; } - reInit(conversation); + reInit(conversation, true); } ActivityResult activityResult = postponedActivityResult.pop(); if (activityResult != null) { |