diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-03-14 22:40:56 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-03-14 22:40:56 +0100 |
commit | b1a3d09ca6a4be59b57e2f7b1cdc8a245d60a858 (patch) | |
tree | ca6d7f5eafd7bbe3deff4e9ad7a1f4a9a0a77bf3 /src/eu/siacs/conversations/utils | |
parent | 4e4a767743a62d1f88814e5cf024bf983772df2c (diff) |
use conference subject to identiy room
Diffstat (limited to 'src/eu/siacs/conversations/utils')
-rw-r--r-- | src/eu/siacs/conversations/utils/MessageParser.java | 7 | ||||
-rw-r--r-- | src/eu/siacs/conversations/utils/UIHelper.java | 11 |
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"); |