Skip to content

Commit

Permalink
for #98: Don't advertise 'free text search' for archives that do not …
Browse files Browse the repository at this point in the history
…support it. (#99)
  • Loading branch information
guusdk authored and akrherz committed Oct 30, 2020
1 parent 3426701 commit 592271f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ <h1>
<p><b>2.0.1</b> -- (to be determined)</p>
<ul>
<li>[<a href='https://github.com/igniterealtime/openfire-monitoring-plugin/issues/91'>Issue #91</a>] - Exception when search text contains special characters</li>
<li>[<a href='https://github.com/igniterealtime/openfire-monitoring-plugin/issues/94'>Issue #94</a>] - Do not advertise 'free text search' feature for personal archives (that do not support that feature).</li>
<li>[<a href='https://github.com/igniterealtime/openfire-monitoring-plugin/issues/98'>Issue #98</a>] - MAM IQ result missing first and last element</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,18 @@ private IQ buildSupportedFieldsResult(IQ packet) {
form.addField("with", "Author of message", FormField.Type.jid_single);
form.addField("start", "Message sent on or after timestamp.", FormField.Type.text_single);
form.addField("end", "Message sent on or before timestamp.", FormField.Type.text_single);
form.addField("{urn:xmpp:fulltext:0}fulltext", "Free text search", FormField.Type.text_single);

final boolean isMuc;
if (packet.getTo() == null ) {
isMuc = false;
} else {
isMuc = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(packet.getTo()) != null;
}

// Issue #94: one-on-one chat archives do not support full text search. Only advertise that feature for MUC archves.
if (isMuc) {
form.addField("{urn:xmpp:fulltext:0}fulltext", "Free text search", FormField.Type.text_single);
}

query.add(form.getElement());

Expand Down

0 comments on commit 592271f

Please sign in to comment.