added missing type='submit' to mam queries

fixed some nasty inheritance problems along the way
fixes #1411
This commit is contained in:
Daniel Gultsch 2015-09-15 22:52:35 +02:00
parent b5719fd747
commit b9002d7fd5
6 changed files with 17 additions and 20 deletions

View File

@ -50,8 +50,8 @@ public class Bookmark extends Element implements ListItem {
if (this.mJoinedConversation != null if (this.mJoinedConversation != null
&& (this.mJoinedConversation.getMucOptions().getSubject() != null)) { && (this.mJoinedConversation.getMucOptions().getSubject() != null)) {
return this.mJoinedConversation.getMucOptions().getSubject(); return this.mJoinedConversation.getMucOptions().getSubject();
} else if (getName() != null) { } else if (getBookmarkName() != null) {
return getName(); return getBookmarkName();
} else { } else {
return this.getJid().getLocalpart(); return this.getJid().getLocalpart();
} }
@ -134,14 +134,10 @@ public class Bookmark extends Element implements ListItem {
this.mJoinedConversation = conversation; this.mJoinedConversation = conversation;
} }
public String getName() { public String getBookmarkName() {
return this.getAttribute("name"); return this.getAttribute("name");
} }
public void setName(String name) {
this.name = name;
}
public void unregisterConversation() { public void unregisterConversation() {
if (this.mJoinedConversation != null) { if (this.mJoinedConversation != null) {
this.mJoinedConversation.deregisterWithBookmark(); this.mJoinedConversation.deregisterWithBookmark();

View File

@ -340,8 +340,8 @@ public class Conversation extends AbstractEntity implements Blockable {
if (getMode() == MODE_MULTI) { if (getMode() == MODE_MULTI) {
if (getMucOptions().getSubject() != null) { if (getMucOptions().getSubject() != null) {
return getMucOptions().getSubject(); return getMucOptions().getSubject();
} else if (bookmark != null && bookmark.getName() != null) { } else if (bookmark != null && bookmark.getBookmarkName() != null) {
return bookmark.getName(); return bookmark.getBookmarkName();
} else { } else {
String generatedName = getMucOptions().createNameFromParticipants(); String generatedName = getMucOptions().createNameFromParticipants();
if (generatedName != null) { if (generatedName != null) {

View File

@ -186,6 +186,7 @@ public class IqGenerator extends AbstractGenerator {
} }
data.put("start", getTimestamp(mam.getStart())); data.put("start", getTimestamp(mam.getStart()));
data.put("end", getTimestamp(mam.getEnd())); data.put("end", getTimestamp(mam.getEnd()));
data.submit();
query.addChild(data); query.addChild(data);
if (mam.getPagingOrder() == MessageArchiveService.PagingOrder.REVERSE) { if (mam.getPagingOrder() == MessageArchiveService.PagingOrder.REVERSE) {
query.addChild("set", "http://jabber.org/protocol/rsm").addChild("before").setContent(mam.getReference()); query.addChild("set", "http://jabber.org/protocol/rsm").addChild("before").setContent(mam.getReference());

View File

@ -1701,8 +1701,8 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
if (packet.getType() == IqPacket.TYPE.RESULT) { if (packet.getType() == IqPacket.TYPE.RESULT) {
Data data = Data.parse(packet.query().findChild("x", "jabber:x:data")); Data data = Data.parse(packet.query().findChild("x", "jabber:x:data"));
for (Field field : data.getFields()) { for (Field field : data.getFields()) {
if (options.containsKey(field.getName())) { if (options.containsKey(field.getFieldName())) {
field.setValue(options.getString(field.getName())); field.setValue(options.getString(field.getFieldName()));
} }
} }
data.submit(); data.submit();

View File

@ -12,9 +12,9 @@ import eu.siacs.conversations.xmpp.jid.InvalidJidException;
import eu.siacs.conversations.xmpp.jid.Jid; import eu.siacs.conversations.xmpp.jid.Jid;
public class Element { public class Element {
protected String name; private final String name;
protected Hashtable<String, String> attributes = new Hashtable<>(); private Hashtable<String, String> attributes = new Hashtable<>();
protected String content; private String content;
protected List<Element> children = new ArrayList<>(); protected List<Element> children = new ArrayList<>();
public Element(String name) { public Element(String name) {
@ -98,7 +98,7 @@ public class Element {
return this; return this;
} }
public String getContent() { public final String getContent() {
return content; return content;
} }
@ -162,7 +162,7 @@ public class Element {
return elementOutput.toString(); return elementOutput.toString();
} }
public String getName() { public final String getName() {
return name; return name;
} }

View File

@ -16,7 +16,7 @@ public class Field extends Element {
super("field"); super("field");
} }
public String getName() { public String getFieldName() {
return this.getAttribute("var"); return this.getAttribute("var");
} }