aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-06-01 20:35:51 +0200
committerChristian Schneppe <christian@pix-art.de>2016-06-01 20:35:51 +0200
commit05100b0a4de85edc6c49c15cdc050ed7ece2b3d0 (patch)
treef702f2a42f7d09a0d2ff20ca7f9f8b65f64643eb /src/main/java
parentc41e6004909c10d4d24c7030d584f8e9fdf52d7c (diff)
parent20ba1add1eaeb43a522189a85471ac3c4e1a3933 (diff)
Merge remote-tracking branch 'refs/remotes/siacs/master'
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Presences.java4
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java4
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java6
-rw-r--r--src/main/java/eu/siacs/conversations/utils/XmlHelper.java2
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java4
5 files changed, 14 insertions, 6 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Presences.java b/src/main/java/eu/siacs/conversations/entities/Presences.java
index 49618f9e6..b3e8966a7 100644
--- a/src/main/java/eu/siacs/conversations/entities/Presences.java
+++ b/src/main/java/eu/siacs/conversations/entities/Presences.java
@@ -55,7 +55,9 @@ public class Presences {
synchronized (this.presences) {
ArrayList<PresenceTemplate> templates = new ArrayList<>(presences.size());
for(Presence p : presences.values()) {
- templates.add(new PresenceTemplate(p.getStatus(),p.getMessage()));
+ if (p.getMessage() != null && !p.getMessage().trim().isEmpty()) {
+ templates.add(new PresenceTemplate(p.getStatus(), p.getMessage()));
+ }
}
return templates;
}
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
index 943090993..7ae89c7ef 100644
--- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
@@ -536,8 +536,8 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
}
}
} else if (!packet.hasChild("body")){ //no body
- if (Config.BACKGROUND_STANZA_LOGGING && !mXmppConnectionService.checkListeners()) {
- Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": " + original);
+ if (Config.BACKGROUND_STANZA_LOGGING && mXmppConnectionService.checkListeners()) {
+ Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": " + packet+ " (carbon="+Boolean.toString(isCarbon)+")");
}
Conversation conversation = mXmppConnectionService.find(account, from.toBareJid());
if (isTypeGroupChat) {
diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
index 8654e1d62..9f3602ffb 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
@@ -379,10 +379,14 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
MenuItem removeAdminPrivileges = menu.findItem(R.id.remove_admin_privileges);
MenuItem removeFromRoom = menu.findItem(R.id.remove_from_room);
MenuItem banFromConference = menu.findItem(R.id.ban_from_conference);
+ MenuItem invite = menu.findItem(R.id.invite);
startConversation.setVisible(true);
if (contact != null) {
showContactDetails.setVisible(true);
}
+ if (user.getRole() == MucOptions.Role.NONE) {
+ invite.setVisible(true);
+ }
if (self.getAffiliation().ranks(MucOptions.Affiliation.ADMIN) &&
self.getAffiliation().outranks(user.getAffiliation())) {
if (mAdvancedMode) {
@@ -403,7 +407,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
}
} else {
MenuItem sendPrivateMessage = menu.findItem(R.id.send_private_message);
- sendPrivateMessage.setVisible(true);
+ sendPrivateMessage.setVisible(user.getRole().ranks(MucOptions.Role.PARTICIPANT));
}
}
diff --git a/src/main/java/eu/siacs/conversations/utils/XmlHelper.java b/src/main/java/eu/siacs/conversations/utils/XmlHelper.java
index 198ce28b9..8cd551a0a 100644
--- a/src/main/java/eu/siacs/conversations/utils/XmlHelper.java
+++ b/src/main/java/eu/siacs/conversations/utils/XmlHelper.java
@@ -7,7 +7,7 @@ public class XmlHelper {
content = content.replace(">", "&gt;");
content = content.replace("\"", "&quot;");
content = content.replace("'", "&apos;");
- content = content.replaceAll("\\p{Cc}", "");
+ content = content.replaceAll("\\p{Cc}&&[^\n\r\t]", "");
return content;
}
}
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index 53da1485c..bd570d82e 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -937,7 +937,8 @@ public class XmppConnection implements Runnable {
if (jid != null && jid.getContent() != null) {
try {
account.setResource(Jid.fromString(jid.getContent()).getResourcepart());
- if (streamFeatures.hasChild("session")) {
+ if (streamFeatures.hasChild("session")
+ && !streamFeatures.findChild("session").hasChild("optional")) {
sendStartSession();
} else {
sendPostBindInitialization();
@@ -1003,6 +1004,7 @@ public class XmppConnection implements Runnable {
}
private void sendStartSession() {
+ Log.d(Config.LOGTAG,account.getJid().toBareJid()+": sending legacy session to outdated server");
final IqPacket startSession = new IqPacket(IqPacket.TYPE.SET);
startSession.addChild("session", "urn:ietf:params:xml:ns:xmpp-session");
this.sendUnmodifiedIqPacket(startSession, new OnIqPacketReceived() {