Skip to content

Commit edecb88

Browse files
kunall17niftynei
authored andcommitted
Fixes: nodejs#131 Show Title and name in header if narrowed to self PM's
1 parent 671b449 commit edecb88

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

app/src/main/java/com/zulip/android/filters/NarrowFilterPM.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public boolean matches(Message msg) {
7474
public String getTitle() {
7575
ArrayList<String> names = new ArrayList<>();
7676
for (Person person : people) {
77-
if (!person.equals(ZulipApp.get().getYou())) {
77+
if (!person.equals(ZulipApp.get().getYou()) || people.size() == 1) { //If PM to self then show title as your name
7878
names.add(person.getName());
7979
}
8080
}

app/src/main/java/com/zulip/android/models/Message.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public void setRecipient(String[] emails) {
231231

232232
/**
233233
* Constructs a pretty-printable-to-the-user string consisting of the names
234-
* of all of the participants in the message, minus you.
234+
* of all of the participants in the message.
235235
* <p/>
236236
* For MessageType.STREAM_MESSAGE, return the stream name instead.
237237
*
@@ -246,14 +246,15 @@ public String getDisplayRecipient(ZulipApp app) {
246246
ArrayList<String> names = new ArrayList<>();
247247

248248
for (Person person : people) {
249-
if (person.id != app.getYou().id) {
249+
if (person.id != app.getYou().id || people.length == 1) {
250250
names.add(person.getName());
251251
}
252252
}
253253
return TextUtils.join(", ", names);
254254
}
255255
}
256256

257+
257258
/**
258259
* Creates a comma-separated String of the email addressed of all the
259260
* recipients of the message, as would be suitable to place in the compose

0 commit comments

Comments
 (0)