diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-11-09 16:21:13 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-11-09 16:21:13 +0100 |
commit | 377bd49ee807b9a06089ad5612ca15b9b00f2e36 (patch) | |
tree | 225e53c77c11377b4e64d65b5f33cf9c0c0858e6 /src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | |
parent | 2b99b694eb25ed6ea82563d8a352be774ecc88d2 (diff) |
refactored code to always contain full jid for counterpart
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/ConversationFragment.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 58e29d30..cc022728 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -190,7 +190,7 @@ public class ConversationFragment extends Fragment { } if (mEditMessage.getText().length() < 1) { if (this.conversation.getMode() == Conversation.MODE_MULTI) { - conversation.setNextPresence(null); + conversation.setNextCounterpart(null); updateChatMsgHint(); } return; @@ -199,10 +199,10 @@ public class ConversationFragment extends Fragment { .toString(), conversation.getNextEncryption(activity .forceEncryption())); if (conversation.getMode() == Conversation.MODE_MULTI) { - if (conversation.getNextPresence() != null) { - message.setPresence(conversation.getNextPresence()); + if (conversation.getNextCounterpart() != null) { + message.setCounterpart(conversation.getNextCounterpart()); message.setType(Message.TYPE_PRIVATE); - conversation.setNextPresence(null); + conversation.setNextCounterpart(null); } } if (conversation.getNextEncryption(activity.forceEncryption()) == Message.ENCRYPTION_OTR) { @@ -216,10 +216,10 @@ public class ConversationFragment extends Fragment { public void updateChatMsgHint() { if (conversation.getMode() == Conversation.MODE_MULTI - && conversation.getNextPresence() != null) { + && conversation.getNextCounterpart() != null) { this.mEditMessage.setHint(getString( R.string.send_private_message_to, - conversation.getNextPresence())); + conversation.getNextCounterpart().getResourcepart())); } else { switch (conversation.getNextEncryption(activity.forceEncryption())) { case Message.ENCRYPTION_NONE: @@ -279,8 +279,8 @@ public class ConversationFragment extends Fragment { public void onContactPictureClicked(Message message) { if (message.getStatus() <= Message.STATUS_RECEIVED) { if (message.getConversation().getMode() == Conversation.MODE_MULTI) { - if (message.getPresence() != null) { - highlightInConference(message.getPresence().getResourcepart()); + if (message.getCounterpart() != null) { + highlightInConference(message.getCounterpart().getResourcepart()); } else { highlightInConference(message .getContact().getDisplayName()); @@ -310,9 +310,7 @@ public class ConversationFragment extends Fragment { public void onContactPictureLongClicked(Message message) { if (message.getStatus() <= Message.STATUS_RECEIVED) { if (message.getConversation().getMode() == Conversation.MODE_MULTI) { - if (message.getPresence() != null) { - privateMessageWith(message.getPresence()); - } else { + if (message.getCounterpart() != null) { privateMessageWith(message.getCounterpart()); } } @@ -431,7 +429,7 @@ public class ConversationFragment extends Fragment { protected void privateMessageWith(final Jid counterpart) { this.mEditMessage.setText(""); - this.conversation.setNextPresence(counterpart.toString()); + this.conversation.setNextCounterpart(counterpart); updateChatMsgHint(); } @@ -465,7 +463,7 @@ public class ConversationFragment extends Fragment { this.activity = (ConversationActivity) getActivity(); this.conversation = conversation; if (this.conversation.getMode() == Conversation.MODE_MULTI) { - this.conversation.setNextPresence(null); + this.conversation.setNextCounterpart(null); } this.mEditMessage.setText(""); this.mEditMessage.append(this.conversation.getNextMessage()); @@ -835,7 +833,7 @@ public class ConversationFragment extends Fragment { @Override public void onPresenceSelected() { - message.setPresence(conversation.getNextPresence()); + message.setCounterpart(conversation.getNextCounterpart()); xmppService.sendMessage(message); messageSent(); } |