aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs/conversations/utils')
-rw-r--r--src/eu/siacs/conversations/utils/MessageParser.java7
-rw-r--r--src/eu/siacs/conversations/utils/UIHelper.java11
2 files changed, 12 insertions, 6 deletions
diff --git a/src/eu/siacs/conversations/utils/MessageParser.java b/src/eu/siacs/conversations/utils/MessageParser.java
index 2e948b13..4abd781e 100644
--- a/src/eu/siacs/conversations/utils/MessageParser.java
+++ b/src/eu/siacs/conversations/utils/MessageParser.java
@@ -96,7 +96,12 @@ public class MessageParser {
int status;
String[] fromParts = packet.getFrom().split("/");
Conversation conversation = service.findOrCreateConversation(account, fromParts[0],true);
- if ((fromParts.length == 1) || (packet.hasChild("subject"))) {
+ if (packet.hasChild("subject")) {
+ conversation.getMucOptions().setSubject(packet.findChild("subject").getContent());
+ service.updateConversationInGui();
+ return null;
+ }
+ if ((fromParts.length == 1)) {
return null;
}
String counterPart = fromParts[1];
diff --git a/src/eu/siacs/conversations/utils/UIHelper.java b/src/eu/siacs/conversations/utils/UIHelper.java
index f66cc734..5d879714 100644
--- a/src/eu/siacs/conversations/utils/UIHelper.java
+++ b/src/eu/siacs/conversations/utils/UIHelper.java
@@ -133,6 +133,7 @@ public class UIHelper {
.getSystemService(Context.NOTIFICATION_SERVICE);
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
+ boolean useSubject = preferences.getBoolean("use_subject_in_muc", true);
boolean showNofifications = preferences.getBoolean("show_notification",true);
boolean vibrate = preferences.getBoolean("vibrate_on_notification", true);
boolean alwaysNotify = preferences.getBoolean("notify_in_conversation_when_highlighted", false);
@@ -171,9 +172,9 @@ public class UIHelper {
conversation.getName(),
(int) res
.getDimension(android.R.dimen.notification_large_icon_width)));*/
- mBuilder.setLargeIcon(UIHelper.getContactPicture(conversation.getContact(), conversation.getName(), (int) res
+ mBuilder.setLargeIcon(UIHelper.getContactPicture(conversation.getContact(), conversation.getName(useSubject), (int) res
.getDimension(android.R.dimen.notification_large_icon_width), context));
- mBuilder.setContentTitle(conversation.getName());
+ mBuilder.setContentTitle(conversation.getName(useSubject));
if (notify) {
mBuilder.setTicker(conversation.getLatestMessage().getBody().trim());
}
@@ -203,11 +204,11 @@ public class UIHelper {
for (int i = 0; i < unread.size(); ++i) {
targetUuid = unread.get(i).getUuid();
if (i < unread.size() - 1) {
- names.append(unread.get(i).getName() + ", ");
+ names.append(unread.get(i).getName(useSubject) + ", ");
} else {
- names.append(unread.get(i).getName());
+ names.append(unread.get(i).getName(useSubject));
}
- style.addLine(Html.fromHtml("<b>" + unread.get(i).getName()
+ style.addLine(Html.fromHtml("<b>" + unread.get(i).getName(useSubject)
+ "</b> " + unread.get(i).getLatestMessage().getBody().trim()));
}
mBuilder.setContentTitle(unread.size() + " unread Conversations");