fixed message hint

This commit is contained in:
iNPUTmice 2014-08-25 15:43:50 +02:00
parent 4e791c8a01
commit 07b422d4c8

View file

@ -159,7 +159,6 @@ public class ConversationFragment extends Fragment {
private ConversationActivity activity;
private void sendMessage() {
if (mEditMessage.getText().length() < 1) {
if (this.conversation.getMode() == Conversation.MODE_MULTI) {
@ -187,12 +186,16 @@ public class ConversationFragment extends Fragment {
}
public void updateChatMsgHint() {
if (conversation.getNextPresence() != null) {
this.mEditMessage.setHint(getString(R.string.send_private_message_to,conversation.getNextPresence()));
if (conversation.getMode() == Conversation.MODE_MULTI
&& conversation.getNextPresence() != null) {
this.mEditMessage.setHint(getString(
R.string.send_private_message_to,
conversation.getNextPresence()));
} else {
switch (conversation.getNextEncryption()) {
case Message.ENCRYPTION_NONE:
mEditMessage.setHint(getString(R.string.send_plain_text_message));
mEditMessage
.setHint(getString(R.string.send_plain_text_message));
break;
case Message.ENCRYPTION_OTR:
mEditMessage.setHint(getString(R.string.send_otr_message));
@ -241,8 +244,10 @@ public class ConversationFragment extends Fragment {
messagesView = (ListView) view.findViewById(R.id.messages_view);
messagesView.setOnScrollListener(mOnScrollListener);
messagesView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
messageListAdapter = new MessageAdapter((ConversationActivity) getActivity(), this.messageList);
messageListAdapter.setOnContactPictureClicked(new OnContactPictureClicked() {
messageListAdapter = new MessageAdapter(
(ConversationActivity) getActivity(), this.messageList);
messageListAdapter
.setOnContactPictureClicked(new OnContactPictureClicked() {
@Override
public void onContactPictureClicked(Message message) {
@ -255,7 +260,8 @@ public class ConversationFragment extends Fragment {
}
}
});
messageListAdapter.setOnContactPictureLongClicked(new OnContactPictureLongClicked() {
messageListAdapter
.setOnContactPictureLongClicked(new OnContactPictureLongClicked() {
@Override
public void onContactPictureLongClicked(Message message) {
@ -384,12 +390,16 @@ public class ConversationFragment extends Fragment {
final ConversationActivity activity = (ConversationActivity) getActivity();
if (this.conversation != null) {
final Contact contact = this.conversation.getContact();
if (!contact.showInRoster() && contact.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) {
showSnackbar(R.string.contact_added_you, R.string.add_back, new OnClickListener() {
if (!contact.showInRoster()
&& contact
.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) {
showSnackbar(R.string.contact_added_you, R.string.add_back,
new OnClickListener() {
@Override
public void onClick(View v) {
activity.xmppConnectionService.createContact(contact);
activity.xmppConnectionService
.createContact(contact);
activity.switchToContactDetails(contact);
}
});