aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/entities
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-12-11 19:28:44 +0100
committerChristian S <christian@pix-art.de>2015-12-12 15:53:43 +0100
commit1f47a03294f6e59bfa9f0f79343736a1f726d1c8 (patch)
tree0d03380be8d520f19498f77b22ce7319dfdfd98a /src/main/java/eu/siacs/conversations/entities
parent459984c47c064a6392132a4b50d129a5b9d0c4ff (diff)
set bookmark name to room subject if no subject has been set before
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Bookmark.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Bookmark.java b/src/main/java/eu/siacs/conversations/entities/Bookmark.java
index 0210da245..acb4bf1a3 100644
--- a/src/main/java/eu/siacs/conversations/entities/Bookmark.java
+++ b/src/main/java/eu/siacs/conversations/entities/Bookmark.java
@@ -138,6 +138,16 @@ public class Bookmark extends Element implements ListItem {
return this.getAttribute("name");
}
+ public boolean setBookmarkName(String name) {
+ String before = getBookmarkName();
+ if (name != null && !name.equals(before)) {
+ this.setAttribute("name", name);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
public void unregisterConversation() {
if (this.mJoinedConversation != null) {
this.mJoinedConversation.deregisterWithBookmark();