aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Conversation.java13
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java28
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java4
3 files changed, 36 insertions, 9 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java
index 6d99e3588..b0e128ee8 100644
--- a/src/main/java/eu/siacs/conversations/entities/Conversation.java
+++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java
@@ -344,6 +344,19 @@ public class Conversation extends AbstractEntity implements Blockable {
}
}
+ public String getParticipants() {
+ if (getMode() == MODE_MULTI) {
+ String generatedName = getMucOptions().createNameFromParticipants();
+ if (generatedName != null) {
+ return generatedName;
+ } else {
+ return getJid().getLocalpart();
+ }
+ } else {
+ return null;
+ }
+ }
+
public String getAccountUuid() {
return this.accountUuid;
}
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index 9980d3bab..3f8841f33 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -17,6 +17,7 @@ import android.provider.MediaStore;
import android.support.v4.widget.SlidingPaneLayout;
import android.support.v4.widget.SlidingPaneLayout.PanelSlideListener;
import android.util.Log;
+import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@@ -51,6 +52,7 @@ import eu.siacs.conversations.services.XmppConnectionService.OnRosterUpdate;
import eu.siacs.conversations.ui.adapter.ConversationAdapter;
import eu.siacs.conversations.utils.ExceptionHelper;
import eu.siacs.conversations.xmpp.OnUpdateBlocklist;
+import eu.siacs.conversations.xmpp.chatstate.ChatState;
import eu.siacs.conversations.xmpp.jid.InvalidJidException;
import eu.siacs.conversations.xmpp.jid.Jid;
@@ -306,12 +308,12 @@ public class ConversationActivity extends XmppActivity
public void switchToConversation(Conversation conversation) {
setSelectedConversation(conversation);
runOnUiThread(new Runnable() {
- @Override
- public void run() {
- ConversationActivity.this.mConversationFragment.reInit(getSelectedConversation());
- openConversation();
- }
- });
+ @Override
+ public void run() {
+ ConversationActivity.this.mConversationFragment.reInit(getSelectedConversation());
+ openConversation();
+ }
+ });
}
private void updateActionBarTitle() {
@@ -327,13 +329,25 @@ public class ConversationActivity extends XmppActivity
ab.setHomeButtonEnabled(true);
if (conversation.getMode() == Conversation.MODE_SINGLE || useSubjectToIdentifyConference()) {
ab.setTitle(conversation.getName());
+ if (conversation.getMode() == Conversation.MODE_SINGLE) {
+ ChatState state = conversation.getIncomingChatState();
+ if (state == ChatState.COMPOSING) {
+ ab.setSubtitle(getString(R.string.contact_is_typing, conversation.getName()));
+ } else if (state == ChatState.PAUSED) {
+ ab.setSubtitle(null);
+ }
+ } else if (useSubjectToIdentifyConference()){
+ ab.setSubtitle(conversation.getParticipants() + ", " + getText(R.string.you));
+ }
} else {
ab.setTitle(conversation.getJid().toBareJid().toString());
+ ab.setSubtitle(null);
}
} else {
ab.setDisplayHomeAsUpEnabled(false);
- ab.setHomeButtonEnabled(false);
+ ab.setHomeButtonEnabled(false);
ab.setTitle(R.string.app_name);
+ ab.setSubtitle(null);
}
}
}
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index 842447c1f..80f63d812 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -995,9 +995,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
if (conversation.getMode() == Conversation.MODE_SINGLE) {
ChatState state = conversation.getIncomingChatState();
if (state == ChatState.COMPOSING) {
- this.messageList.add(Message.createStatusMessage(conversation, getString(R.string.contact_is_typing, conversation.getName())));
+ //this.messageList.add(Message.createStatusMessage(conversation, getString(R.string.contact_is_typing, conversation.getName())));
} else if (state == ChatState.PAUSED) {
- this.messageList.add(Message.createStatusMessage(conversation, getString(R.string.contact_has_stopped_typing, conversation.getName())));
+ //this.messageList.add(Message.createStatusMessage(conversation, getString(R.string.contact_has_stopped_typing, conversation.getName())));
} else {
for (int i = this.messageList.size() - 1; i >= 0; --i) {
if (this.messageList.get(i).getStatus() == Message.STATUS_RECEIVED) {