aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/entities/MucOptions.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/MucOptions.java b/src/main/java/de/pixart/messenger/entities/MucOptions.java
index 6560e3bb7..86c8c3326 100644
--- a/src/main/java/de/pixart/messenger/entities/MucOptions.java
+++ b/src/main/java/de/pixart/messenger/entities/MucOptions.java
@@ -3,6 +3,7 @@ package de.pixart.messenger.entities;
import android.annotation.SuppressLint;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -20,6 +21,8 @@ import de.pixart.messenger.xmpp.pep.Avatar;
@SuppressLint("DefaultLocale")
public class MucOptions {
+ private static List<String> LOCALPART_BLACKLIST = Arrays.asList("xmpp", "jabber");
+
private boolean mAutoPushConfiguration = true;
public Account getAccount() {
@@ -599,7 +602,14 @@ public class MucOptions {
} else if (!conversation.getJid().isBareJid()) {
return conversation.getJid().getResourcepart();
} else {
- return account.getUsername();
+ Jid jid = account.getJid();
+ if (LOCALPART_BLACKLIST.contains(jid.getLocalpart())) {
+ final String domain = jid.getDomainpart();
+ final int index = domain.lastIndexOf('.');
+ return index > 1 ? domain.substring(0, index) : domain;
+ } else {
+ return jid.getLocalpart();
+ }
}
}