aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/entities/MucOptions.java
diff options
context:
space:
mode:
authorMichael <betheg@bitcloner.org>2014-09-07 14:06:23 +0200
committerMichael <betheg@bitcloner.org>2014-09-07 14:06:23 +0200
commitecd613dcdd4288b52fea893192c75f3e527436ea (patch)
tree5a09a1dc8093355fde000286f6c20ebeae713dd1 /src/eu/siacs/conversations/entities/MucOptions.java
parentd9990e6cd8bb4f2d9bc5696019f757db8a732b1f (diff)
MUC: set the password from bookmarks.
Diffstat (limited to 'src/eu/siacs/conversations/entities/MucOptions.java')
-rw-r--r--src/eu/siacs/conversations/entities/MucOptions.java28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/eu/siacs/conversations/entities/MucOptions.java b/src/eu/siacs/conversations/entities/MucOptions.java
index 72fbeeabb..3988eae0c 100644
--- a/src/eu/siacs/conversations/entities/MucOptions.java
+++ b/src/eu/siacs/conversations/entities/MucOptions.java
@@ -108,6 +108,7 @@ public class MucOptions {
private String subject = null;
private String joinnick;
private String password = null;
+ private boolean passwordChanged = false;
public MucOptions(Account account) {
this.account = account;
@@ -157,6 +158,10 @@ public class MucOptions {
}
aboutToRename = false;
}
+ if (conversation.getBookmark() != null &&
+ conversation.getBookmark().isProvidePassword()) {
+ this.passwordChanged = false;
+ }
} else {
addUser(user);
}
@@ -189,6 +194,10 @@ public class MucOptions {
this.error = ERROR_NICK_IN_USE;
}
} else if (error.hasChild("not-authorized")) {
+ if (conversation.getBookmark() != null &&
+ conversation.getBookmark().isProvidePassword()) {
+ this.passwordChanged = true;
+ }
this.error = ERROR_PASSWORD_REQUIRED;
}
}
@@ -314,10 +323,25 @@ public class MucOptions {
}
public String getPassword() {
- return this.password;
+ if (conversation.getBookmark() != null &&
+ conversation.getBookmark().getPassword() != null) {
+ return conversation.getBookmark().getPassword();
+ } else {
+ return this.password;
+ }
}
public void setPassword(String password) {
- this.password = password;
+ if (conversation.getBookmark() != null &&
+ conversation.getBookmark().isProvidePassword()) {
+ conversation.getBookmark().setPassword(password);
+ } else {
+ this.password = password;
+ }
+ }
+
+ public boolean isPasswordChanged() {
+ return this.passwordChanged;
}
+
} \ No newline at end of file