aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/entities
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-07-15 21:54:11 +0200
committeriNPUTmice <daniel@gultsch.de>2014-07-15 21:54:11 +0200
commit9532a9889b9c606b3cf965595abf2af7de29698c (patch)
tree206012bf75928cc02a069ac1d35cf08f99ea579e /src/eu/siacs/conversations/entities
parent177e802a77b30ae5e703f93f36da4a35d7720a05 (diff)
couple of bug fixes related to muc renaming
Diffstat (limited to 'src/eu/siacs/conversations/entities')
-rw-r--r--src/eu/siacs/conversations/entities/MucOptions.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/entities/MucOptions.java b/src/eu/siacs/conversations/entities/MucOptions.java
index d8c8b2a3..3c5190de 100644
--- a/src/eu/siacs/conversations/entities/MucOptions.java
+++ b/src/eu/siacs/conversations/entities/MucOptions.java
@@ -7,7 +7,6 @@ import eu.siacs.conversations.crypto.PgpEngine;
import eu.siacs.conversations.xml.Element;
import eu.siacs.conversations.xmpp.stanzas.PresencePacket;
import android.annotation.SuppressLint;
-import android.util.Log;
@SuppressLint("DefaultLocale")
public class MucOptions {
@@ -147,7 +146,7 @@ public class MucOptions {
}
}
} else if (type.equals("unavailable")) {
- if (name.equals(getJoinNick())) {
+ if (name.equals(self.getName())) {
Element item = packet.findChild("x","http://jabber.org/protocol/muc#user").findChild("item");
String nick = item.getAttribute("nick");
if (nick!=null) {
@@ -155,7 +154,6 @@ public class MucOptions {
if (renameListener!=null) {
renameListener.onRename(true);
}
- this.setJoinNick(nick);
}
}
deleteUser(packet.getAttribute("from").split("/")[1]);
@@ -167,6 +165,7 @@ public class MucOptions {
renameListener.onRename(false);
}
aboutToRename = false;
+ this.setJoinNick(getActualNick());
} else {
this.error = ERROR_NICK_IN_USE;
}
@@ -196,6 +195,14 @@ public class MucOptions {
return this.nick;
}
+ public String getActualNick() {
+ if (this.self.getName()!=null) {
+ return this.self.getName();
+ } else {
+ return this.getProposedNick();
+ }
+ }
+
public void setJoinNick(String nick) {
this.nick = nick;
}