From 47a6f6f5371842c68505acbf0a71dde935e7ee19 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 30 Mar 2018 22:11:11 +0200 Subject: added dedicated scan button --- .../de/pixart/messenger/ui/ConversationFragment.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/main/java/de/pixart/messenger/ui/ConversationFragment.java') 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) { -- cgit v1.2.3