aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-05-26 17:46:58 +0200
committerlookshe <github@lookshe.org>2016-05-26 17:46:58 +0200
commit327cfb8ae52443c3cb7ff7f09a753300365a306c (patch)
tree02ed62c978685ce7f481d98ed4d2bd3c508587a6 /src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
parent2860088f0ea1cd5753756861c71cc7c118094f32 (diff)
parent33218ec32a47292a46d574e5107164b8e8a72e40 (diff)
Merge tag '1.12.4' into trz/merge_1.12.4 (not tested yet)trz/merge_1.12.4
Conflicts: README.md art/render.rb build.gradle src/main/java/eu/siacs/conversations/Config.java src/main/java/eu/siacs/conversations/crypto/PgpEngine.java src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java src/main/java/eu/siacs/conversations/crypto/axolotl/SQLiteAxolotlStore.java src/main/java/eu/siacs/conversations/crypto/axolotl/XmppAxolotlSession.java src/main/java/eu/siacs/conversations/entities/Bookmark.java src/main/java/eu/siacs/conversations/entities/Contact.java src/main/java/eu/siacs/conversations/entities/ListItem.java src/main/java/eu/siacs/conversations/entities/Message.java src/main/java/eu/siacs/conversations/parser/IqParser.java src/main/java/eu/siacs/conversations/parser/PresenceParser.java src/main/java/eu/siacs/conversations/persistance/DatabaseBackend.java src/main/java/eu/siacs/conversations/persistance/FileBackend.java src/main/java/eu/siacs/conversations/services/XmppConnectionService.java src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java src/main/java/eu/siacs/conversations/ui/SettingsActivity.java src/main/java/eu/siacs/conversations/ui/ShareWithActivity.java src/main/java/eu/siacs/conversations/ui/XmppActivity.java src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java src/main/java/eu/siacs/conversations/utils/DNSHelper.java src/main/java/eu/siacs/conversations/utils/UIHelper.java src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java src/main/res/layout/activity_contact_details.xml src/main/res/layout/message_received.xml src/main/res/layout/message_sent.xml src/main/res/values-bg/strings.xml src/main/res/values-de/strings.xml src/main/res/values-es/strings.xml src/main/res/values-eu/strings.xml src/main/res/values-fr/strings.xml src/main/res/values-ja/strings.xml src/main/res/values-nl/strings.xml src/main/res/values-pt-rBR/strings.xml src/main/res/values-pt/strings.xml src/main/res/values-ro-rRO/strings.xml src/main/res/values-sr/strings.xml src/main/res/values-sv/strings.xml src/main/res/values-tr-rTR/strings.xml
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/ConversationFragment.java')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java38
1 files changed, 24 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 6d170787..fd77e528 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -11,6 +11,7 @@ import android.content.Intent;
import android.content.IntentSender;
import android.content.IntentSender.SendIntentException;
import android.os.Bundle;
+import android.os.Handler;
import android.support.annotation.Nullable;
import android.text.InputType;
import android.view.ContextMenu;
@@ -464,21 +465,27 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
public void onContactPictureClicked(Message message) {
if (message.getStatus() <= Message.STATUS_RECEIVED) {
if (message.getConversation().getMode() == Conversation.MODE_MULTI) {
- if (message.getCounterpart() != null) {
- String user = message.getCounterpart().isBareJid() ? message.getCounterpart().toString() : message.getCounterpart().getResourcepart();
+ Jid user = message.getCounterpart();
+ if (user != null && !user.isBareJid()) {
if (!message.getConversation().getMucOptions().isUserInRoom(user)) {
- Toast.makeText(activity,activity.getString(R.string.user_has_left_conference,user),Toast.LENGTH_SHORT).show();
+ Toast.makeText(activity,activity.getString(R.string.user_has_left_conference,user.getResourcepart()),Toast.LENGTH_SHORT).show();
}
- highlightInConference(user);
+ highlightInConference(user.getResourcepart());
}
} else {
activity.switchToContactDetails(message.getContact(), message.getFingerprint());
}
} else {
Account account = message.getConversation().getAccount();
- Intent intent = new Intent(activity, EditAccountActivity.class);
+ Intent intent;
+ if (activity.manuallyChangePresence()) {
+ intent = new Intent(activity, SetPresenceActivity.class);
+ intent.putExtra(SetPresenceActivity.EXTRA_ACCOUNT, account.getJid().toBareJid().toString());
+ } else {
+ intent = new Intent(activity, EditAccountActivity.class);
intent.putExtra("jid", account.getJid().toBareJid().toString());
intent.putExtra("fingerprint", message.getFingerprint());
+ }
startActivity(intent);
}
}
@@ -490,14 +497,12 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
public void onContactPictureLongClicked(Message message) {
if (message.getStatus() <= Message.STATUS_RECEIVED) {
if (message.getConversation().getMode() == Conversation.MODE_MULTI) {
- if (message.getCounterpart() != null) {
- String user = message.getCounterpart().getResourcepart();
- if (user != null) {
+ Jid user = message.getCounterpart();
+ if (user != null && !user.isBareJid()) {
if (message.getConversation().getMucOptions().isUserInRoom(user)) {
- privateMessageWith(message.getCounterpart());
+ privateMessageWith(user);
} else {
- Toast.makeText(activity, activity.getString(R.string.user_has_left_conference, user), Toast.LENGTH_SHORT).show();
- }
+ Toast.makeText(activity, activity.getString(R.string.user_has_left_conference, user.getResourcepart()), Toast.LENGTH_SHORT).show();
}
}
}
@@ -935,10 +940,15 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
private void messageSent() {
- int size = this.messageList.size();
- messagesView.setSelection(size - 1);
mEditMessage.setText("");
updateChatMsgHint();
+ new Handler().post(new Runnable() {
+ @Override
+ public void run() {
+ int size = messageList.size();
+ messagesView.setSelection(size - 1);
+ }
+ });
}
public void setFocusOnInputField() {
@@ -1147,7 +1157,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
return;
}
if (conversation.getAccount().getPgpSignature() == null) {
- activity.announcePgp(conversation.getAccount(), conversation);
+ activity.announcePgp(conversation.getAccount(), conversation, activity.onOpenPGPKeyPublished);
return;
}
if (conversation.getMode() == Conversation.MODE_SINGLE) {