aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/entities
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-07-16 12:34:09 +0200
committeriNPUTmice <daniel@gultsch.de>2014-07-16 12:34:09 +0200
commite79a34b651a626b93686b8c578280b77c54b6138 (patch)
tree0a09589dda9e69c22f069f9efa815a32673aa8cd /src/eu/siacs/conversations/entities
parenteb8253d49a432412b8a27d4f61f8f009ace4d79b (diff)
redesigned muc details a little bit
Diffstat (limited to 'src/eu/siacs/conversations/entities')
-rw-r--r--src/eu/siacs/conversations/entities/MucOptions.java28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/eu/siacs/conversations/entities/MucOptions.java b/src/eu/siacs/conversations/entities/MucOptions.java
index 3c5190de..766300ff 100644
--- a/src/eu/siacs/conversations/entities/MucOptions.java
+++ b/src/eu/siacs/conversations/entities/MucOptions.java
@@ -87,7 +87,7 @@ public class MucOptions {
private boolean aboutToRename = false;
private User self = new User();
private String subject = null;
- private String nick;
+ private String joinnick;
public MucOptions(Account account) {
this.account = account;
@@ -124,10 +124,16 @@ public class MucOptions {
user.setAffiliation(item.getAttribute("affiliation"));
user.setRole(item.getAttribute("role"));
user.setName(name);
- if (name.equals(getJoinNick())) {
+ if (name.equals(this.joinnick)) {
this.isOnline = true;
this.error = 0;
self = user;
+ if (aboutToRename) {
+ if (renameListener!=null) {
+ renameListener.onRename(true);
+ }
+ aboutToRename = false;
+ }
} else {
addUser(user);
}
@@ -146,16 +152,6 @@ public class MucOptions {
}
}
} else if (type.equals("unavailable")) {
- 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) {
- aboutToRename = false;
- if (renameListener!=null) {
- renameListener.onRename(true);
- }
- }
- }
deleteUser(packet.getAttribute("from").split("/")[1]);
} else if (type.equals("error")) {
Element error = packet.findChild("error");
@@ -191,10 +187,6 @@ public class MucOptions {
}
}
- public String getJoinNick() {
- return this.nick;
- }
-
public String getActualNick() {
if (this.self.getName()!=null) {
return this.self.getName();
@@ -204,7 +196,7 @@ public class MucOptions {
}
public void setJoinNick(String nick) {
- this.nick = nick;
+ this.joinnick = nick;
}
public void setConversation(Conversation conversation) {
@@ -282,6 +274,6 @@ public class MucOptions {
}
public String getJoinJid() {
- return this.conversation.getContactJid().split("/")[0]+"/"+this.getJoinNick();
+ return this.conversation.getContactJid().split("/")[0]+"/"+this.joinnick;
}
} \ No newline at end of file